English 中文(简体)
在某些全球关键中,我怎么能够把一些案文传给目前积极应用的黑色和灰 Python或C++。
原标题:How can I, on some global keystroke, paste some text to current active application in linux with Python or C++
  • 时间:2009-09-26 07:18:01
  •  标签:

我想写一下,这本书将像一个 da魔和一些全球关键人物一样,对目前积极应用(文字编辑、浏览器、jabber客户)的一些文字进行编辑,我认为需要使用一些低水平的Xserver一皮。 怎么能用沙尔语或C++做?

最佳回答

您可使用xmacroplayutil from xmacro,在X窗户下完成这项工作。 无论是直接使用,还是通过分处理模块向标准投入发送指令,还是阅读源代码,并找出其如何做! 我不认为对它有法律约束力。

摘自xmacroplay网站

xmacroplay:
Reads lines from the standard input. It can understand the following lines:

Delay [sec]     - delays the program with [sec] secundums
ButtonPress [n] - sends a ButtonPress event with button [n]
          this emulates the pressing of the mouse button [n]
ButtonRelease [n]   - sends a ButtonRelease event with button [n]
          this emulates the releasing of the mouse button [n]
... snip lots more ...

这很可能是你有兴趣的指挥机构。

String [max. 1024 long string]
        - Sends the string as single characters converted to
          KeyPress and KeyRelease events based on a
          character table in chartbl.h (currently only
          Latin1 is used...)

另有Xnee,其中类似内容。

问题回答

Probably you want to hack xmon...


AFAIK没有轻视X议定书的容易途径。 你们需要做“全面包裹检查”,在申请活动中,检查会比较容易,但并不容易,正如你所希望的那样,“如mon”或“全球关键风暴”。

因此,我知道这确实是残酷的武力和无知,但我认为,你必须把X服务器包起来,从一个非标准港口开始,或出版一个环境变量,就像你利用像SSH隧道这样的东西来推进X服务器连接一样。

有一个称为Xmon的X号协议监测器,可供查阅。 这可能是一个良好的起点。





相关问题
热门标签