看到没有?!最关键的参数:-mtdev -evdev ,因为运行的时候需要输入:
./zsy.bin -platform linuxfb -plugin evdevkeyboard=/dev/input/input0 evdevmouse=/dev/input/input1
The linuxfb plugin allows specifying additional settings by passing them in theQT_QPA_PLATFORM environment variable or-platform command-line option.
For example,QT_QPA_PLATFORM=linuxfb:fb=/dev/fb1 specifies that the framebuffer device/dev/fb1 should be used instead of the defaultfb0. Multiple settings can
be specfified by separating them with a colon.
fb=/dev/fbN- Specifies the framebuffer devices. On multiple display setups this will typically allow running the application on different displays. For the time being there is no way to use multiple framebuffers from one Qt application.size=<width>x<height> - Specifies the screen size in pixels. The plugin will try to query the display dimensions, both physical and logical, from the framebuffer device. This may not always lead to proper results however, and therefore it may become necessary to explicitly specify the values.mmSize=<width>x<height> - Physical width and height in millimeters.offset=<width>x<height> - Offset in pixels specifying the top-left corner of the screen. The default position is at(0, 0).nographicsmodeswitch- Do not switch the virtual terminal to graphics mode (KD_GRAPHICS). In addition to switching to graphics mode, the blinking cursor and screen blanking are normally disabled too. When this parameter is set, these are also skipped.tty=/dev/ttyN- Overrides the virtual console. Only used whennographicsmodeswitchis not set.
When no windowing system is present, the mouse, keyboard and touch input are read directly viaevdev or using helper libraries liketslib. Note that this requires that devices nodes/dev/input/event*
are readable by the user. eglfs has all the evdev input handling code built-in, while linuxfb relies on the traditional and somewhat limited-plugin command-line parameters.
Input on linuxfb
To enable keyboard, mouse, touch or tablet support with linuxfb, pass QT_QPA_GENERIC_PLUGINS=evdevkeyboard,evdevmouse,evdevtouch,... in the environment or, alternatively,
-plugin evdevkeyboard,
-plugin evdevmouse,
-plugin evdevtouch, or
-plugin evdevtablet
on the command-line. Most of these can take a device node parameter, for example
QT_QPA_GENERIC_PLUGINS=evdevmouse:/dev/event1,
in case the Qt's automatic device discovery (based either on libudev or a walkthrough of/dev/input/event*) is not functional or misbehaving.
Touch
For some resistive, single-touch touch screens it may be necessary to fall back to using tslib instead of relying on the Linux multitouch protocol and the event devices. For modern touch screens this should not be necessary. tslib support can be enabled
by passing
-plugin tslib instead of evdevtouch.
To change the device, set the environment variable
TSLIB_TSDEVICE or pass the device name on the command-line.
Mouse
The mouse cursor will show up whenever QT_QPA_EGLFS_HIDECURSOR (for eglfs) orQT_QPA_FB_HIDECURSOR (for linuxfb) is not set and Qt's libudev-based device discovery reports that at least one mouse is available. When libudev support
is not present, the mouse cursor will always show up unless explicitly disabled via the environment variable.
Hot plugging is supported, butonly if Qt was configured with libudev support (that is,
if the libudev development headers are present in the sysroot at configure time).
This allows connecting or disconnecting an input device while the application is running.
On eglfs the mouse cursor will disappear and reappear appropriately.
本文介绍了如何在Linuxfb平台上使用Qt5.3.2配置键盘、鼠标和触摸输入。关键参数包括-mtdev和-evdev,用于指定设备节点,如evdevkeyboard=/dev/input/input0和evdevmouse=/dev/input/input1。当没有窗口系统时,直接通过evdev或其他辅助库读取输入设备。此外,还提到了触摸屏可能需要tslib支持,并且支持热插拔输入设备。
1万+

被折叠的 条评论
为什么被折叠?



