模拟按键,事件注入

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了模拟按键,事件注入相关的知识,希望对你有一定的参考价值。

http://www.cnblogs.com/by-dream/p/5195121.html
 
press.sh
 
#!/bin/sh
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 1
sendevent /dev/input/event6 0 0 0
echo "down"
sendevent /dev/input/event6 1 116 0
sendevent /dev/input/event6 0 0 0
echo "up"

以上是关于模拟按键,事件注入的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Qt 应用程序中生成按键事件到系统(win7)(模拟用户在键盘上按键)?

使用 Python for Linux 模拟按键事件

在 Mac OS X 中模拟按键事件

将事件发布到 Qt GUI 线程以模拟按键

Android(Linux)模拟按键触摸屏等事件

adb.按键事件及adb命令模拟