After QT transplantation, the touch screen cannot be input (in combination with its own situation: See the comments)

Source: Internet
Author: User

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.