【问题标题】:Xdotool Fails On Raspberry PiXdotool 在 Raspberry Pi 上失败
【发布时间】:2016-06-25 19:05:25
【问题描述】:

我正在我的 Raspberry Pi 上运行 Retropie,我想找到一种使用 GPIO 模拟击键的方法。 Xdotool 似乎是我最好的选择,但它不能在本地或通过 ssh 工作。当我输入 xdotool key 'd' 时出现错误:
Error: Can't open display: (null) Failed creating new xdo instance
到目前为止,每个答案都声称要解决这个问题,我必须对export DISPLAY=":0" xdotool key 'd' 做一些变体,但这没有任何作用,它只是转到下一行。我是 linux 的新手,在此先感谢您。

【问题讨论】:

  • 很抱歉让您对此感到失望,但 tThis Q 不是为 StackOverflow 定义的编程。 可能在相关网站上更合适 raspberrypi.stackexchange.com 或 unix.stackexchange.com (Unix & Linux) 甚至 superuser.com 。考虑使用 Q 底部的flag 链接并要求版主移动它。请不要在 2 个不同的网站上发布相同的 Q。谢谢,祝你好运。

标签: linux raspberry-pi keystroke simulate xdotool


【解决方案1】:

我偶然发现了一个对我有用的答案。只需在命令行中以 Pi 的身份运行“xauth”,即可告诉我 xauthority 正在使用哪个文件(在本例中为 /home/pi/.Xauthority。)

希望对你有帮助

export XAUTHORITY=/home/pi/.Xauthority; export DISPLAY=:0; xdotool key Return

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-12
    • 1970-01-01
    • 2023-01-18
    • 1970-01-01
    • 2016-10-10
    • 1970-01-01
    相关资源
    最近更新 更多