OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/ash/event_rewriter.h" | 5 #include "chrome/browser/ui/ash/event_rewriter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 { XK_Super_L, XK_Super_L, XK_Super_L, XK_Super_L }}, | 59 { XK_Super_L, XK_Super_L, XK_Super_L, XK_Super_L }}, |
60 { chromeos::input_method::kControlKey, ui::EF_CONTROL_DOWN, ControlMask, | 60 { chromeos::input_method::kControlKey, ui::EF_CONTROL_DOWN, ControlMask, |
61 ui::VKEY_CONTROL, | 61 ui::VKEY_CONTROL, |
62 { XK_Control_L, XK_Control_R, XK_Control_L, XK_Control_R }}, | 62 { XK_Control_L, XK_Control_R, XK_Control_L, XK_Control_R }}, |
63 { chromeos::input_method::kAltKey, ui::EF_ALT_DOWN, Mod1Mask, | 63 { chromeos::input_method::kAltKey, ui::EF_ALT_DOWN, Mod1Mask, |
64 ui::VKEY_MENU, { XK_Alt_L, XK_Alt_R, XK_Meta_L, XK_Meta_R }}, | 64 ui::VKEY_MENU, { XK_Alt_L, XK_Alt_R, XK_Meta_L, XK_Meta_R }}, |
65 { chromeos::input_method::kVoidKey, 0, 0U, ui::VKEY_UNKNOWN, | 65 { chromeos::input_method::kVoidKey, 0, 0U, ui::VKEY_UNKNOWN, |
66 { XK_VoidSymbol, XK_VoidSymbol, XK_VoidSymbol, XK_VoidSymbol }}, | 66 { XK_VoidSymbol, XK_VoidSymbol, XK_VoidSymbol, XK_VoidSymbol }}, |
67 { chromeos::input_method::kCapsLockKey, 0, 0U, ui::VKEY_CAPITAL, | 67 { chromeos::input_method::kCapsLockKey, 0, 0U, ui::VKEY_CAPITAL, |
68 { XK_Caps_Lock, XK_Caps_Lock, XK_Caps_Lock, XK_Caps_Lock }}, | 68 { XK_Caps_Lock, XK_Caps_Lock, XK_Caps_Lock, XK_Caps_Lock }}, |
| 69 { chromeos::input_method::kEscapeKey, 0, 0U, ui::VKEY_ESCAPE, |
| 70 { XK_Escape, XK_Escape, XK_Escape, XK_Escape }}, |
69 }; | 71 }; |
70 | 72 |
71 const ModifierRemapping* kModifierRemappingCtrl = &kModifierRemappings[1]; | 73 const ModifierRemapping* kModifierRemappingCtrl = &kModifierRemappings[1]; |
72 | 74 |
73 // A structure for converting |native_modifier| to a pair of |flag| and | 75 // A structure for converting |native_modifier| to a pair of |flag| and |
74 // |pref_name|. | 76 // |pref_name|. |
75 const struct ModifierFlagToPrefName { | 77 const struct ModifierFlagToPrefName { |
76 unsigned int native_modifier; | 78 unsigned int native_modifier; |
77 int flag; | 79 int flag; |
78 const char* pref_name; | 80 const char* pref_name; |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 const DeviceType type = EventRewriter::GetDeviceType(device_name); | 1011 const DeviceType type = EventRewriter::GetDeviceType(device_name); |
1010 if (type == kDeviceAppleKeyboard) { | 1012 if (type == kDeviceAppleKeyboard) { |
1011 VLOG(1) << "Apple keyboard '" << device_name << "' connected: " | 1013 VLOG(1) << "Apple keyboard '" << device_name << "' connected: " |
1012 << "id=" << device_id; | 1014 << "id=" << device_id; |
1013 } | 1015 } |
1014 // Always overwrite the existing device_id since the X server may reuse a | 1016 // Always overwrite the existing device_id since the X server may reuse a |
1015 // device id for an unattached device. | 1017 // device id for an unattached device. |
1016 device_id_to_type_[device_id] = type; | 1018 device_id_to_type_[device_id] = type; |
1017 return type; | 1019 return type; |
1018 } | 1020 } |
OLD | NEW |