本文转载自:http://blog.csdn.net/moyu123456789/article/details/71209893

1.adb shell进入android设备,执行命令input keyevent keycode即可,例如:input keyevent 3 3为KEYCODE_HOME
2.直接adb shell input keyevent keycode也可以,adb shell input keyevent 3 3为KEYCODE_HOME

KEYCODE和对应的数值在android源码中定义如下:

  1. <span style="font-size:18px;">/** Key code constant: Unknown key code. */
  2. public static final int KEYCODE_UNKNOWN         = 0;
  3. /** Key code constant: Soft Left key.
  4. * Usually situated below the display on phones and used as a multi-function
  5. * feature key for selecting a software defined function shown on the bottom left
  6. * of the display. */
  7. public static final int KEYCODE_SOFT_LEFT       = 1;
  8. /** Key code constant: Soft Right key.
  9. * Usually situated below the display on phones and used as a multi-function
  10. * feature key for selecting a software defined function shown on the bottom right
  11. * of the display. */
  12. public static final int KEYCODE_SOFT_RIGHT      = 2;
  13. /** Key code constant: Home key.
  14. * This key is handled by the framework and is never delivered to applications. */
  15. public static final int KEYCODE_HOME            = 3;
  16. /** Key code constant: Back key. */
  17. public static final int KEYCODE_BACK            = 4;
  18. /** Key code constant: Call key. */
  19. public static final int KEYCODE_CALL            = 5;
  20. /** Key code constant: End Call key. */
  21. public static final int KEYCODE_ENDCALL         = 6;
  22. /** Key code constant: '0' key. */
  23. public static final int KEYCODE_0               = 7;
  24. /** Key code constant: '1' key. */
  25. public static final int KEYCODE_1               = 8;
  26. /** Key code constant: '2' key. */
  27. public static final int KEYCODE_2               = 9;
  28. /** Key code constant: '3' key. */
  29. public static final int KEYCODE_3               = 10;
  30. /** Key code constant: '4' key. */
  31. public static final int KEYCODE_4               = 11;
  32. /** Key code constant: '5' key. */
  33. public static final int KEYCODE_5               = 12;
  34. /** Key code constant: '6' key. */
  35. public static final int KEYCODE_6               = 13;
  36. /** Key code constant: '7' key. */
  37. public static final int KEYCODE_7               = 14;
  38. /** Key code constant: '8' key. */
  39. public static final int KEYCODE_8               = 15;
  40. /** Key code constant: '9' key. */
  41. public static final int KEYCODE_9               = 16;
  42. /** Key code constant: '*' key. */
  43. public static final int KEYCODE_STAR            = 17;
  44. /** Key code constant: '#' key. */
  45. public static final int KEYCODE_POUND           = 18;
  46. /** Key code constant: Directional Pad Up key.
  47. * May also be synthesized from trackball motions. */
  48. public static final int KEYCODE_DPAD_UP         = 19;
  49. /** Key code constant: Directional Pad Down key.
  50. * May also be synthesized from trackball motions. */
  51. public static final int KEYCODE_DPAD_DOWN       = 20;
  52. /** Key code constant: Directional Pad Left key.
  53. * May also be synthesized from trackball motions. */
  54. public static final int KEYCODE_DPAD_LEFT       = 21;
  55. /** Key code constant: Directional Pad Right key.
  56. * May also be synthesized from trackball motions. */
  57. public static final int KEYCODE_DPAD_RIGHT      = 22;
  58. /** Key code constant: Directional Pad Center key.
  59. * May also be synthesized from trackball motions. */
  60. public static final int KEYCODE_DPAD_CENTER     = 23;
  61. /** Key code constant: Volume Up key.
  62. * Adjusts the speaker volume up. */
  63. public static final int KEYCODE_VOLUME_UP       = 24;
  64. /** Key code constant: Volume Down key.
  65. * Adjusts the speaker volume down. */
  66. public static final int KEYCODE_VOLUME_DOWN     = 25;
  67. /** Key code constant: Power key. */
  68. public static final int KEYCODE_POWER           = 26;
  69. /** Key code constant: Camera key.
  70. * Used to launch a camera application or take pictures. */
  71. public static final int KEYCODE_CAMERA          = 27;
  72. /** Key code constant: Clear key. */
  73. public static final int KEYCODE_CLEAR           = 28;
  74. /** Key code constant: 'A' key. */
  75. public static final int KEYCODE_A               = 29;
  76. /** Key code constant: 'B' key. */
  77. public static final int KEYCODE_B               = 30;
  78. /** Key code constant: 'C' key. */
  79. public static final int KEYCODE_C               = 31;
  80. /** Key code constant: 'D' key. */
  81. public static final int KEYCODE_D               = 32;
  82. /** Key code constant: 'E' key. */
  83. public static final int KEYCODE_E               = 33;
  84. /** Key code constant: 'F' key. */
  85. public static final int KEYCODE_F               = 34;
  86. /** Key code constant: 'G' key. */
  87. public static final int KEYCODE_G               = 35;
  88. /** Key code constant: 'H' key. */
  89. public static final int KEYCODE_H               = 36;
  90. /** Key code constant: 'I' key. */
  91. public static final int KEYCODE_I               = 37;
  92. /** Key code constant: 'J' key. */
  93. public static final int KEYCODE_J               = 38;
  94. /** Key code constant: 'K' key. */
  95. public static final int KEYCODE_K               = 39;
  96. /** Key code constant: 'L' key. */
  97. public static final int KEYCODE_L               = 40;
  98. /** Key code constant: 'M' key. */
  99. public static final int KEYCODE_M               = 41;
  100. /** Key code constant: 'N' key. */
  101. public static final int KEYCODE_N               = 42;
  102. /** Key code constant: 'O' key. */
  103. public static final int KEYCODE_O               = 43;
  104. /** Key code constant: 'P' key. */
  105. public static final int KEYCODE_P               = 44;
  106. /** Key code constant: 'Q' key. */
  107. public static final int KEYCODE_Q               = 45;
  108. /** Key code constant: 'R' key. */
  109. public static final int KEYCODE_R               = 46;
  110. /** Key code constant: 'S' key. */
  111. public static final int KEYCODE_S               = 47;
  112. /** Key code constant: 'T' key. */
  113. public static final int KEYCODE_T               = 48;
  114. /** Key code constant: 'U' key. */
  115. public static final int KEYCODE_U               = 49;
  116. /** Key code constant: 'V' key. */
  117. public static final int KEYCODE_V               = 50;
  118. /** Key code constant: 'W' key. */
  119. public static final int KEYCODE_W               = 51;
  120. /** Key code constant: 'X' key. */
  121. public static final int KEYCODE_X               = 52;
  122. /** Key code constant: 'Y' key. */
  123. public static final int KEYCODE_Y               = 53;
  124. /** Key code constant: 'Z' key. */
  125. public static final int KEYCODE_Z               = 54;
  126. /** Key code constant: ',' key. */
  127. public static final int KEYCODE_COMMA           = 55;
  128. /** Key code constant: '.' key. */
  129. public static final int KEYCODE_PERIOD          = 56;
  130. /** Key code constant: Left Alt modifier key. */
  131. public static final int KEYCODE_ALT_LEFT        = 57;
  132. /** Key code constant: Right Alt modifier key. */
  133. public static final int KEYCODE_ALT_RIGHT       = 58;
  134. /** Key code constant: Left Shift modifier key. */
  135. public static final int KEYCODE_SHIFT_LEFT      = 59;
  136. /** Key code constant: Right Shift modifier key. */
  137. public static final int KEYCODE_SHIFT_RIGHT     = 60;
  138. /** Key code constant: Tab key. */
  139. public static final int KEYCODE_TAB             = 61;
  140. /** Key code constant: Space key. */
  141. public static final int KEYCODE_SPACE           = 62;
  142. /** Key code constant: Symbol modifier key.
  143. * Used to enter alternate symbols. */
  144. public static final int KEYCODE_SYM             = 63;
  145. /** Key code constant: Explorer special function key.
  146. * Used to launch a browser application. */
  147. public static final int KEYCODE_EXPLORER        = 64;
  148. /** Key code constant: Envelope special function key.
  149. * Used to launch a mail application. */
  150. public static final int KEYCODE_ENVELOPE        = 65;
  151. /** Key code constant: Enter key. */
  152. public static final int KEYCODE_ENTER           = 66;
  153. /** Key code constant: Backspace key.
  154. * Deletes characters before the insertion point, unlike {@link #KEYCODE_FORWARD_DEL}. */
  155. public static final int KEYCODE_DEL             = 67;
  156. /** Key code constant: '`' (backtick) key. */
  157. public static final int KEYCODE_GRAVE           = 68;
  158. /** Key code constant: '-'. */
  159. public static final int KEYCODE_MINUS           = 69;
  160. /** Key code constant: '=' key. */
  161. public static final int KEYCODE_EQUALS          = 70;
  162. /** Key code constant: '[' key. */
  163. public static final int KEYCODE_LEFT_BRACKET    = 71;
  164. /** Key code constant: ']' key. */
  165. public static final int KEYCODE_RIGHT_BRACKET   = 72;
  166. /** Key code constant: '\' key. */
  167. public static final int KEYCODE_BACKSLASH       = 73;
  168. /** Key code constant: ';' key. */
  169. public static final int KEYCODE_SEMICOLON       = 74;
  170. /** Key code constant: ''' (apostrophe) key. */
  171. public static final int KEYCODE_APOSTROPHE      = 75;
  172. /** Key code constant: '/' key. */
  173. public static final int KEYCODE_SLASH           = 76;
  174. /** Key code constant: '@' key. */
  175. public static final int KEYCODE_AT              = 77;
  176. /** Key code constant: Number modifier key.
  177. * Used to enter numeric symbols.
  178. * This key is not Num Lock; it is more like {@link #KEYCODE_ALT_LEFT} and is
  179. * interpreted as an ALT key by {@link android.text.method.MetaKeyKeyListener}. */
  180. public static final int KEYCODE_NUM             = 78;
  181. /** Key code constant: Headset Hook key.
  182. * Used to hang up calls and stop media. */
  183. public static final int KEYCODE_HEADSETHOOK     = 79;
  184. /** Key code constant: Camera Focus key.
  185. * Used to focus the camera. */
  186. public static final int KEYCODE_FOCUS           = 80;   // *Camera* focus
  187. /** Key code constant: '+' key. */
  188. public static final int KEYCODE_PLUS            = 81;
  189. /** Key code constant: Menu key. */
  190. public static final int KEYCODE_MENU            = 82;
  191. /** Key code constant: Notification key. */
  192. public static final int KEYCODE_NOTIFICATION    = 83;
  193. /** Key code constant: Search key. */
  194. public static final int KEYCODE_SEARCH          = 84;
  195. /** Key code constant: Play/Pause media key. */
  196. public static final int KEYCODE_MEDIA_PLAY_PAUSE= 85;
  197. /** Key code constant: Stop media key. */
  198. public static final int KEYCODE_MEDIA_STOP      = 86;
  199. /** Key code constant: Play Next media key. */
  200. public static final int KEYCODE_MEDIA_NEXT      = 87;
  201. /** Key code constant: Play Previous media key. */
  202. public static final int KEYCODE_MEDIA_PREVIOUS  = 88;
  203. /** Key code constant: Rewind media key. */
  204. public static final int KEYCODE_MEDIA_REWIND    = 89;
  205. /** Key code constant: Fast Forward media key. */
  206. public static final int KEYCODE_MEDIA_FAST_FORWARD = 90;
  207. /** Key code constant: Mute key.
  208. * Mutes the microphone, unlike {@link #KEYCODE_VOLUME_MUTE}. */
  209. public static final int KEYCODE_MUTE            = 91;
  210. /** Key code constant: Page Up key. */
  211. public static final int KEYCODE_PAGE_UP         = 92;
  212. /** Key code constant: Page Down key. */
  213. public static final int KEYCODE_PAGE_DOWN       = 93;
  214. /** Key code constant: Picture Symbols modifier key.
  215. * Used to switch symbol sets (Emoji, Kao-moji). */
  216. public static final int KEYCODE_PICTSYMBOLS     = 94;   // switch symbol-sets (Emoji,Kao-moji)
  217. /** Key code constant: Switch Charset modifier key.
  218. * Used to switch character sets (Kanji, Katakana). */
  219. public static final int KEYCODE_SWITCH_CHARSET  = 95;   // switch char-sets (Kanji,Katakana)
  220. /** Key code constant: A Button key.
  221. * On a game controller, the A button should be either the button labeled A
  222. * or the first button on the bottom row of controller buttons. */
  223. public static final int KEYCODE_BUTTON_A        = 96;
  224. /** Key code constant: B Button key.
  225. * On a game controller, the B button should be either the button labeled B
  226. * or the second button on the bottom row of controller buttons. */
  227. public static final int KEYCODE_BUTTON_B        = 97;
  228. /** Key code constant: C Button key.
  229. * On a game controller, the C button should be either the button labeled C
  230. * or the third button on the bottom row of controller buttons. */
  231. public static final int KEYCODE_BUTTON_C        = 98;
  232. /** Key code constant: X Button key.
  233. * On a game controller, the X button should be either the button labeled X
  234. * or the first button on the upper row of controller buttons. */
  235. public static final int KEYCODE_BUTTON_X        = 99;
  236. /** Key code constant: Y Button key.
  237. * On a game controller, the Y button should be either the button labeled Y
  238. * or the second button on the upper row of controller buttons. */
  239. public static final int KEYCODE_BUTTON_Y        = 100;
  240. /** Key code constant: Z Button key.
  241. * On a game controller, the Z button should be either the button labeled Z
  242. * or the third button on the upper row of controller buttons. */
  243. public static final int KEYCODE_BUTTON_Z        = 101;
  244. /** Key code constant: L1 Button key.
  245. * On a game controller, the L1 button should be either the button labeled L1 (or L)
  246. * or the top left trigger button. */
  247. public static final int KEYCODE_BUTTON_L1       = 102;
  248. /** Key code constant: R1 Button key.
  249. * On a game controller, the R1 button should be either the button labeled R1 (or R)
  250. * or the top right trigger button. */
  251. public static final int KEYCODE_BUTTON_R1       = 103;
  252. /** Key code constant: L2 Button key.
  253. * On a game controller, the L2 button should be either the button labeled L2
  254. * or the bottom left trigger button. */
  255. public static final int KEYCODE_BUTTON_L2       = 104;
  256. /** Key code constant: R2 Button key.
  257. * On a game controller, the R2 button should be either the button labeled R2
  258. * or the bottom right trigger button. */
  259. public static final int KEYCODE_BUTTON_R2       = 105;
  260. /** Key code constant: Left Thumb Button key.
  261. * On a game controller, the left thumb button indicates that the left (or only)
  262. * joystick is pressed. */
  263. public static final int KEYCODE_BUTTON_THUMBL   = 106;
  264. /** Key code constant: Right Thumb Button key.
  265. * On a game controller, the right thumb button indicates that the right
  266. * joystick is pressed. */
  267. public static final int KEYCODE_BUTTON_THUMBR   = 107;
  268. /** Key code constant: Start Button key.
  269. * On a game controller, the button labeled Start. */
  270. public static final int KEYCODE_BUTTON_START    = 108;
  271. /** Key code constant: Select Button key.
  272. * On a game controller, the button labeled Select. */
  273. public static final int KEYCODE_BUTTON_SELECT   = 109;
  274. /** Key code constant: Mode Button key.
  275. * On a game controller, the button labeled Mode. */
  276. public static final int KEYCODE_BUTTON_MODE     = 110;
  277. /** Key code constant: Escape key. */
  278. public static final int KEYCODE_ESCAPE          = 111;
  279. /** Key code constant: Forward Delete key.
  280. * Deletes characters ahead of the insertion point, unlike {@link #KEYCODE_DEL}. */
  281. public static final int KEYCODE_FORWARD_DEL     = 112;
  282. /** Key code constant: Left Control modifier key. */
  283. public static final int KEYCODE_CTRL_LEFT       = 113;
  284. /** Key code constant: Right Control modifier key. */
  285. public static final int KEYCODE_CTRL_RIGHT      = 114;
  286. /** Key code constant: Caps Lock key. */
  287. public static final int KEYCODE_CAPS_LOCK       = 115;
  288. /** Key code constant: Scroll Lock key. */
  289. public static final int KEYCODE_SCROLL_LOCK     = 116;
  290. /** Key code constant: Left Meta modifier key. */
  291. public static final int KEYCODE_META_LEFT       = 117;
  292. /** Key code constant: Right Meta modifier key. */
  293. public static final int KEYCODE_META_RIGHT      = 118;
  294. /** Key code constant: Function modifier key. */
  295. public static final int KEYCODE_FUNCTION        = 119;
  296. /** Key code constant: System Request / Print Screen key. */
  297. public static final int KEYCODE_SYSRQ           = 120;
  298. /** Key code constant: Break / Pause key. */
  299. public static final int KEYCODE_BREAK           = 121;
  300. /** Key code constant: Home Movement key.
  301. * Used for scrolling or moving the cursor around to the start of a line
  302. * or to the top of a list. */
  303. public static final int KEYCODE_MOVE_HOME       = 122;
  304. /** Key code constant: End Movement key.
  305. * Used for scrolling or moving the cursor around to the end of a line
  306. * or to the bottom of a list. */
  307. public static final int KEYCODE_MOVE_END        = 123;
  308. /** Key code constant: Insert key.
  309. * Toggles insert / overwrite edit mode. */
  310. public static final int KEYCODE_INSERT          = 124;
  311. /** Key code constant: Forward key.
  312. * Navigates forward in the history stack.  Complement of {@link #KEYCODE_BACK}. */
  313. public static final int KEYCODE_FORWARD         = 125;
  314. /** Key code constant: Play media key. */
  315. public static final int KEYCODE_MEDIA_PLAY      = 126;
  316. /** Key code constant: Pause media key. */
  317. public static final int KEYCODE_MEDIA_PAUSE     = 127;
  318. /** Key code constant: Close media key.
  319. * May be used to close a CD tray, for example. */
  320. public static final int KEYCODE_MEDIA_CLOSE     = 128;
  321. /** Key code constant: Eject media key.
  322. * May be used to eject a CD tray, for example. */
  323. public static final int KEYCODE_MEDIA_EJECT     = 129;
  324. /** Key code constant: Record media key. */
  325. public static final int KEYCODE_MEDIA_RECORD    = 130;
  326. /** Key code constant: F1 key. */
  327. public static final int KEYCODE_F1              = 131;
  328. /** Key code constant: F2 key. */
  329. public static final int KEYCODE_F2              = 132;
  330. /** Key code constant: F3 key. */
  331. public static final int KEYCODE_F3              = 133;
  332. /** Key code constant: F4 key. */
  333. public static final int KEYCODE_F4              = 134;
  334. /** Key code constant: F5 key. */
  335. public static final int KEYCODE_F5              = 135;
  336. /** Key code constant: F6 key. */
  337. public static final int KEYCODE_F6              = 136;
  338. /** Key code constant: F7 key. */
  339. public static final int KEYCODE_F7              = 137;
  340. /** Key code constant: F8 key. */
  341. public static final int KEYCODE_F8              = 138;
  342. /** Key code constant: F9 key. */
  343. public static final int KEYCODE_F9              = 139;
  344. /** Key code constant: F10 key. */
  345. public static final int KEYCODE_F10             = 140;
  346. /** Key code constant: F11 key. */
  347. public static final int KEYCODE_F11             = 141;
  348. /** Key code constant: F12 key. */
  349. public static final int KEYCODE_F12             = 142;
  350. /** Key code constant: Num Lock key.
  351. * This is the Num Lock key; it is different from {@link #KEYCODE_NUM}.
  352. * This key alters the behavior of other keys on the numeric keypad. */
  353. public static final int KEYCODE_NUM_LOCK        = 143;
  354. /** Key code constant: Numeric keypad '0' key. */
  355. public static final int KEYCODE_NUMPAD_0        = 144;
  356. /** Key code constant: Numeric keypad '1' key. */
  357. public static final int KEYCODE_NUMPAD_1        = 145;
  358. /** Key code constant: Numeric keypad '2' key. */
  359. public static final int KEYCODE_NUMPAD_2        = 146;
  360. /** Key code constant: Numeric keypad '3' key. */
  361. public static final int KEYCODE_NUMPAD_3        = 147;
  362. /** Key code constant: Numeric keypad '4' key. */
  363. public static final int KEYCODE_NUMPAD_4        = 148;
  364. /** Key code constant: Numeric keypad '5' key. */
  365. public static final int KEYCODE_NUMPAD_5        = 149;
  366. /** Key code constant: Numeric keypad '6' key. */
  367. public static final int KEYCODE_NUMPAD_6        = 150;
  368. /** Key code constant: Numeric keypad '7' key. */
  369. public static final int KEYCODE_NUMPAD_7        = 151;
  370. /** Key code constant: Numeric keypad '8' key. */
  371. public static final int KEYCODE_NUMPAD_8        = 152;
  372. /** Key code constant: Numeric keypad '9' key. */
  373. public static final int KEYCODE_NUMPAD_9        = 153;
  374. /** Key code constant: Numeric keypad '/' key (for division). */
  375. public static final int KEYCODE_NUMPAD_DIVIDE   = 154;
  376. /** Key code constant: Numeric keypad '*' key (for multiplication). */
  377. public static final int KEYCODE_NUMPAD_MULTIPLY = 155;
  378. /** Key code constant: Numeric keypad '-' key (for subtraction). */
  379. public static final int KEYCODE_NUMPAD_SUBTRACT = 156;
  380. /** Key code constant: Numeric keypad '+' key (for addition). */
  381. public static final int KEYCODE_NUMPAD_ADD      = 157;
  382. /** Key code constant: Numeric keypad '.' key (for decimals or digit grouping). */
  383. public static final int KEYCODE_NUMPAD_DOT      = 158;
  384. /** Key code constant: Numeric keypad ',' key (for decimals or digit grouping). */
  385. public static final int KEYCODE_NUMPAD_COMMA    = 159;
  386. /** Key code constant: Numeric keypad Enter key. */
  387. public static final int KEYCODE_NUMPAD_ENTER    = 160;
  388. /** Key code constant: Numeric keypad '=' key. */
  389. public static final int KEYCODE_NUMPAD_EQUALS   = 161;
  390. /** Key code constant: Numeric keypad '(' key. */
  391. public static final int KEYCODE_NUMPAD_LEFT_PAREN = 162;
  392. /** Key code constant: Numeric keypad ')' key. */
  393. public static final int KEYCODE_NUMPAD_RIGHT_PAREN = 163;
  394. /** Key code constant: Volume Mute key.
  395. * Mutes the speaker, unlike {@link #KEYCODE_MUTE}.
  396. * This key should normally be implemented as a toggle such that the first press
  397. * mutes the speaker and the second press restores the original volume. */
  398. public static final int KEYCODE_VOLUME_MUTE     = 164;
  399. /** Key code constant: Info key.
  400. * Common on TV remotes to show additional information related to what is
  401. * currently being viewed. */
  402. public static final int KEYCODE_INFO            = 165;
  403. /** Key code constant: Channel up key.
  404. * On TV remotes, increments the television channel. */
  405. public static final int KEYCODE_CHANNEL_UP      = 166;
  406. /** Key code constant: Channel down key.
  407. * On TV remotes, decrements the television channel. */
  408. public static final int KEYCODE_CHANNEL_DOWN    = 167;
  409. /** Key code constant: Zoom in key. */
  410. public static final int KEYCODE_ZOOM_IN         = 168;
  411. /** Key code constant: Zoom out key. */
  412. public static final int KEYCODE_ZOOM_OUT        = 169;
  413. /** Key code constant: TV key.
  414. * On TV remotes, switches to viewing live TV. */
  415. public static final int KEYCODE_TV              = 170;
  416. /** Key code constant: Window key.
  417. * On TV remotes, toggles picture-in-picture mode or other windowing functions. */
  418. public static final int KEYCODE_WINDOW          = 171;
  419. /** Key code constant: Guide key.
  420. * On TV remotes, shows a programming guide. */
  421. public static final int KEYCODE_GUIDE           = 172;
  422. /** Key code constant: DVR key.
  423. * On some TV remotes, switches to a DVR mode for recorded shows. */
  424. public static final int KEYCODE_DVR             = 173;
  425. /** Key code constant: Bookmark key.
  426. * On some TV remotes, bookmarks content or web pages. */
  427. public static final int KEYCODE_BOOKMARK        = 174;
  428. /** Key code constant: Toggle captions key.
  429. * Switches the mode for closed-captioning text, for example during television shows. */
  430. public static final int KEYCODE_CAPTIONS        = 175;
  431. /** Key code constant: Settings key.
  432. * Starts the system settings activity. */
  433. public static final int KEYCODE_SETTINGS        = 176;
  434. /** Key code constant: TV power key.
  435. * On TV remotes, toggles the power on a television screen. */
  436. public static final int KEYCODE_TV_POWER        = 177;
  437. /** Key code constant: TV input key.
  438. * On TV remotes, switches the input on a television screen. */
  439. public static final int KEYCODE_TV_INPUT        = 178;
  440. /** Key code constant: Set-top-box power key.
  441. * On TV remotes, toggles the power on an external Set-top-box. */
  442. public static final int KEYCODE_STB_POWER       = 179;
  443. /** Key code constant: Set-top-box input key.
  444. * On TV remotes, switches the input mode on an external Set-top-box. */
  445. public static final int KEYCODE_STB_INPUT       = 180;
  446. /** Key code constant: A/V Receiver power key.
  447. * On TV remotes, toggles the power on an external A/V Receiver. */
  448. public static final int KEYCODE_AVR_POWER       = 181;
  449. /** Key code constant: A/V Receiver input key.
  450. * On TV remotes, switches the input mode on an external A/V Receiver. */
  451. public static final int KEYCODE_AVR_INPUT       = 182;
  452. /** Key code constant: Red "programmable" key.
  453. * On TV remotes, acts as a contextual/programmable key. */
  454. public static final int KEYCODE_PROG_RED        = 183;
  455. /** Key code constant: Green "programmable" key.
  456. * On TV remotes, actsas a contextual/programmable key. */
  457. public static final int KEYCODE_PROG_GREEN      = 184;
  458. /** Key code constant: Yellow "programmable" key.
  459. * On TV remotes, acts as a contextual/programmable key. */
  460. public static final int KEYCODE_PROG_YELLOW     = 185;
  461. /** Key code constant: Blue "programmable" key.
  462. * On TV remotes, acts as a contextual/programmable key. */
  463. public static final int KEYCODE_PROG_BLUE       = 186;
  464. /** Key code constant: App switch key.
  465. * Should bring up the application switcher dialog. */
  466. public static final int KEYCODE_APP_SWITCH      = 187;
  467. /** Key code constant: Generic Game Pad Button #1.*/
  468. public static final int KEYCODE_BUTTON_1        = 188;
  469. /** Key code constant: Generic Game Pad Button #2.*/
  470. public static final int KEYCODE_BUTTON_2        = 189;
  471. /** Key code constant: Generic Game Pad Button #3.*/
  472. public static final int KEYCODE_BUTTON_3        = 190;
  473. /** Key code constant: Generic Game Pad Button #4.*/
  474. public static final int KEYCODE_BUTTON_4        = 191;
  475. /** Key code constant: Generic Game Pad Button #5.*/
  476. public static final int KEYCODE_BUTTON_5        = 192;
  477. /** Key code constant: Generic Game Pad Button #6.*/
  478. public static final int KEYCODE_BUTTON_6        = 193;
  479. /** Key code constant: Generic Game Pad Button #7.*/
  480. public static final int KEYCODE_BUTTON_7        = 194;
  481. /** Key code constant: Generic Game Pad Button #8.*/
  482. public static final int KEYCODE_BUTTON_8        = 195;
  483. /** Key code constant: Generic Game Pad Button #9.*/
  484. public static final int KEYCODE_BUTTON_9        = 196;
  485. /** Key code constant: Generic Game Pad Button #10.*/
  486. public static final int KEYCODE_BUTTON_10       = 197;
  487. /** Key code constant: Generic Game Pad Button #11.*/
  488. public static final int KEYCODE_BUTTON_11       = 198;
  489. /** Key code constant: Generic Game Pad Button #12.*/
  490. public static final int KEYCODE_BUTTON_12       = 199;
  491. /** Key code constant: Generic Game Pad Button #13.*/
  492. public static final int KEYCODE_BUTTON_13       = 200;
  493. /** Key code constant: Generic Game Pad Button #14.*/
  494. public static final int KEYCODE_BUTTON_14       = 201;
  495. /** Key code constant: Generic Game Pad Button #15.*/
  496. public static final int KEYCODE_BUTTON_15       = 202;
  497. /** Key code constant: Generic Game Pad Button #16.*/
  498. public static final int KEYCODE_BUTTON_16       = 203;
  499. /** Key code constant: Language Switch key.
  500. * Toggles the current input language such as switching between English and Japanese on
  501. * a QWERTY keyboard.  On some devices, the same function may be performed by
  502. * pressing Shift+Spacebar. */
  503. public static final int KEYCODE_LANGUAGE_SWITCH = 204;
  504. /** Key code constant: Manner Mode key.
  505. * Toggles silent or vibrate mode on and off to make the device behave more politely
  506. * in certain settings such as on a crowded train.  On some devices, the key may only
  507. * operate when long-pressed. */
  508. public static final int KEYCODE_MANNER_MODE     = 205;
  509. /** Key code constant: 3D Mode key.
  510. * Toggles the display between 2D and 3D mode. */
  511. public static final int KEYCODE_3D_MODE         = 206;
  512. /** Key code constant: Contacts special function key.
  513. * Used to launch an address book application. */
  514. public static final int KEYCODE_CONTACTS        = 207;
  515. /** Key code constant: Calendar special function key.
  516. * Used to launch a calendar application. */
  517. public static final int KEYCODE_CALENDAR        = 208;
  518. /** Key code constant: Music special function key.
  519. * Used to launch a music player application. */
  520. public static final int KEYCODE_MUSIC           = 209;
  521. /** Key code constant: Calculator special function key.
  522. * Used to launch a calculator application. */
  523. public static final int KEYCODE_CALCULATOR      = 210;
  524. /** Key code constant: Japanese full-width / half-width key. */
  525. public static final int KEYCODE_ZENKAKU_HANKAKU = 211;
  526. /** Key code constant: Japanese alphanumeric key. */
  527. public static final int KEYCODE_EISU            = 212;
  528. /** Key code constant: Japanese non-conversion key. */
  529. public static final int KEYCODE_MUHENKAN        = 213;
  530. /** Key code constant: Japanese conversion key. */
  531. public static final int KEYCODE_HENKAN          = 214;
  532. /** Key code constant: Japanese katakana / hiragana key. */
  533. public static final int KEYCODE_KATAKANA_HIRAGANA = 215;
  534. /** Key code constant: Japanese Yen key. */
  535. public static final int KEYCODE_YEN             = 216;
  536. /** Key code constant: Japanese Ro key. */
  537. public static final int KEYCODE_RO              = 217;
  538. /** Key code constant: Japanese kana key. */
  539. public static final int KEYCODE_KANA            = 218;
  540. /** Key code constant: Assist key.
  541. * Launches the global assist activity.  Not delivered to applications. */
  542. public static final int KEYCODE_ASSIST          = 219;
  543. /** Key code constant: Brightness Down key.
  544. * Adjusts the screen brightness down. */
  545. public static final int KEYCODE_BRIGHTNESS_DOWN = 220;
  546. /** Key code constant: Brightness Up key.
  547. * Adjusts the screen brightness up. */
  548. public static final int KEYCODE_BRIGHTNESS_UP   = 221;
  549. /** Key code constant: Audio Track key.
  550. * Switches the audio tracks. */
  551. public static final int KEYCODE_MEDIA_AUDIO_TRACK = 222;
  552. /** Key code constant: Sleep key.
  553. * Puts the device to sleep.  Behaves somewhat like {@link #KEYCODE_POWER} but it
  554. * has no effect if the device is already asleep. */
  555. public static final int KEYCODE_SLEEP           = 223;
  556. /** Key code constant: Wakeup key.
  557. * Wakes up the device.  Behaves somewhat like {@link #KEYCODE_POWER} but it
  558. * has no effect if the device is already awake. */
  559. public static final int KEYCODE_WAKEUP          = 224;
  560. /** Key code constant: Pairing key.
  561. * Initiates peripheral pairing mode. Useful for pairing remote control
  562. * devices or game controllers, especially if no other input mode is
  563. * available. */
  564. public static final int KEYCODE_PAIRING         = 225;
  565. /** Key code constant: Media Top Menu key.
  566. * Goes to the top of media menu. */
  567. public static final int KEYCODE_MEDIA_TOP_MENU  = 226;
  568. /** Key code constant: '11' key. */
  569. public static final int KEYCODE_11              = 227;
  570. /** Key code constant: '12' key. */
  571. public static final int KEYCODE_12              = 228;
  572. /** Key code constant: Last Channel key.
  573. * Goes to the last viewed channel. */
  574. public static final int KEYCODE_LAST_CHANNEL    = 229;
  575. /** Key code constant: TV data service key.
  576. * Displays data services like weather, sports. */
  577. public static final int KEYCODE_TV_DATA_SERVICE = 230;
  578. /** Key code constant: Voice Assist key.
  579. * Launches the global voice assist activity. Not delivered to applications. */
  580. public static final int KEYCODE_VOICE_ASSIST = 231;
  581. /** Key code constant: Radio key.
  582. * Toggles TV service / Radio service. */
  583. public static final int KEYCODE_TV_RADIO_SERVICE = 232;
  584. /** Key code constant: Teletext key.
  585. * Displays Teletext service. */
  586. public static final int KEYCODE_TV_TELETEXT = 233;
  587. /** Key code constant: Number entry key.
  588. * Initiates to enter multi-digit channel nubmber when each digit key is assigned
  589. * for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC
  590. * User Control Code. */
  591. public static final int KEYCODE_TV_NUMBER_ENTRY = 234;
  592. /** Key code constant: Analog Terrestrial key.
  593. * Switches to analog terrestrial broadcast service. */
  594. public static final int KEYCODE_TV_TERRESTRIAL_ANALOG = 235;
  595. /** Key code constant: Digital Terrestrial key.
  596. * Switches to digital terrestrial broadcast service. */
  597. public static final int KEYCODE_TV_TERRESTRIAL_DIGITAL = 236;
  598. /** Key code constant: Satellite key.
  599. * Switches to digital satellite broadcast service. */
  600. public static final int KEYCODE_TV_SATELLITE = 237;
  601. /** Key code constant: BS key.
  602. * Switches to BS digital satellite broadcasting service available in Japan. */
  603. public static final int KEYCODE_TV_SATELLITE_BS = 238;
  604. /** Key code constant: CS key.
  605. * Switches to CS digital satellite broadcasting service available in Japan. */
  606. public static final int KEYCODE_TV_SATELLITE_CS = 239;
  607. /** Key code constant: BS/CS key.
  608. * Toggles between BS and CS digital satellite services. */
  609. public static final int KEYCODE_TV_SATELLITE_SERVICE = 240;
  610. /** Key code constant: Toggle Network key.
  611. * Toggles selecting broacast services. */
  612. public static final int KEYCODE_TV_NETWORK = 241;
  613. /** Key code constant: Antenna/Cable key.
  614. * Toggles broadcast input source between antenna and cable. */
  615. public static final int KEYCODE_TV_ANTENNA_CABLE = 242;
  616. /** Key code constant: HDMI #1 key.
  617. * Switches to HDMI input #1. */
  618. public static final int KEYCODE_TV_INPUT_HDMI_1 = 243;
  619. /** Key code constant: HDMI #2 key.
  620. * Switches to HDMI input #2. */
  621. public static final int KEYCODE_TV_INPUT_HDMI_2 = 244;
  622. /** Key code constant: HDMI #3 key.
  623. * Switches to HDMI input #3. */
  624. public static final int KEYCODE_TV_INPUT_HDMI_3 = 245;
  625. /** Key code constant: HDMI #4 key.
  626. * Switches to HDMI input #4. */
  627. public static final int KEYCODE_TV_INPUT_HDMI_4 = 246;
  628. /** Key code constant: Composite #1 key.
  629. * Switches to composite video input #1. */
  630. public static final int KEYCODE_TV_INPUT_COMPOSITE_1 = 247;
  631. /** Key code constant: Composite #2 key.
  632. * Switches to composite video input #2. */
  633. public static final int KEYCODE_TV_INPUT_COMPOSITE_2 = 248;
  634. /** Key code constant: Component #1 key.
  635. * Switches to component video input #1. */
  636. public static final int KEYCODE_TV_INPUT_COMPONENT_1 = 249;
  637. /** Key code constant: Component #2 key.
  638. * Switches to component video input #2. */
  639. public static final int KEYCODE_TV_INPUT_COMPONENT_2 = 250;
  640. /** Key code constant: VGA #1 key.
  641. * Switches to VGA (analog RGB) input #1. */
  642. public static final int KEYCODE_TV_INPUT_VGA_1 = 251;
  643. /** Key code constant: Audio description key.
  644. * Toggles audio description off / on. */
  645. public static final int KEYCODE_TV_AUDIO_DESCRIPTION = 252;
  646. /** Key code constant: Audio description mixing volume up key.
  647. * Louden audio description volume as compared with normal audio volume. */
  648. public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253;
  649. /** Key code constant: Audio description mixing volume down key.
  650. * Lessen audio description volume as compared with normal audio volume. */
  651. public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254;
  652. /** Key code constant: Zoom mode key.
  653. * Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.) */
  654. public static final int KEYCODE_TV_ZOOM_MODE = 255;
  655. /** Key code constant: Contents menu key.
  656. * Goes to the title list. Corresponds to Contents Menu (0x0B) of CEC User Control
  657. * Code */
  658. public static final int KEYCODE_TV_CONTENTS_MENU = 256;
  659. /** Key code constant: Media context menu key.
  660. * Goes to the context menu of media contents. Corresponds to Media Context-sensitive
  661. * Menu (0x11) of CEC User Control Code. */
  662. public static final int KEYCODE_TV_MEDIA_CONTEXT_MENU = 257;
  663. /** Key code constant: Timer programming key.
  664. * Goes to the timer recording menu. Corresponds to Timer Programming (0x54) of
  665. * CEC User Control Code. */
  666. public static final int KEYCODE_TV_TIMER_PROGRAMMING = 258;
  667. /** Key code constant: Help key. */
  668. public static final int KEYCODE_HELP = 259;
  669. /** Key code constant: Navigate to previous key.
  670. * Goes backward by one item in an ordered collection of items. */
  671. public static final int KEYCODE_NAVIGATE_PREVIOUS = 260;
  672. /** Key code constant: Navigate to next key.
  673. * Advances to the next item in an ordered collection of items. */
  674. public static final int KEYCODE_NAVIGATE_NEXT   = 261;
  675. /** Key code constant: Navigate in key.
  676. * Activates the item that currently has focus or expands to the next level of a navigation
  677. * hierarchy. */
  678. public static final int KEYCODE_NAVIGATE_IN     = 262;
  679. /** Key code constant: Navigate out key.
  680. * Backs out one level of a navigation hierarchy or collapses the item that currently has
  681. * focus. */
  682. public static final int KEYCODE_NAVIGATE_OUT    = 263;
  683. /** Key code constant: Skip forward media key. */
  684. public static final int KEYCODE_MEDIA_SKIP_FORWARD = 272;
  685. /** Key code constant: Skip backward media key. */
  686. public static final int KEYCODE_MEDIA_SKIP_BACKWARD = 273;
  687. /** Key code constant: Step forward media key.
  688. * Steps media forward, one frame at a time. */
  689. public static final int KEYCODE_MEDIA_STEP_FORWARD = 274;
  690. /** Key code constant: Step backward media key.
  691. * Steps media backward, one frame at a time. */
  692. public static final int KEYCODE_MEDIA_STEP_BACKWARD = 275;</span>

input keyevent发送按键值【转】的更多相关文章

  1. adb shell按键操作(input keyevent)

    前言:input keyeven操作发送手机上常用的一些按键操作 一.keyevent事件对应数字 电话键 KEYCODE_CALL: 拨号键 KEYCODE_ENDCALL: 挂机键 KEYCODE ...

  2. appium+python自动化38-adb shell按键操作(input keyevent)

    前言 接着上篇介绍input里面的按键操作keyevent事件,发送手机上常用的一些按键操作 keyevent 1.keyevent事件有一张对应的表,可以直接发送对应的数字,也可以方式字符串,如下两 ...

  3. appium+python自动化-adb shell按键操作(input keyevent)

    前言 接着上篇介绍input里面的按键操作keyevent事件,发送手机上常用的一些按键操作 keyevent 1.keyevent事件有一张对应的表,可以直接发送对应的数字,也可以方式字符串,如下两 ...

  4. adb shell input keyevent code详解

    adb shell input keyevent 7 # for key '0' adb shell input keyevent 8 # for key '1' adb shell input ke ...

  5. android后台input命令模拟按键【转】

    本文转载自:http://www.cnblogs.com/sh1o2os/archive/2013/02/05/2893201.html 有时做开发时,我们使用的触摸屏没有虚拟按键(HOME.BACK ...

  6. PyQt学习随笔:PyQt中捕获键盘事件后获取具体按键值的方法

    在PyQt中,如果要捕获键盘事件的具体按键,可以通过重写组件对象的keyPressEvent方法或event方法来捕获具体的按键,推荐使用keyPressEvent方法,因为event方法是一个通用事 ...

  7. JS 捕获 input 中 键盘按键

    JS 捕获 input 中 键盘按键 的相应处理事件是很简单的,google搜索一下很容易找到处理方式,请看如下一种简单的处理方式: HTML代码: <div> <input typ ...

  8. Delphi 中的全局快捷键+给指定窗体发送按键

    [背景] 公司做视频影像采集,平时采集图像的时候都需要打开采集窗口,然后需要开着采集窗口来进行图像采集.同事问我能不能做一个全局快捷键,哪怕我没有操作也可以采集图像.说干就干,一直想做全局快捷键了,网 ...

  9. selenium 获取input输入框中的值的方法

    方法一:获取input的文本值 <input class="form-text-normal" id="txtName" name="Name& ...

随机推荐

  1. MySql索引笔记

    MySQL 索引是什么 MySQL索引的建立对于MySQL的高效运行是很重要的,索引可以大大提高MySQL的检索速度. 打个比方,如果合理的设计且使用索引的MySQL是一辆兰博基尼的话,那么没有设计和 ...

  2. Python使用Flask框架,结合Highchart,自定义图表样式主题

    参考链接:https://www.highcharts.com.cn/docs/themes 1.使用官方提供的主题js文件,只需要在 highcharts.js 后引入对应的文件即可,不用修改原有的 ...

  3. mysql崩溃恢复

    mysql进程崩溃. 杀掉所有mysql进程,在my.cnf文件中写入innodb_recover_force=1,强制并忽略任何错误启动数据库. 用mysqldump导出所有数据,在新机器上部署好m ...

  4. python3.x Day4 内置方法,装饰器,生成器,迭代器

    内置方法,就是python3提供的各种函数,可以认为是关键字,帮助进行一些列的牛x运算. abs()#取绝对值 all([])#可迭代对象中的所有元素都为True 则为True,只要至少一个为Fals ...

  5. 高阶函数 map,reduce, filter的用法

    1. map 用法 def fun_C(x): """求平方""" return x ** 2 result = map(fun_C, my ...

  6. 第七章习题G题

    题意 给出如图案例,要你从某一点开始走,一直走到极限(即无法再进行扩展),这时你走过的点会连成一个数,不同的走法当然会有不同的数,要求是输出最大的数(注意每个方块走过一次就不能再走) 思路 •1.枚举 ...

  7. 节点回来shard仍然delayed原因

    1:es2 fetch shard data时,存在节点刚加入集群,还没有收到cluster metadata的情况.此时,节点因为没有该索引,返回的sharddata为empty,主节点缓存了该sh ...

  8. acm 一年总结

    首先是大一的一段简短历史,和其他人不太一样,刚上大一的我等于是刚刚接触电脑,开始下载程序啦,安装系统了,电脑出个小问题啦自己都不会解决,然后大一还开了一门叫做c语言的课程,顿时傻逼了,当时也不用功,大 ...

  9. <a href="ip地址" target=""_blank">a里面的target</a>

    HTML <a> 标签的 target 属性 定义和用法 <a> 标签的 target 属性规定在何处打开链接文档. 如果在一个 <a> 标签内包含一个 targe ...

  10. cogs——555. 网络探测

    555. 网络探测 ★☆   输入文件:ping.in   输出文件:ping.out   简单对比时间限制:1 s   内存限制:128 MB [问题描述]    当出现网络故障时,我们经常使用“p ...