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 "ui/aura/remote_window_tree_host_win.h" | 5 #include "ui/aura/remote_window_tree_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 // Sets the keyboard states for the Shift/Control/Alt/Caps lock keys. | 48 // Sets the keyboard states for the Shift/Control/Alt/Caps lock keys. |
49 void SetVirtualKeyStates(uint32_t flags) { | 49 void SetVirtualKeyStates(uint32_t flags) { |
50 uint8_t keyboard_state[256] = {0}; | 50 uint8_t keyboard_state[256] = {0}; |
51 ::GetKeyboardState(keyboard_state); | 51 ::GetKeyboardState(keyboard_state); |
52 | 52 |
53 SetKeyState(keyboard_state, !!(flags & ui::EF_SHIFT_DOWN), VK_SHIFT); | 53 SetKeyState(keyboard_state, !!(flags & ui::EF_SHIFT_DOWN), VK_SHIFT); |
54 SetKeyState(keyboard_state, !!(flags & ui::EF_CONTROL_DOWN), VK_CONTROL); | 54 SetKeyState(keyboard_state, !!(flags & ui::EF_CONTROL_DOWN), VK_CONTROL); |
55 SetKeyState(keyboard_state, !!(flags & ui::EF_ALT_DOWN), VK_MENU); | 55 SetKeyState(keyboard_state, !!(flags & ui::EF_ALT_DOWN), VK_MENU); |
56 SetKeyState(keyboard_state, !!(flags & ui::EF_CAPS_LOCK_DOWN), VK_CAPITAL); | 56 SetKeyState(keyboard_state, !!(flags & ui::EF_CAPS_LOCK_ON), VK_CAPITAL); |
57 SetKeyState(keyboard_state, !!(flags & ui::EF_LEFT_MOUSE_BUTTON), VK_LBUTTON); | 57 SetKeyState(keyboard_state, !!(flags & ui::EF_LEFT_MOUSE_BUTTON), VK_LBUTTON); |
58 SetKeyState(keyboard_state, !!(flags & ui::EF_RIGHT_MOUSE_BUTTON), | 58 SetKeyState(keyboard_state, !!(flags & ui::EF_RIGHT_MOUSE_BUTTON), |
59 VK_RBUTTON); | 59 VK_RBUTTON); |
60 SetKeyState(keyboard_state, !!(flags & ui::EF_MIDDLE_MOUSE_BUTTON), | 60 SetKeyState(keyboard_state, !!(flags & ui::EF_MIDDLE_MOUSE_BUTTON), |
61 VK_MBUTTON); | 61 VK_MBUTTON); |
62 | 62 |
63 ::SetKeyboardState(keyboard_state); | 63 ::SetKeyboardState(keyboard_state); |
64 } | 64 } |
65 | 65 |
66 void FillCompositionText( | 66 void FillCompositionText( |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } | 513 } |
514 | 514 |
515 void RemoteWindowTreeHostWin::SetEventFlags(uint32_t flags) { | 515 void RemoteWindowTreeHostWin::SetEventFlags(uint32_t flags) { |
516 if (flags == event_flags_) | 516 if (flags == event_flags_) |
517 return; | 517 return; |
518 event_flags_ = flags; | 518 event_flags_ = flags; |
519 SetVirtualKeyStates(event_flags_); | 519 SetVirtualKeyStates(event_flags_); |
520 } | 520 } |
521 | 521 |
522 } // namespace aura | 522 } // namespace aura |
OLD | NEW |