没有sudo不能在Qt应用程序中使用键盘 [英] Cannot use keyboard within Qt app without sudo
问题描述
我有一个交叉编译的嵌入式Qt应用程序,它可以在BeagleBone Black上运行.它可以正常工作,但有一件事情-如果我不直接在sudo
之前的BeagleBone Black上运行,则它不接受键盘输入.这是一个问题,因为:
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:
- 我无法远程调试应用程序并使用连接的键盘,因为它无法正常工作,
- 当应用程序位于
rc.local
文件中时,即使启动时使用了sudo
,我也无法使用键盘来启动.
- 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 thoughsudo
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.
我的/etc/enviroment
内容在这里:
QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
QWS_KEYBOARD=LinuxInput:/dev/tty
TSLIB_CONFFILE=/etc/ts.conf
TSLIB_PLUGINDIR=/usr/lib/ts
尽管我为QWS_KEYBOARD
尝试了许多不同的配置.我想使用的键盘是/dev/input/event1
.
Although I have tried many different configurations for QWS_KEYBOARD
. The keyboard I would like to use is /dev/input/event1
.
推荐答案
我也遇到了这个问题.但是在我的情况下,我使用从Windows OS到raspberry/beaglebone的远程桌面.
I also facing this issue. But in my situation, I use remote desktop from Windows OS to raspberry / beaglebone.
我的解决方案(至少确保您知道如何在树莓派中配置ssh):
My solution (make sure at least you know how to configure ssh in raspberry) :
- 在raspberry/beaglebone/其他嵌入式linux上安装xrdp(sudo apt-get install xrdp)
- 在PC安装xming中(搜索sourceforge)
- 打开XLaunch,选择多个窗口>不启动客户端>剪贴板>完成
- 打开腻子>>会话,输入主机名/IP地址, 油灰>> SSH >> X11 >>选中启用X11转发" 油灰>>单击打开"按钮
- 登录ssh,然后键入qcreator
- install xrdp (sudo apt-get install xrdp) on raspberry / beaglebone / other embedded linux
- in PC instal xming (search sourceforge)
- open XLaunch, select multiple windows > start no client > clipboard > finish
- open putty >> session, enter host name / IP address, putty >> SSH >> X11 >> check 'Enable X11 forwarding' putty >> click Open button
- login ssh and then type qcreator
现在键盘应该可以了
这篇关于没有sudo不能在Qt应用程序中使用键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!