[Please indicate the source of the post: blog.csdn.net/lanmanck]
How can embedded QT programs support both touch screens and keyboards? I have some experience here.
1. You can use tslib on the touch screen. In this case, you need to add the tslib command line to the QT configuration and search for it.
2. the embedded keyboard is generally a row-and-column scan, or the keypad interface that comes with the chip. In any case, there are two processing methods, please refer to here:
Http://blog.csdn.net/lanmanck/archive/2011/04/01/6295951.aspx
I am using the standard keyboard driver interface, and the QT version is 4.5.2. -QT-KBD-linuxinput is a bit of attention during configuration. However, the QT configuration of each version may be different. You can view it in configure-embedded-H, this will also affect the setting of the Environment Variable qws_keyboard. There is no linuxinput in 4.5.2, but there is a USB, so the specified method is: qws_keyboard = USB:/dev/event0, instead of linuxinput:/dev/event0, but after qt4.6, it becomes the latter. Please pay special attention to this!
3. When both touch and keyboard are used, there will be two events under Dev. This requires you to know which is tslib and which is keypad, and you can run the test program separately. For example, to run the tslib test program, if the prompt is:
Selected device is not a touchscreen I understand
This can replace the number of eventx with another one, which is also a quick method. You can also write tests on the keyboard, but it is not necessary to have a tslib test program.
4. After the above configuration, QT should be able to recognize the touch and keyboard. To handle Keyboard Events, reload keypressevent (). There are a lot of things on the Internet, not to mention.
Link: http://blog.csdn.net/lanmanck/article/details/6313786