Cannot use keyboard within Qt app without sudo

本小妞迷上赌 提交于 2019-12-04 02:36:34

问题


I have an embedded Qt application crosscompiled that runs on BeagleBone Black. It works Ok, but one thing- It doesnt accept keyboard input if i wont run in directly on BeagleBone Black preceeding with sudo. This is a problem because:

  • I cannot remote debug application and use connected keyboard, as it doesnt work,
  • I cannot use keyboard when the app is in rc.local file to boot at startup (even though sudo is used there).

This is critical for me at the moment and I cannot find solution to the problem for very long. I would really apreciate all help regarding this.

My /etc/enviroment content is here:

QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
QWS_KEYBOARD=LinuxInput:/dev/tty
TSLIB_CONFFILE=/etc/ts.conf
TSLIB_PLUGINDIR=/usr/lib/ts

Although I have tried many different configurations for QWS_KEYBOARD. The keyboard I would like to use is /dev/input/event1.


回答1:


I also facing this issue. But in my situation, I use remote desktop from Windows OS to raspberry / beaglebone.

My solution (make sure at least you know how to configure ssh in raspberry) :

  1. install xrdp (sudo apt-get install xrdp) on raspberry / beaglebone / other embedded linux
  2. in PC instal xming (search sourceforge)
  3. open XLaunch, select multiple windows > start no client > clipboard > finish
  4. open putty >> session, enter host name / IP address, putty >> SSH >> X11 >> check 'Enable X11 forwarding' putty >> click Open button
  5. login ssh and then type qcreator

now the keyboard should be fine



来源:https://stackoverflow.com/questions/31161989/cannot-use-keyboard-within-qt-app-without-sudo

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