Qt: Could not read from input device: No such device

情到浓时终转凉″ 提交于 2019-12-23 17:31:59

问题


I have a Qt application that's been built to run on Embedded Linux platform (i.Mx.6). My application should support both touch screen as primary input device and an optional USB keyboard if connected. So for now, I have configured my application to be launched as mentioned below:

my-qt-app -plugin tslib:/dev/input/event0 -plugin evdevkeyboard:/dev/input/event1 

My application is able to detect the touchscreen and keyboard properly, BUT, I am noticing a problem if I unplug the keyboard while my application is still running, I see the below error on the console:

 Could not read from input device: No such device

And my Qt application is lagging and is very slow in responding to the touch screen. Looking at the above error message it seems my application is still expecting some sort of data from the keyboard ?

Can somebody help me to recover from this error or give pointers to what's happening please, also if there is a way that I can detect the keyboard presence runtime so that I no need to pass -plugin evdevkeyboard as command line argument to my GUI application.

来源:https://stackoverflow.com/questions/37586149/qt-could-not-read-from-input-device-no-such-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!