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}, | |
141 {ui::EF_MOD3_DOWN, Mod3Mask}, | 140 {ui::EF_MOD3_DOWN, Mod3Mask}, |
142 {ui::EF_NUMPAD_KEY, Mod2Mask}, | 141 {ui::EF_NUMPAD_KEY, Mod2Mask}, |
143 {ui::EF_LEFT_MOUSE_BUTTON, Button1Mask}, | 142 {ui::EF_LEFT_MOUSE_BUTTON, Button1Mask}, |
144 {ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask}, | 143 {ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask}, |
145 {ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask}, | 144 {ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask}, |
146 }; | 145 }; |
147 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) { | 146 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(flags); ++i) { |
148 if (ui_flags & flags[i].ui) | 147 if (ui_flags & flags[i].ui) |
149 *x_flags |= flags[i].x; | 148 *x_flags |= flags[i].x; |
150 else | 149 else |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 | 757 |
759 XIFreeDeviceInfo(device_info); | 758 XIFreeDeviceInfo(device_info); |
760 } | 759 } |
761 | 760 |
762 void EventRewriter::DeviceRemoved(int device_id) { | 761 void EventRewriter::DeviceRemoved(int device_id) { |
763 device_id_to_type_.erase(device_id); | 762 device_id_to_type_.erase(device_id); |
764 } | 763 } |
765 #endif | 764 #endif |
766 | 765 |
767 } // namespace chromeos | 766 } // namespace chromeos |
OLD | NEW |