博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
qt5.3.2 everywhere evdev keyboard&mouse
阅读量:4058 次
发布时间:2019-05-25

本文共 3567 字,大约阅读时间需要 11 分钟。

看到没有?!最关键的参数:-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 when nographicsmodeswitch is 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.

你可能感兴趣的文章
移动端自动化测试-Mac-IOS-Appium环境搭建
查看>>
Selenium之前世今生
查看>>
Selenium-WebDriverApi接口详解
查看>>
Selenium-ActionChains Api接口详解
查看>>
Selenium-Switch与SelectApi接口详解
查看>>
Selenium-Css Selector使用方法
查看>>
Linux常用统计命令之wc
查看>>
测试必会之 Linux 三剑客之 sed
查看>>
Socket请求XML客户端程序
查看>>
Java中数字转大写货币(支持到千亿)
查看>>
Java.nio
查看>>
函数模版类模版和偏特化泛化的总结
查看>>
VMware Workstation Pro虚拟机不可用解决方法
查看>>
redis学习总结-- 内部数据 字符串 链表 字典 跳跃表
查看>>
iOS 对象序列化与反序列化
查看>>
iOS 序列化与反序列化(runtime) 01
查看>>
iOS AFN 3.0版本前后区别 01
查看>>
iOS ASI和AFN有什么区别
查看>>
iOS QQ侧滑菜单(高仿)
查看>>
iOS 扫一扫功能开发
查看>>