Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要模拟一个特定进程运行的键,我无法控制它的源代码并且 Xserver 没有运行,我相信 proc 正在使用 directfb 来处理键盘输入。
您应该能够打开一个虚拟终端(启动“man 7 pty”来阅读文档)。
您还可以在分离的屏幕内运行应用程序并使用“stuff”命令将输入发送到虚拟窗口。在命令行上试试:
启动应用程序:
$ screen -S sessioname -d -m /path/command
发送输入:
$ screen -S sessioname -X stuff 'input line 1 input line 2 ... input line n '