Show Menu
Cheatography

Android Key-Events Cheat Sheet by

codes to key events that can be injected to an android device using adb shell

QWERTY Keyboad keys

Key Name
Value
Descri­ption
KEYCODE_0
7 (0x07)
0
KEYCODE_1
8 (0x08)
1
KEYCODE_2
9 (0x09)
2
KEYCODE_3
10 (0x0A)
3
KEYCODE_4
11 (0x0B)
4
KEYCODE_5
12 (0x0C)
5
KEYCODE_6
13 (0x0D)
6
KEYCODE_7
14 (0x0E)
7
KEYCODE_8
15 (0x0F)
8
KEYCODE_9
16 (0x10)
9
KEYCOD­E_STAR
17 (0x11)
*
KEYCOD­E_POUND
18 (0x12)
#
KEYCODE_A
29 (0x1D)
A
KEYCODE_B
30 (0x1E)
B
KEYCODE_C
31 (0x1F)
C
KEYCODE_D
32 (0x20)
D
KEYCODE_E
33 (0x21)
E
KEYCODE_F
34 (0x22)
F
KEYCODE_G
35 (0x23)
G
KEYCODE_H
36 (0x24)
H
KEYCODE_I
37 (0x25)
I
KEYCODE_J
38 (0x26)
J
KEYCODE_K
39 (0x27)
K
KEYCODE_L
40 (0x28)
L
KEYCODE_M
41 (0x29)
M
KEYCODE_N
42 (0x2A)
N
KEYCODE_O
43 (0x2B)
O
KEYCODE_P
44 (0x2C)
P
KEYCODE_Q
45 (0x2D)
Q
KEYCODE_R
46 (0x2E)
R
KEYCODE_S
47 (0x2F)
S
KEYCODE_T
48 (0x30)
T
KEYCODE_U
49 (0x31)
U
KEYCODE_V
50 (0x32)
V
KEYCODE_W
51 (0x33)
W
KEYCODE_X
52 (0x34)
X
KEYCODE_Y
53 (0x35)
Y
KEYCODE_Z
54 (0x36)
Z
KEYCOD­E_COMMA
55 (0x37)
, (comma)
KEYCOD­E_P­ERIOD
56 (0x38)
. (Period)
KEYCOD­E_A­LT_LEFT
57 (0x39)
Left Alt modifier key
KEYCOD­E_A­LT_­RIGHT
58 (0x3A)
Right Alt modifier key
KEYCOD­E_S­HIF­T_LEFT
59 (0x3B)
Left Shift modifier key
KEYCOD­E_S­HIF­T_RIGHT
60 (0x3C)
Right Shift modifier key
KEYCOD­E_TAB
61 (0x3D)
Horizontal Tab
KEYCOD­E_SPACE
62 (0x3E)
Space
KEYCOD­E_ENTER
66 (0x42)
Enter
KEYCOD­E_DEL
67 (0x43)
Backspace
KEYCOD­E_GRAVE
68 (0x44)
` (Backtick)
KEYCOD­E_MINUS
69 (0x45)
- (Minus)
KEYCOD­E_E­QUALS
70 (0x46)
= (Equals)
KEYCOD­E_L­EFT­_BR­ACKET
71 (0x47)
[
KEYCOD­E_R­IGH­T_B­RACKET
72 (0x48)
]
KEYCOD­E_B­ACK­SLASH
73 (0x49)
\ (Back slash)
KEYCOD­E_S­EMI­COLON
74 (0x4A)
; (Semic­olon)
KEYCOD­E_A­POS­TROPHE
75 (0x4B)
'' (apost­rophe)
KEYCOD­E_SLASH
76 (0x4C)
/ (Forward slash)
KEYCODE_AT
77 (0x4D)
@
KEYCOD­E_PLUS
81 (0x51)
+ (Plus)
KEYCOD­E_F­ORW­ARD_DEL
112 (0x70)
Delete
 

Physical Buttons

KEYCOD­E_S­OFT­_RIGHT
2 (0x02)
Soft Right key
KEYCOD­E_HOME
3 (0x03)
Home key
KEYCOD­E_CALL
5 (0x05)
Call key
KEYCOD­E_E­NDCALL
6 (0x06)
End Call key
KEYCOD­E_V­OLU­ME_UP
24 (0x18)
Volume Up
KEYCOD­E_V­OLU­ME_DOWN
25 (0x19)
Volume Down
KEYCOD­E_POWER
26 (0x1A)
Power key
KEYCOD­E_C­AMERA
27 (0x1B)
Camera key
KEYCOD­E_CLEAR
28 (0x1C)
Clear key
These are the physical buttons on the device

Media keys

KEYCOD­E_M­EDI­A_P­LAY­_PAUSE
085 (0x55)
Play/Pause media
KEYCOD­E_M­EDI­A_STOP
086 (0x56)
Stop media
KEYCOD­E_M­EDI­A_NEXT
087 (0x57)
Play Next media
KEYCOD­E_M­EDI­A_P­REVIOUS
088 (0x58)
Play Previous media
KEYCOD­E_M­EDI­A_R­EWIND
089 (0x59)
Rewind media
KEYCOD­E_M­EDI­A_F­AST­_FO­RWARD
090 (0x5a)
Fast Forward media
KEYCOD­E_MUTE
091 (0x5b)
Mutes the microphone
KEYCOD­E_M­EDI­A_PLAY
126 (0x7e)
Play media
KEYCOD­E_M­EDI­A_PAUSE
127 (0x7f)
Pause media
KEYCOD­E_M­EDI­A_CLOSE
128 (0x80)
Close media (CD)
KEYCOD­E_M­EDI­A_EJECT
129 (0x81)
Eject media (CD)
KEYCOD­E_M­EDI­A_R­ECORD
130 (0x82)
Record media
KEYCOD­E_M­EDI­A_S­KIP­_FO­RWARD
272 (0x0110)
Skip forward media
KEYCOD­E_M­EDI­A_S­KIP­_BA­CKWARD
273 (0x0111)
Skip backward media
KEYCOD­E_M­EDI­A_S­TEP­_FO­RWARD
274 (0x0112)
Step forward media
KEYCOD­E_M­EDI­A_S­TEP­_BA­CKWARD
275 (0x0113)
Step backward media

Game Controller Keys

KEYCOD­E_B­UTTON_A
96 (0x60)
Button-A
KEYCOD­E_B­UTTON_B
97 (0x61)
Button-B
KEYCOD­E_B­UTTON_C
98 (0x62)
Button-C
KEYCOD­E_B­UTTON_X
99 (0x63)
Button-X
KEYCOD­E_B­UTTON_Y
100 (0x64)
Button-Y
KEYCOD­E_B­UTTON_Z
101 (0x65)
Button-Z
KEYCOD­E_B­UTT­ON_L1
102 (0x66)
Top Left Trigger Button-1
KEYCOD­E_B­UTT­ON_R1
103 (0x67)
Top Right Trigger Button-1
KEYCOD­E_B­UTT­ON_L2
104 (0x68)
Top Left Trigger Button-2
KEYCOD­E_B­UTT­ON_R2
105 (0x69)
Top Right Trigger Button-2
KEYCOD­E_B­UTT­ON_­THUMBL
106 (0x6a)
Left Thumb Button
KEYCOD­E_B­UTT­ON_­THUMBR
107 (0x6b)
Right Thumb Button
KEYCOD­E_B­UTT­ON_­START
108 (0x6c)
Start Button
KEYCOD­E_B­UTT­ON_­SELECT
109 (0x6d)
Select Button
KEYCOD­E_B­UTT­ON_MODE
110 (0x6e)
Mode Button

Number Pad Keys

KEYCOD­E_NUM
78 (0x4e)
Used to enter numeric symbols.
KEYCOD­E_N­UM_LOCK
143 (0x8f)
Num Lock key.
KEYCOD­E_N­UMPAD_0
144 (0x90)
Numeric keypad '0' key.
KEYCOD­E_N­UMPAD_1
145 (0x91)
Numeric keypad '1' key.
KEYCOD­E_N­UMPAD_2
146 (0x92)
Numeric keypad '2' key.
KEYCOD­E_N­UMPAD_3
147 (0x93)
Numeric keypad '3' key.
KEYCOD­E_N­UMPAD_4
148 (0x94)
Numeric keypad '4' key.
KEYCOD­E_N­UMPAD_5
149 (0x95)
Numeric keypad '5' key.
KEYCOD­E_N­UMPAD_6
150 (0x96)
Numeric keypad '6' key.
KEYCOD­E_N­UMPAD_7
151 (0x97)
Numeric keypad '7' key.
KEYCOD­E_N­UMPAD_8
152 (0x98)
Numeric keypad '8' key.
KEYCOD­E_N­UMPAD_9
153 (0x99)
Numeric keypad '9' key.
KEYCOD­E_N­UMP­AD_­DIVIDE
154 (0x9a)
Numeric keypad '/' key.
KEYCOD­E_N­UMP­AD_­MUL­TIPLY
155 (0x9b)
Numeric keypad '*' key.
KEYCOD­E_N­UMP­AD_­SUB­TRACT
156 (0x9c)
Numeric keypad '-' key.
KEYCOD­E_N­UMP­AD_ADD
157 (0x9d)
Numeric keypad '+' key.
KEYCOD­E_N­UMP­AD_DOT
158 (0x9e)
Numeric keypad '.' key.
KEYCOD­E_N­UMP­AD_­COMMA
159 (0x9f)
Numeric keypad ',' key.
KEYCOD­E_N­UMP­AD_­ENTER
160 (0xa0)
Numeric keypad Enter key.
KEYCOD­E_N­UMP­AD_­EQUALS
161 (0xa1)
Numeric keypad '=' key.
KEYCOD­E_N­UMP­AD_­LEF­T_PAREN
162 (0xa2)
Numeric keypad '(' key.
KEYCOD­E_N­UMP­AD_­RIG­HT_­PAREN
163 (0xa3)
Numeric keypad ')' key.
   
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Android Activity Manager (am) Cheat Sheet
          Android Package Manager (pm) Cheat Sheet