当前位置:   article > 正文

Android:如何通过adb控制手机_adb怎么控制手机滑动

adb怎么控制手机滑动

adb 模拟事件是通过input命令来实现的,首先看一下input命令格式:

  1. leezs:/ $ input
  2. Usage: input [<source>] <command> [<arg>...]
  3. The sources are:
  4. dpad
  5. keyboard
  6. mouse
  7. touchpad
  8. gamepad
  9. touchnavigation
  10. joystick
  11. touchscreen
  12. stylus
  13. trackball
  14. The commands and default sources are:
  15. text <string> (Default: touchscreen)
  16. keyevent [--longpress] <key code number or name> ... (Default: keyboard)
  17. tap <x> <y> (Default: touchscreen)
  18. swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
  19. draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
  20. press (Default: trackball)
  21. roll <dx> <dy> (Default: trackball)

1、一些常用的简单的命令如下:(具体keycode码可以拉最下面看)

adb shell input keyevent 3    home键

adb shell input keyevent 4     back键

adb shell input keyevent 82   menu键

2、通过tap模拟touch事件,点击屏幕:adb shell input tap x坐标 y坐标,比如点击屏幕分辨率300,300的位置

adb shell input tap 300 300

3、swipe跟tap差不多,但是是滑动事件,给出xy坐标起始和终点位置即可,如

adb shell input swipe 300 300 600 600

相当于从屏幕分辨率300,300的位置滑动到600,600的位置。

附录:key code

  1. /**
  2. * Key codes.
  3. */
  4. enum {
  5. /** Unknown key code. */
  6. AKEYCODE_UNKNOWN = 0,
  7. /** Soft Left key.
  8. * Usually situated below the display on phones and used as a multi-function
  9. * feature key for selecting a software defined function shown on the bottom left
  10. * of the display. */
  11. AKEYCODE_SOFT_LEFT = 1,
  12. /** Soft Right key.
  13. * Usually situated below the display on phones and used as a multi-function
  14. * feature key for selecting a software defined function shown on the bottom right
  15. * of the display. */
  16. AKEYCODE_SOFT_RIGHT = 2,
  17. /** Home key.
  18. * This key is handled by the framework and is never delivered to applications. */
  19. AKEYCODE_HOME = 3,
  20. /** Back key. */
  21. AKEYCODE_BACK = 4,
  22. /** Call key. */
  23. AKEYCODE_CALL = 5,
  24. /** End Call key. */
  25. AKEYCODE_ENDCALL = 6,
  26. /** '0' key. */
  27. AKEYCODE_0 = 7,
  28. /** '1' key. */
  29. AKEYCODE_1 = 8,
  30. /** '2' key. */
  31. AKEYCODE_2 = 9,
  32. /** '3' key. */
  33. AKEYCODE_3 = 10,
  34. /** '4' key. */
  35. AKEYCODE_4 = 11,
  36. /** '5' key. */
  37. AKEYCODE_5 = 12,
  38. /** '6' key. */
  39. AKEYCODE_6 = 13,
  40. /** '7' key. */
  41. AKEYCODE_7 = 14,
  42. /** '8' key. */
  43. AKEYCODE_8 = 15,
  44. /** '9' key. */
  45. AKEYCODE_9 = 16,
  46. /** '*' key. */
  47. AKEYCODE_STAR = 17,
  48. /** '#' key. */
  49. AKEYCODE_POUND = 18,
  50. /** Directional Pad Up key.
  51. * May also be synthesized from trackball motions. */
  52. AKEYCODE_DPAD_UP = 19,
  53. /** Directional Pad Down key.
  54. * May also be synthesized from trackball motions. */
  55. AKEYCODE_DPAD_DOWN = 20,
  56. /** Directional Pad Left key.
  57. * May also be synthesized from trackball motions. */
  58. AKEYCODE_DPAD_LEFT = 21,
  59. /** Directional Pad Right key.
  60. * May also be synthesized from trackball motions. */
  61. AKEYCODE_DPAD_RIGHT = 22,
  62. /** Directional Pad Center key.
  63. * May also be synthesized from trackball motions. */
  64. AKEYCODE_DPAD_CENTER = 23,
  65. /** Volume Up key.
  66. * Adjusts the speaker volume up. */
  67. AKEYCODE_VOLUME_UP = 24,
  68. /** Volume Down key.
  69. * Adjusts the speaker volume down. */
  70. AKEYCODE_VOLUME_DOWN = 25,
  71. /** Power key. */
  72. AKEYCODE_POWER = 26,
  73. /** Camera key.
  74. * Used to launch a camera application or take pictures. */
  75. AKEYCODE_CAMERA = 27,
  76. /** Clear key. */
  77. AKEYCODE_CLEAR = 28,
  78. /** 'A' key. */
  79. AKEYCODE_A = 29,
  80. /** 'B' key. */
  81. AKEYCODE_B = 30,
  82. /** 'C' key. */
  83. AKEYCODE_C = 31,
  84. /** 'D' key. */
  85. AKEYCODE_D = 32,
  86. /** 'E' key. */
  87. AKEYCODE_E = 33,
  88. /** 'F' key. */
  89. AKEYCODE_F = 34,
  90. /** 'G' key. */
  91. AKEYCODE_G = 35,
  92. /** 'H' key. */
  93. AKEYCODE_H = 36,
  94. /** 'I' key. */
  95. AKEYCODE_I = 37,
  96. /** 'J' key. */
  97. AKEYCODE_J = 38,
  98. /** 'K' key. */
  99. AKEYCODE_K = 39,
  100. /** 'L' key. */
  101. AKEYCODE_L = 40,
  102. /** 'M' key. */
  103. AKEYCODE_M = 41,
  104. /** 'N' key. */
  105. AKEYCODE_N = 42,
  106. /** 'O' key. */
  107. AKEYCODE_O = 43,
  108. /** 'P' key. */
  109. AKEYCODE_P = 44,
  110. /** 'Q' key. */
  111. AKEYCODE_Q = 45,
  112. /** 'R' key. */
  113. AKEYCODE_R = 46,
  114. /** 'S' key. */
  115. AKEYCODE_S = 47,
  116. /** 'T' key. */
  117. AKEYCODE_T = 48,
  118. /** 'U' key. */
  119. AKEYCODE_U = 49,
  120. /** 'V' key. */
  121. AKEYCODE_V = 50,
  122. /** 'W' key. */
  123. AKEYCODE_W = 51,
  124. /** 'X' key. */
  125. AKEYCODE_X = 52,
  126. /** 'Y' key. */
  127. AKEYCODE_Y = 53,
  128. /** 'Z' key. */
  129. AKEYCODE_Z = 54,
  130. /** ',' key. */
  131. AKEYCODE_COMMA = 55,
  132. /** '.' key. */
  133. AKEYCODE_PERIOD = 56,
  134. /** Left Alt modifier key. */
  135. AKEYCODE_ALT_LEFT = 57,
  136. /** Right Alt modifier key. */
  137. AKEYCODE_ALT_RIGHT = 58,
  138. /** Left Shift modifier key. */
  139. AKEYCODE_SHIFT_LEFT = 59,
  140. /** Right Shift modifier key. */
  141. AKEYCODE_SHIFT_RIGHT = 60,
  142. /** Tab key. */
  143. AKEYCODE_TAB = 61,
  144. /** Space key. */
  145. AKEYCODE_SPACE = 62,
  146. /** Symbol modifier key.
  147. * Used to enter alternate symbols. */
  148. AKEYCODE_SYM = 63,
  149. /** Explorer special function key.
  150. * Used to launch a browser application. */
  151. AKEYCODE_EXPLORER = 64,
  152. /** Envelope special function key.
  153. * Used to launch a mail application. */
  154. AKEYCODE_ENVELOPE = 65,
  155. /** Enter key. */
  156. AKEYCODE_ENTER = 66,
  157. /** Backspace key.
  158. * Deletes characters before the insertion point, unlike {@link AKEYCODE_FORWARD_DEL}. */
  159. AKEYCODE_DEL = 67,
  160. /** '`' (backtick) key. */
  161. AKEYCODE_GRAVE = 68,
  162. /** '-'. */
  163. AKEYCODE_MINUS = 69,
  164. /** '=' key. */
  165. AKEYCODE_EQUALS = 70,
  166. /** '[' key. */
  167. AKEYCODE_LEFT_BRACKET = 71,
  168. /** ']' key. */
  169. AKEYCODE_RIGHT_BRACKET = 72,
  170. /** '\' key. */
  171. AKEYCODE_BACKSLASH = 73,
  172. /** ';' key. */
  173. AKEYCODE_SEMICOLON = 74,
  174. /** ''' (apostrophe) key. */
  175. AKEYCODE_APOSTROPHE = 75,
  176. /** '/' key. */
  177. AKEYCODE_SLASH = 76,
  178. /** '@' key. */
  179. AKEYCODE_AT = 77,
  180. /** Number modifier key.
  181. * Used to enter numeric symbols.
  182. * This key is not {@link AKEYCODE_NUM_LOCK}; it is more like {@link AKEYCODE_ALT_LEFT}. */
  183. AKEYCODE_NUM = 78,
  184. /** Headset Hook key.
  185. * Used to hang up calls and stop media. */
  186. AKEYCODE_HEADSETHOOK = 79,
  187. /** Camera Focus key.
  188. * Used to focus the camera. */
  189. AKEYCODE_FOCUS = 80,
  190. /** '+' key. */
  191. AKEYCODE_PLUS = 81,
  192. /** Menu key. */
  193. AKEYCODE_MENU = 82,
  194. /** Notification key. */
  195. AKEYCODE_NOTIFICATION = 83,
  196. /** Search key. */
  197. AKEYCODE_SEARCH = 84,
  198. /** Play/Pause media key. */
  199. AKEYCODE_MEDIA_PLAY_PAUSE= 85,
  200. /** Stop media key. */
  201. AKEYCODE_MEDIA_STOP = 86,
  202. /** Play Next media key. */
  203. AKEYCODE_MEDIA_NEXT = 87,
  204. /** Play Previous media key. */
  205. AKEYCODE_MEDIA_PREVIOUS = 88,
  206. /** Rewind media key. */
  207. AKEYCODE_MEDIA_REWIND = 89,
  208. /** Fast Forward media key. */
  209. AKEYCODE_MEDIA_FAST_FORWARD = 90,
  210. /** Mute key.
  211. * Mutes the microphone, unlike {@link AKEYCODE_VOLUME_MUTE}. */
  212. AKEYCODE_MUTE = 91,
  213. /** Page Up key. */
  214. AKEYCODE_PAGE_UP = 92,
  215. /** Page Down key. */
  216. AKEYCODE_PAGE_DOWN = 93,
  217. /** Picture Symbols modifier key.
  218. * Used to switch symbol sets (Emoji, Kao-moji). */
  219. AKEYCODE_PICTSYMBOLS = 94,
  220. /** Switch Charset modifier key.
  221. * Used to switch character sets (Kanji, Katakana). */
  222. AKEYCODE_SWITCH_CHARSET = 95,
  223. /** A Button key.
  224. * On a game controller, the A button should be either the button labeled A
  225. * or the first button on the bottom row of controller buttons. */
  226. AKEYCODE_BUTTON_A = 96,
  227. /** B Button key.
  228. * On a game controller, the B button should be either the button labeled B
  229. * or the second button on the bottom row of controller buttons. */
  230. AKEYCODE_BUTTON_B = 97,
  231. /** C Button key.
  232. * On a game controller, the C button should be either the button labeled C
  233. * or the third button on the bottom row of controller buttons. */
  234. AKEYCODE_BUTTON_C = 98,
  235. /** X Button key.
  236. * On a game controller, the X button should be either the button labeled X
  237. * or the first button on the upper row of controller buttons. */
  238. AKEYCODE_BUTTON_X = 99,
  239. /** Y Button key.
  240. * On a game controller, the Y button should be either the button labeled Y
  241. * or the second button on the upper row of controller buttons. */
  242. AKEYCODE_BUTTON_Y = 100,
  243. /** Z Button key.
  244. * On a game controller, the Z button should be either the button labeled Z
  245. * or the third button on the upper row of controller buttons. */
  246. AKEYCODE_BUTTON_Z = 101,
  247. /** L1 Button key.
  248. * On a game controller, the L1 button should be either the button labeled L1 (or L)
  249. * or the top left trigger button. */
  250. AKEYCODE_BUTTON_L1 = 102,
  251. /** R1 Button key.
  252. * On a game controller, the R1 button should be either the button labeled R1 (or R)
  253. * or the top right trigger button. */
  254. AKEYCODE_BUTTON_R1 = 103,
  255. /** L2 Button key.
  256. * On a game controller, the L2 button should be either the button labeled L2
  257. * or the bottom left trigger button. */
  258. AKEYCODE_BUTTON_L2 = 104,
  259. /** R2 Button key.
  260. * On a game controller, the R2 button should be either the button labeled R2
  261. * or the bottom right trigger button. */
  262. AKEYCODE_BUTTON_R2 = 105,
  263. /** Left Thumb Button key.
  264. * On a game controller, the left thumb button indicates that the left (or only)
  265. * joystick is pressed. */
  266. AKEYCODE_BUTTON_THUMBL = 106,
  267. /** Right Thumb Button key.
  268. * On a game controller, the right thumb button indicates that the right
  269. * joystick is pressed. */
  270. AKEYCODE_BUTTON_THUMBR = 107,
  271. /** Start Button key.
  272. * On a game controller, the button labeled Start. */
  273. AKEYCODE_BUTTON_START = 108,
  274. /** Select Button key.
  275. * On a game controller, the button labeled Select. */
  276. AKEYCODE_BUTTON_SELECT = 109,
  277. /** Mode Button key.
  278. * On a game controller, the button labeled Mode. */
  279. AKEYCODE_BUTTON_MODE = 110,
  280. /** Escape key. */
  281. AKEYCODE_ESCAPE = 111,
  282. /** Forward Delete key.
  283. * Deletes characters ahead of the insertion point, unlike {@link AKEYCODE_DEL}. */
  284. AKEYCODE_FORWARD_DEL = 112,
  285. /** Left Control modifier key. */
  286. AKEYCODE_CTRL_LEFT = 113,
  287. /** Right Control modifier key. */
  288. AKEYCODE_CTRL_RIGHT = 114,
  289. /** Caps Lock key. */
  290. AKEYCODE_CAPS_LOCK = 115,
  291. /** Scroll Lock key. */
  292. AKEYCODE_SCROLL_LOCK = 116,
  293. /** Left Meta modifier key. */
  294. AKEYCODE_META_LEFT = 117,
  295. /** Right Meta modifier key. */
  296. AKEYCODE_META_RIGHT = 118,
  297. /** Function modifier key. */
  298. AKEYCODE_FUNCTION = 119,
  299. /** System Request / Print Screen key. */
  300. AKEYCODE_SYSRQ = 120,
  301. /** Break / Pause key. */
  302. AKEYCODE_BREAK = 121,
  303. /** Home Movement key.
  304. * Used for scrolling or moving the cursor around to the start of a line
  305. * or to the top of a list. */
  306. AKEYCODE_MOVE_HOME = 122,
  307. /** End Movement key.
  308. * Used for scrolling or moving the cursor around to the end of a line
  309. * or to the bottom of a list. */
  310. AKEYCODE_MOVE_END = 123,
  311. /** Insert key.
  312. * Toggles insert / overwrite edit mode. */
  313. AKEYCODE_INSERT = 124,
  314. /** Forward key.
  315. * Navigates forward in the history stack. Complement of {@link AKEYCODE_BACK}. */
  316. AKEYCODE_FORWARD = 125,
  317. /** Play media key. */
  318. AKEYCODE_MEDIA_PLAY = 126,
  319. /** Pause media key. */
  320. AKEYCODE_MEDIA_PAUSE = 127,
  321. /** Close media key.
  322. * May be used to close a CD tray, for example. */
  323. AKEYCODE_MEDIA_CLOSE = 128,
  324. /** Eject media key.
  325. * May be used to eject a CD tray, for example. */
  326. AKEYCODE_MEDIA_EJECT = 129,
  327. /** Record media key. */
  328. AKEYCODE_MEDIA_RECORD = 130,
  329. /** F1 key. */
  330. AKEYCODE_F1 = 131,
  331. /** F2 key. */
  332. AKEYCODE_F2 = 132,
  333. /** F3 key. */
  334. AKEYCODE_F3 = 133,
  335. /** F4 key. */
  336. AKEYCODE_F4 = 134,
  337. /** F5 key. */
  338. AKEYCODE_F5 = 135,
  339. /** F6 key. */
  340. AKEYCODE_F6 = 136,
  341. /** F7 key. */
  342. AKEYCODE_F7 = 137,
  343. /** F8 key. */
  344. AKEYCODE_F8 = 138,
  345. /** F9 key. */
  346. AKEYCODE_F9 = 139,
  347. /** F10 key. */
  348. AKEYCODE_F10 = 140,
  349. /** F11 key. */
  350. AKEYCODE_F11 = 141,
  351. /** F12 key. */
  352. AKEYCODE_F12 = 142,
  353. /** Num Lock key.
  354. * This is the Num Lock key; it is different from {@link AKEYCODE_NUM}.
  355. * This key alters the behavior of other keys on the numeric keypad. */
  356. AKEYCODE_NUM_LOCK = 143,
  357. /** Numeric keypad '0' key. */
  358. AKEYCODE_NUMPAD_0 = 144,
  359. /** Numeric keypad '1' key. */
  360. AKEYCODE_NUMPAD_1 = 145,
  361. /** Numeric keypad '2' key. */
  362. AKEYCODE_NUMPAD_2 = 146,
  363. /** Numeric keypad '3' key. */
  364. AKEYCODE_NUMPAD_3 = 147,
  365. /** Numeric keypad '4' key. */
  366. AKEYCODE_NUMPAD_4 = 148,
  367. /** Numeric keypad '5' key. */
  368. AKEYCODE_NUMPAD_5 = 149,
  369. /** Numeric keypad '6' key. */
  370. AKEYCODE_NUMPAD_6 = 150,
  371. /** Numeric keypad '7' key. */
  372. AKEYCODE_NUMPAD_7 = 151,
  373. /** Numeric keypad '8' key. */
  374. AKEYCODE_NUMPAD_8 = 152,
  375. /** Numeric keypad '9' key. */
  376. AKEYCODE_NUMPAD_9 = 153,
  377. /** Numeric keypad '/' key (for division). */
  378. AKEYCODE_NUMPAD_DIVIDE = 154,
  379. /** Numeric keypad '*' key (for multiplication). */
  380. AKEYCODE_NUMPAD_MULTIPLY = 155,
  381. /** Numeric keypad '-' key (for subtraction). */
  382. AKEYCODE_NUMPAD_SUBTRACT = 156,
  383. /** Numeric keypad '+' key (for addition). */
  384. AKEYCODE_NUMPAD_ADD = 157,
  385. /** Numeric keypad '.' key (for decimals or digit grouping). */
  386. AKEYCODE_NUMPAD_DOT = 158,
  387. /** Numeric keypad ',' key (for decimals or digit grouping). */
  388. AKEYCODE_NUMPAD_COMMA = 159,
  389. /** Numeric keypad Enter key. */
  390. AKEYCODE_NUMPAD_ENTER = 160,
  391. /** Numeric keypad '=' key. */
  392. AKEYCODE_NUMPAD_EQUALS = 161,
  393. /** Numeric keypad '(' key. */
  394. AKEYCODE_NUMPAD_LEFT_PAREN = 162,
  395. /** Numeric keypad ')' key. */
  396. AKEYCODE_NUMPAD_RIGHT_PAREN = 163,
  397. /** Volume Mute key.
  398. * Mutes the speaker, unlike {@link AKEYCODE_MUTE}.
  399. * This key should normally be implemented as a toggle such that the first press
  400. * mutes the speaker and the second press restores the original volume. */
  401. AKEYCODE_VOLUME_MUTE = 164,
  402. /** Info key.
  403. * Common on TV remotes to show additional information related to what is
  404. * currently being viewed. */
  405. AKEYCODE_INFO = 165,
  406. /** Channel up key.
  407. * On TV remotes, increments the television channel. */
  408. AKEYCODE_CHANNEL_UP = 166,
  409. /** Channel down key.
  410. * On TV remotes, decrements the television channel. */
  411. AKEYCODE_CHANNEL_DOWN = 167,
  412. /** Zoom in key. */
  413. AKEYCODE_ZOOM_IN = 168,
  414. /** Zoom out key. */
  415. AKEYCODE_ZOOM_OUT = 169,
  416. /** TV key.
  417. * On TV remotes, switches to viewing live TV. */
  418. AKEYCODE_TV = 170,
  419. /** Window key.
  420. * On TV remotes, toggles picture-in-picture mode or other windowing functions. */
  421. AKEYCODE_WINDOW = 171,
  422. /** Guide key.
  423. * On TV remotes, shows a programming guide. */
  424. AKEYCODE_GUIDE = 172,
  425. /** DVR key.
  426. * On some TV remotes, switches to a DVR mode for recorded shows. */
  427. AKEYCODE_DVR = 173,
  428. /** Bookmark key.
  429. * On some TV remotes, bookmarks content or web pages. */
  430. AKEYCODE_BOOKMARK = 174,
  431. /** Toggle captions key.
  432. * Switches the mode for closed-captioning text, for example during television shows. */
  433. AKEYCODE_CAPTIONS = 175,
  434. /** Settings key.
  435. * Starts the system settings activity. */
  436. AKEYCODE_SETTINGS = 176,
  437. /** TV power key.
  438. * On TV remotes, toggles the power on a television screen. */
  439. AKEYCODE_TV_POWER = 177,
  440. /** TV input key.
  441. * On TV remotes, switches the input on a television screen. */
  442. AKEYCODE_TV_INPUT = 178,
  443. /** Set-top-box power key.
  444. * On TV remotes, toggles the power on an external Set-top-box. */
  445. AKEYCODE_STB_POWER = 179,
  446. /** Set-top-box input key.
  447. * On TV remotes, switches the input mode on an external Set-top-box. */
  448. AKEYCODE_STB_INPUT = 180,
  449. /** A/V Receiver power key.
  450. * On TV remotes, toggles the power on an external A/V Receiver. */
  451. AKEYCODE_AVR_POWER = 181,
  452. /** A/V Receiver input key.
  453. * On TV remotes, switches the input mode on an external A/V Receiver. */
  454. AKEYCODE_AVR_INPUT = 182,
  455. /** Red "programmable" key.
  456. * On TV remotes, acts as a contextual/programmable key. */
  457. AKEYCODE_PROG_RED = 183,
  458. /** Green "programmable" key.
  459. * On TV remotes, actsas a contextual/programmable key. */
  460. AKEYCODE_PROG_GREEN = 184,
  461. /** Yellow "programmable" key.
  462. * On TV remotes, acts as a contextual/programmable key. */
  463. AKEYCODE_PROG_YELLOW = 185,
  464. /** Blue "programmable" key.
  465. * On TV remotes, acts as a contextual/programmable key. */
  466. AKEYCODE_PROG_BLUE = 186,
  467. /** App switch key.
  468. * Should bring up the application switcher dialog. */
  469. AKEYCODE_APP_SWITCH = 187,
  470. /** Generic Game Pad Button #1.*/
  471. AKEYCODE_BUTTON_1 = 188,
  472. /** Generic Game Pad Button #2.*/
  473. AKEYCODE_BUTTON_2 = 189,
  474. /** Generic Game Pad Button #3.*/
  475. AKEYCODE_BUTTON_3 = 190,
  476. /** Generic Game Pad Button #4.*/
  477. AKEYCODE_BUTTON_4 = 191,
  478. /** Generic Game Pad Button #5.*/
  479. AKEYCODE_BUTTON_5 = 192,
  480. /** Generic Game Pad Button #6.*/
  481. AKEYCODE_BUTTON_6 = 193,
  482. /** Generic Game Pad Button #7.*/
  483. AKEYCODE_BUTTON_7 = 194,
  484. /** Generic Game Pad Button #8.*/
  485. AKEYCODE_BUTTON_8 = 195,
  486. /** Generic Game Pad Button #9.*/
  487. AKEYCODE_BUTTON_9 = 196,
  488. /** Generic Game Pad Button #10.*/
  489. AKEYCODE_BUTTON_10 = 197,
  490. /** Generic Game Pad Button #11.*/
  491. AKEYCODE_BUTTON_11 = 198,
  492. /** Generic Game Pad Button #12.*/
  493. AKEYCODE_BUTTON_12 = 199,
  494. /** Generic Game Pad Button #13.*/
  495. AKEYCODE_BUTTON_13 = 200,
  496. /** Generic Game Pad Button #14.*/
  497. AKEYCODE_BUTTON_14 = 201,
  498. /** Generic Game Pad Button #15.*/
  499. AKEYCODE_BUTTON_15 = 202,
  500. /** Generic Game Pad Button #16.*/
  501. AKEYCODE_BUTTON_16 = 203,
  502. /** Language Switch key.
  503. * Toggles the current input language such as switching between English and Japanese on
  504. * a QWERTY keyboard. On some devices, the same function may be performed by
  505. * pressing Shift+Spacebar. */
  506. AKEYCODE_LANGUAGE_SWITCH = 204,
  507. /** Manner Mode key.
  508. * Toggles silent or vibrate mode on and off to make the device behave more politely
  509. * in certain settings such as on a crowded train. On some devices, the key may only
  510. * operate when long-pressed. */
  511. AKEYCODE_MANNER_MODE = 205,
  512. /** 3D Mode key.
  513. * Toggles the display between 2D and 3D mode. */
  514. AKEYCODE_3D_MODE = 206,
  515. /** Contacts special function key.
  516. * Used to launch an address book application. */
  517. AKEYCODE_CONTACTS = 207,
  518. /** Calendar special function key.
  519. * Used to launch a calendar application. */
  520. AKEYCODE_CALENDAR = 208,
  521. /** Music special function key.
  522. * Used to launch a music player application. */
  523. AKEYCODE_MUSIC = 209,
  524. /** Calculator special function key.
  525. * Used to launch a calculator application. */
  526. AKEYCODE_CALCULATOR = 210,
  527. /** Japanese full-width / half-width key. */
  528. AKEYCODE_ZENKAKU_HANKAKU = 211,
  529. /** Japanese alphanumeric key. */
  530. AKEYCODE_EISU = 212,
  531. /** Japanese non-conversion key. */
  532. AKEYCODE_MUHENKAN = 213,
  533. /** Japanese conversion key. */
  534. AKEYCODE_HENKAN = 214,
  535. /** Japanese katakana / hiragana key. */
  536. AKEYCODE_KATAKANA_HIRAGANA = 215,
  537. /** Japanese Yen key. */
  538. AKEYCODE_YEN = 216,
  539. /** Japanese Ro key. */
  540. AKEYCODE_RO = 217,
  541. /** Japanese kana key. */
  542. AKEYCODE_KANA = 218,
  543. /** Assist key.
  544. * Launches the global assist activity. Not delivered to applications. */
  545. AKEYCODE_ASSIST = 219,
  546. /** Brightness Down key.
  547. * Adjusts the screen brightness down. */
  548. AKEYCODE_BRIGHTNESS_DOWN = 220,
  549. /** Brightness Up key.
  550. * Adjusts the screen brightness up. */
  551. AKEYCODE_BRIGHTNESS_UP = 221,
  552. /** Audio Track key.
  553. * Switches the audio tracks. */
  554. AKEYCODE_MEDIA_AUDIO_TRACK = 222,
  555. /** Sleep key.
  556. * Puts the device to sleep. Behaves somewhat like {@link AKEYCODE_POWER} but it
  557. * has no effect if the device is already asleep. */
  558. AKEYCODE_SLEEP = 223,
  559. /** Wakeup key.
  560. * Wakes up the device. Behaves somewhat like {@link AKEYCODE_POWER} but it
  561. * has no effect if the device is already awake. */
  562. AKEYCODE_WAKEUP = 224,
  563. /** Pairing key.
  564. * Initiates peripheral pairing mode. Useful for pairing remote control
  565. * devices or game controllers, especially if no other input mode is
  566. * available. */
  567. AKEYCODE_PAIRING = 225,
  568. /** Media Top Menu key.
  569. * Goes to the top of media menu. */
  570. AKEYCODE_MEDIA_TOP_MENU = 226,
  571. /** '11' key. */
  572. AKEYCODE_11 = 227,
  573. /** '12' key. */
  574. AKEYCODE_12 = 228,
  575. /** Last Channel key.
  576. * Goes to the last viewed channel. */
  577. AKEYCODE_LAST_CHANNEL = 229,
  578. /** TV data service key.
  579. * Displays data services like weather, sports. */
  580. AKEYCODE_TV_DATA_SERVICE = 230,
  581. /** Voice Assist key.
  582. * Launches the global voice assist activity. Not delivered to applications. */
  583. AKEYCODE_VOICE_ASSIST = 231,
  584. /** Radio key.
  585. * Toggles TV service / Radio service. */
  586. AKEYCODE_TV_RADIO_SERVICE = 232,
  587. /** Teletext key.
  588. * Displays Teletext service. */
  589. AKEYCODE_TV_TELETEXT = 233,
  590. /** Number entry key.
  591. * Initiates to enter multi-digit channel nubmber when each digit key is assigned
  592. * for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC
  593. * User Control Code. */
  594. AKEYCODE_TV_NUMBER_ENTRY = 234,
  595. /** Analog Terrestrial key.
  596. * Switches to analog terrestrial broadcast service. */
  597. AKEYCODE_TV_TERRESTRIAL_ANALOG = 235,
  598. /** Digital Terrestrial key.
  599. * Switches to digital terrestrial broadcast service. */
  600. AKEYCODE_TV_TERRESTRIAL_DIGITAL = 236,
  601. /** Satellite key.
  602. * Switches to digital satellite broadcast service. */
  603. AKEYCODE_TV_SATELLITE = 237,
  604. /** BS key.
  605. * Switches to BS digital satellite broadcasting service available in Japan. */
  606. AKEYCODE_TV_SATELLITE_BS = 238,
  607. /** CS key.
  608. * Switches to CS digital satellite broadcasting service available in Japan. */
  609. AKEYCODE_TV_SATELLITE_CS = 239,
  610. /** BS/CS key.
  611. * Toggles between BS and CS digital satellite services. */
  612. AKEYCODE_TV_SATELLITE_SERVICE = 240,
  613. /** Toggle Network key.
  614. * Toggles selecting broacast services. */
  615. AKEYCODE_TV_NETWORK = 241,
  616. /** Antenna/Cable key.
  617. * Toggles broadcast input source between antenna and cable. */
  618. AKEYCODE_TV_ANTENNA_CABLE = 242,
  619. /** HDMI #1 key.
  620. * Switches to HDMI input #1. */
  621. AKEYCODE_TV_INPUT_HDMI_1 = 243,
  622. /** HDMI #2 key.
  623. * Switches to HDMI input #2. */
  624. AKEYCODE_TV_INPUT_HDMI_2 = 244,
  625. /** HDMI #3 key.
  626. * Switches to HDMI input #3. */
  627. AKEYCODE_TV_INPUT_HDMI_3 = 245,
  628. /** HDMI #4 key.
  629. * Switches to HDMI input #4. */
  630. AKEYCODE_TV_INPUT_HDMI_4 = 246,
  631. /** Composite #1 key.
  632. * Switches to composite video input #1. */
  633. AKEYCODE_TV_INPUT_COMPOSITE_1 = 247,
  634. /** Composite #2 key.
  635. * Switches to composite video input #2. */
  636. AKEYCODE_TV_INPUT_COMPOSITE_2 = 248,
  637. /** Component #1 key.
  638. * Switches to component video input #1. */
  639. AKEYCODE_TV_INPUT_COMPONENT_1 = 249,
  640. /** Component #2 key.
  641. * Switches to component video input #2. */
  642. AKEYCODE_TV_INPUT_COMPONENT_2 = 250,
  643. /** VGA #1 key.
  644. * Switches to VGA (analog RGB) input #1. */
  645. AKEYCODE_TV_INPUT_VGA_1 = 251,
  646. /** Audio description key.
  647. * Toggles audio description off / on. */
  648. AKEYCODE_TV_AUDIO_DESCRIPTION = 252,
  649. /** Audio description mixing volume up key.
  650. * Louden audio description volume as compared with normal audio volume. */
  651. AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253,
  652. /** Audio description mixing volume down key.
  653. * Lessen audio description volume as compared with normal audio volume. */
  654. AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254,
  655. /** Zoom mode key.
  656. * Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.) */
  657. AKEYCODE_TV_ZOOM_MODE = 255,
  658. /** Contents menu key.
  659. * Goes to the title list. Corresponds to Contents Menu (0x0B) of CEC User Control
  660. * Code */
  661. AKEYCODE_TV_CONTENTS_MENU = 256,
  662. /** Media context menu key.
  663. * Goes to the context menu of media contents. Corresponds to Media Context-sensitive
  664. * Menu (0x11) of CEC User Control Code. */
  665. AKEYCODE_TV_MEDIA_CONTEXT_MENU = 257,
  666. /** Timer programming key.
  667. * Goes to the timer recording menu. Corresponds to Timer Programming (0x54) of
  668. * CEC User Control Code. */
  669. AKEYCODE_TV_TIMER_PROGRAMMING = 258,
  670. /** Help key. */
  671. AKEYCODE_HELP = 259,
  672. AKEYCODE_NAVIGATE_PREVIOUS = 260,
  673. AKEYCODE_NAVIGATE_NEXT = 261,
  674. AKEYCODE_NAVIGATE_IN = 262,
  675. AKEYCODE_NAVIGATE_OUT = 263,
  676. /** Primary stem key for Wear
  677. * Main power/reset button on watch. */
  678. AKEYCODE_STEM_PRIMARY = 264,
  679. /** Generic stem key 1 for Wear */
  680. AKEYCODE_STEM_1 = 265,
  681. /** Generic stem key 2 for Wear */
  682. AKEYCODE_STEM_2 = 266,
  683. /** Generic stem key 3 for Wear */
  684. AKEYCODE_STEM_3 = 267,
  685. /** Directional Pad Up-Left */
  686. AKEYCODE_DPAD_UP_LEFT = 268,
  687. /** Directional Pad Down-Left */
  688. AKEYCODE_DPAD_DOWN_LEFT = 269,
  689. /** Directional Pad Up-Right */
  690. AKEYCODE_DPAD_UP_RIGHT = 270,
  691. /** Directional Pad Down-Right */
  692. AKEYCODE_DPAD_DOWN_RIGHT = 271,
  693. /** Skip forward media key */
  694. AKEYCODE_MEDIA_SKIP_FORWARD = 272,
  695. /** Skip backward media key */
  696. AKEYCODE_MEDIA_SKIP_BACKWARD = 273,
  697. /** Step forward media key.
  698. * Steps media forward one from at a time. */
  699. AKEYCODE_MEDIA_STEP_FORWARD = 274,
  700. /** Step backward media key.
  701. * Steps media backward one from at a time. */
  702. AKEYCODE_MEDIA_STEP_BACKWARD = 275,
  703. /** Put device to sleep unless a wakelock is held. */
  704. AKEYCODE_SOFT_SLEEP = 276,
  705. /** Cut key. */
  706. AKEYCODE_CUT = 277,
  707. /** Copy key. */
  708. AKEYCODE_COPY = 278,
  709. /** Paste key. */
  710. AKEYCODE_PASTE = 279,
  711. /** fingerprint navigation key, up. */
  712. AKEYCODE_SYSTEM_NAVIGATION_UP = 280,
  713. /** fingerprint navigation key, down. */
  714. AKEYCODE_SYSTEM_NAVIGATION_DOWN = 281,
  715. /** fingerprint navigation key, left. */
  716. AKEYCODE_SYSTEM_NAVIGATION_LEFT = 282,
  717. /** fingerprint navigation key, right. */
  718. AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283,
  719. /** all apps */
  720. AKEYCODE_ALL_APPS = 284,
  721. /** refresh key */
  722. AKEYCODE_REFRESH = 285
  723. // NOTE: If you add a new keycode here you must also add it to several other files.
  724. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
  725. };

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/article/detail/56460
推荐阅读
相关标签
  

闽ICP备14008679号