Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ui/events/keycodes/keyboard_code_conversion_android.cc

Issue 1308063007: Generate non-located windowsKeyCode for the WebInputEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/content_browser.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/keycodes/keyboard_code_conversion_android.h" 5 #include "ui/events/keycodes/keyboard_code_conversion_android.h"
6 6
7 #include <android/keycodes.h> 7 #include <android/keycodes.h>
8 8
9 namespace ui { 9 namespace ui {
10 10
11 namespace {
12
13 // The Android NDK does not provide values for these yet:
14 enum {
15 AKEYCODE_ESCAPE = 111,
16 AKEYCODE_FORWARD_DEL = 112,
17 AKEYCODE_CTRL_LEFT = 113,
18 AKEYCODE_CTRL_RIGHT = 114,
19 AKEYCODE_CAPS_LOCK = 115,
20 AKEYCODE_SCROLL_LOCK = 116,
21 AKEYCODE_META_LEFT = 117,
22 AKEYCODE_META_RIGHT = 118,
23 AKEYCODE_BREAK = 121,
24 AKEYCODE_MOVE_HOME = 122,
25 AKEYCODE_MOVE_END = 123,
26 AKEYCODE_INSERT = 124,
27 AKEYCODE_MEDIA_PLAY = 126,
28 AKEYCODE_MEDIA_PAUSE = 127,
29 AKEYCODE_F1 = 131,
30 AKEYCODE_F2 = 132,
31 AKEYCODE_F3 = 133,
32 AKEYCODE_F4 = 134,
33 AKEYCODE_F5 = 135,
34 AKEYCODE_F6 = 136,
35 AKEYCODE_F7 = 137,
36 AKEYCODE_F8 = 138,
37 AKEYCODE_F9 = 139,
38 AKEYCODE_F10 = 140,
39 AKEYCODE_F11 = 141,
40 AKEYCODE_F12 = 142,
41 AKEYCODE_NUM_LOCK = 143,
42 AKEYCODE_NUMPAD_0 = 144,
43 AKEYCODE_NUMPAD_1 = 145,
44 AKEYCODE_NUMPAD_2 = 146,
45 AKEYCODE_NUMPAD_3 = 147,
46 AKEYCODE_NUMPAD_4 = 148,
47 AKEYCODE_NUMPAD_5 = 149,
48 AKEYCODE_NUMPAD_6 = 150,
49 AKEYCODE_NUMPAD_7 = 151,
50 AKEYCODE_NUMPAD_8 = 152,
51 AKEYCODE_NUMPAD_9 = 153,
52 AKEYCODE_NUMPAD_DIVIDE = 154,
53 AKEYCODE_NUMPAD_MULTIPLY = 155,
54 AKEYCODE_NUMPAD_SUBTRACT = 156,
55 AKEYCODE_NUMPAD_ADD = 157,
56 AKEYCODE_NUMPAD_DOT = 158,
57 AKEYCODE_VOLUME_MUTE = 164,
58 AKEYCODE_CHANNEL_UP = 166,
59 AKEYCODE_CHANNEL_DOWN = 167,
60 };
61
62 } // namespace
63
64 KeyboardCode KeyboardCodeFromAndroidKeyCode(int keycode) { 11 KeyboardCode KeyboardCodeFromAndroidKeyCode(int keycode) {
65 // Does not provide all key codes, and does not handle all keys. 12 // Does not provide all key codes, and does not handle all keys.
66 switch (keycode) { 13 switch (keycode) {
67 case AKEYCODE_DEL: 14 case AKEYCODE_DEL:
68 return VKEY_BACK; 15 return VKEY_BACK;
69 case AKEYCODE_TAB: 16 case AKEYCODE_TAB:
70 return VKEY_TAB; 17 return VKEY_TAB;
71 case AKEYCODE_CLEAR: 18 case AKEYCODE_CLEAR:
72 return VKEY_CLEAR; 19 return VKEY_CLEAR;
73 case AKEYCODE_DPAD_CENTER: 20 case AKEYCODE_DPAD_CENTER:
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 case AKEYCODE_CHANNEL_UP: 246 case AKEYCODE_CHANNEL_UP:
300 return VKEY_PRIOR; 247 return VKEY_PRIOR;
301 case AKEYCODE_CHANNEL_DOWN: 248 case AKEYCODE_CHANNEL_DOWN:
302 return VKEY_NEXT; 249 return VKEY_NEXT;
303 default: 250 default:
304 return VKEY_UNKNOWN; 251 return VKEY_UNKNOWN;
305 } 252 }
306 } 253 }
307 254
308 } // namespace ui 255 } // namespace ui
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698