问题
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