2

有没有办法将输入事件(例如,键盘输入)注入 Linux GUI 程序?此功能的一个应用是实现系统范围的快捷方式。例如,我正在使用我的浏览器播放音乐,当我在做其他事情(例如,在 vim 中编写代码)时,我想跳到下一个项目。

4

1 回答 1

2

In theory you might use XSendEvent, but the receiving application might notice that it is fake, because the XKeyEvent data type has a send_event field which is set by the X11 server, and the X11 clients (notably the Qt or GTK toolkits) may test it (and probably do test it).

See also freedesktop.

于 2012-11-09T19:33:39.883 回答