adb shell input keyevent key input control value (recording debugging)

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. Be sure to add reprint reprint https://blog.csdn.net/qq_23327993 https://blog.csdn.net/qq_23327993/article/details/88666387

adb shell function is very powerful, you can use a lot of features in today we say that by controlling the key input: adb shell input keyevent xx, specific values xx as follows 
KEYCODE_CALL into the dial pad 5 
KEYCODE_ENDCALL hang up key 6 
KEYCODE_HOME Key Home 3 
KEYCODE_MENU menu key 82 
KEYCODE_BACK return key. 4 
KEYCODE_SEARCH search key 84 
KEYCODE_CAMERA camera key 27 
KEYCODE_FOCUS camera focus button 80 
KEYCODE_POWER power key 26 is 
KEYCODE_NOTIFICATION notice key 83 
KEYCODE_MUTE microphone mute button 91 is 
KEYCODE_VOLUME_MUTE speaker mute button 164 is 
KEYCODE_VOLUME_UP volume increase button 24 
KEYCODE_VOLUME_DOWN volume down key 25

Control key 
KEYCODE_ENTER Enter key 66 
KEYCODE_ESCAPE the ESC key 111 
KEYCODE_DPAD_CENTER navigation key OK key 23 is 
KEYCODE_DPAD_UP navigation key upwards. 19 
KEYCODE_DPAD_DOWN down navigation key 20 is 
KEYCODE_DPAD_LEFT left navigation key 21 is 
KEYCODE_DPAD_RIGHT right navigation key 22 is 
KEYCODE_MOVE_HOME move the cursor to the start key 122 
KEYCODE_MOVE_END cursor to the end of the key 123 
KEYCODE_PAGE_UP page-up key 92 
KEYCODE_PAGE_DOWN down key 93 
KEYCODE_DEL backspace key 67 
KEYCODE_FORWARD_DEL delete key 112 
KEYCODE_INSERT insert key 124 
KEYCODE_TAB the Tab key 61 is 
KEYCODE_NUM_LOCK keypad lock 143 
KEYCODE_CAPS_LOCK caps lock key 115 
KEYCODE_BREAK Break / the Pause key 121 
KEYCODE_SCROLL_LOCK scroll lock key 1 16 
KEYCODE_ZOOM_IN enlargement key 168 
KEYCODE_ZOOM_OUT reduction key 169

Using the command "adb shell input keyevent <key>" can be automated. For example, "adb shell input keyevent 3" you can press the Home key. ]

Execution returns: adb shell input keyevent 4 
to perform off-screen bright screen: adb shell input keyevent 26 
to perform the unlock screen: adb shell input keyevent 82

Guess you like

Origin blog.csdn.net/qq_23327993/article/details/88666387