日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

android 按键消息,在android中模拟键盘消息(shell命令的方法)

發布時間:2023/12/3 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android 按键消息,在android中模拟键盘消息(shell命令的方法) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

已找到解決方案[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 按键消息,在android中模拟键盘消息(shell命令的方法)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。