没有sudo不能在Qt应用程序中使用键盘 [英] Cannot use keyboard within Qt app without sudo

查看:178
本文介绍了没有sudo不能在Qt应用程序中使用键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个交叉编译的嵌入式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 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.

我的/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) :

  1. 在raspberry/beaglebone/其他嵌入式linux上安装xrdp(sudo apt-get install xrdp)
  2. 在PC安装xming中(搜索sourceforge)
  3. 打开XLaunch,选择多个窗口>不启动客户端>剪贴板>完成
  4. 打开腻子>>会话,输入主机名/IP地址, 油灰>> SSH >> X11 >>选中启用X11转发" 油灰>>单击打开"按钮
  5. 登录ssh,然后键入qcreator
  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

现在键盘应该可以了

这篇关于没有sudo不能在Qt应用程序中使用键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆