在android中模拟键盘消息(shell命令的方法)
来源:互联网 发布:ds file windows 编辑:程序博客网 时间:2024/06/10 16:03
已找到解决方案[code]
use: sendevent
command format: sendevent
device type code value
[command] [device] [type] [code] [value]
sendevent
/dev/input/event0 1 229 1
/dev/input/event0 is the device to send it to
[type] 1 is unknow for me ( maybe code for physical button on device )
[code] 229 is the MENU button of the emulator
[value] 1 is keydown or press down ( for keyup or up use 0 )
i wrote a batch file for sending the event to the device like below:
adb -s emulator-5554 shell sendevent
/dev/input/event0 1 229 1
adb -s emulator-5554 shell sendevent
/dev/input/event0 1 229 0
have to use the follow command to simulate a pressing of button ( aka
pressing down then let go
Key Name CODE
MENU 229
HOME 102
BACK (back button) 158
CALL (call button) 231
END (end call button) 107
now keyboard shown on the emulator
Key Name CODE
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
0 11
q 16
w 17
e 18
r 19
t 20
y 21
u 22
i 23
o 24
p 25
a 30
s 31
d 32
f 33
g 34
h 35
j 36
k 37
l 38
DEL (delete key) 14
SHIFT (shift key) 42
z 44
x 45
c 46
v 47
b 48
n 49
m 50
. (period) 52
return (enter key) 28
Lt Alt (Left ALT key) 56
SYM 127
@ 215
Spc (Space key) 57
/ 53
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yrj/archive/2009/12/28/5089473.aspx
- 在android中模拟键盘消息(shell命令的方法)
- Android应用程序中模拟发送键盘触摸消息
- 在Android中获取虚拟键盘高度的方法
- 在C语言中调用shell命令的实现方法
- Python调用shell命令的几种方法(在新进程中执行shell命令)
- android 模拟键盘鼠标事件(adb shell)
- android 模拟键盘鼠标事件(adb shell)
- 如何在程序中模拟键盘的按键事件?
- VC++模拟键盘消息
- android中 点击非键盘区域 隐藏键盘的方法
- Android在代码中执行shell命令,针对root命令
- awk中使用shell命令的方法
- 在Regular Dlls中拦截键盘消息
- 在自定义NSTextField中响应键盘消息
- 在web script中模拟MFC的消息
- 在vim中使用shell命令的方法以及foreach循环的使用.
- Android开发,在Fragment中,隐藏或关闭软键盘(虚拟键盘)的方法
- 在shell中获得命令执行后返回值的方法
- jquery取值
- boost源码剖析之:泛型编程精灵type_traits(rev#2)
- 最佳实践:异步弹出消息窗口
- 父类引用指向子类对象
- 友元类
- 在android中模拟键盘消息(shell命令的方法)
- 友元函数
- 在C++中侦测内嵌类型的存在(rev#2)
- 如何修改状态栏的背景
- Symbian系统错误码解释
- 如何学好自己的本领
- java study
- 今天开始java
- 在自己的应用中设置Locale