OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/events/event_rewriter.h" | 5 #include "chrome/browser/chromeos/events/event_rewriter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void UpdateX11EventMask(int ui_flags, unsigned int* x_flags) { | 130 void UpdateX11EventMask(int ui_flags, unsigned int* x_flags) { |
131 static struct { | 131 static struct { |
132 int ui; | 132 int ui; |
133 int x; | 133 int x; |
134 } flags[] = { | 134 } flags[] = { |
135 {ui::EF_CONTROL_DOWN, ControlMask}, | 135 {ui::EF_CONTROL_DOWN, ControlMask}, |
136 {ui::EF_SHIFT_DOWN, ShiftMask}, | 136 {ui::EF_SHIFT_DOWN, ShiftMask}, |
137 {ui::EF_ALT_DOWN, Mod1Mask}, | 137 {ui::EF_ALT_DOWN, Mod1Mask}, |
138 {ui::EF_CAPS_LOCK_DOWN, LockMask}, | 138 {ui::EF_CAPS_LOCK_DOWN, LockMask}, |
139 {ui::EF_ALTGR_DOWN, Mod5Mask}, | 139 {ui::EF_ALTGR_DOWN, Mod5Mask}, |
| 140 {ui::EF_COMMAND_DOWN, Mod4Mask}, |
140 {ui::EF_MOD3_DOWN, Mod3Mask}, | 141 {ui::EF_MOD3_DOWN, Mod3Mask}, |
141 {ui::EF_NUMPAD_KEY, Mod2Mask}, | 142 {ui::EF_NUMPAD_KEY, Mod2Mask}, |
142 {ui::EF_LEFT_MOUSE_BUTTON, Button1Mask}, | 143 {ui::EF_LEFT_MOUSE_BUTTON, Button1Mask}, |
143 {ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask}, | 144 {ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask}, |
144 {ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask}, | 145 {ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask}, |
145 }; | 146 }; |
146 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) { | 147 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) { |
147 if (ui_flags & flags[i].ui) | 148 if (ui_flags & flags[i].ui) |
148 *x_flags |= flags[i].x; | 149 *x_flags |= flags[i].x; |
149 else | 150 else |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 758 |
758 XIFreeDeviceInfo(device_info); | 759 XIFreeDeviceInfo(device_info); |
759 } | 760 } |
760 | 761 |
761 void EventRewriter::DeviceRemoved(int device_id) { | 762 void EventRewriter::DeviceRemoved(int device_id) { |
762 device_id_to_type_.erase(device_id); | 763 device_id_to_type_.erase(device_id); |
763 } | 764 } |
764 #endif | 765 #endif |
765 | 766 |
766 } // namespace chromeos | 767 } // namespace chromeos |
OLD | NEW |