OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/client/normalizing_input_filter_mac.h" | 5 #include "remoting/client/normalizing_input_filter_mac.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 bool is_special_key = | 29 bool is_special_key = |
30 dom_code == ui::DomCode::CONTROL_LEFT || | 30 dom_code == ui::DomCode::CONTROL_LEFT || |
31 dom_code == ui::DomCode::SHIFT_LEFT || | 31 dom_code == ui::DomCode::SHIFT_LEFT || |
32 dom_code == ui::DomCode::ALT_LEFT || | 32 dom_code == ui::DomCode::ALT_LEFT || |
33 dom_code == ui::DomCode::CONTROL_RIGHT || | 33 dom_code == ui::DomCode::CONTROL_RIGHT || |
34 dom_code == ui::DomCode::SHIFT_RIGHT || | 34 dom_code == ui::DomCode::SHIFT_RIGHT || |
35 dom_code == ui::DomCode::ALT_RIGHT || | 35 dom_code == ui::DomCode::ALT_RIGHT || |
36 dom_code == ui::DomCode::TAB; | 36 dom_code == ui::DomCode::TAB; |
37 | 37 |
38 bool is_cmd_key = | 38 bool is_cmd_key = |
39 dom_code == ui::DomCode::OS_LEFT || | 39 dom_code == ui::DomCode::META_LEFT || |
40 dom_code == ui::DomCode::OS_RIGHT; | 40 dom_code == ui::DomCode::META_RIGHT; |
41 | 41 |
42 if (dom_code == ui::DomCode::CAPS_LOCK) { | 42 if (dom_code == ui::DomCode::CAPS_LOCK) { |
43 // Mac OS X generates keydown/keyup on lock-state transitions, rather than | 43 // Mac OS X generates keydown/keyup on lock-state transitions, rather than |
44 // when the key is pressed & released, so fake keydown/keyup on each event. | 44 // when the key is pressed & released, so fake keydown/keyup on each event. |
45 protocol::KeyEvent newEvent(event); | 45 protocol::KeyEvent newEvent(event); |
46 | 46 |
47 newEvent.set_pressed(true); | 47 newEvent.set_pressed(true); |
48 InputFilter::InjectKeyEvent(newEvent); | 48 InputFilter::InjectKeyEvent(newEvent); |
49 newEvent.set_pressed(false); | 49 newEvent.set_pressed(false); |
50 InputFilter::InjectKeyEvent(newEvent); | 50 InputFilter::InjectKeyEvent(newEvent); |
(...skipping 26 matching lines...) Expand all Loading... |
77 protocol::KeyEvent event = i->second; | 77 protocol::KeyEvent event = i->second; |
78 event.set_pressed(false); | 78 event.set_pressed(false); |
79 InputFilter::InjectKeyEvent(event); | 79 InputFilter::InjectKeyEvent(event); |
80 } | 80 } |
81 | 81 |
82 // Clearing the map now that we have released all the pressed keys. | 82 // Clearing the map now that we have released all the pressed keys. |
83 key_pressed_map_.clear(); | 83 key_pressed_map_.clear(); |
84 } | 84 } |
85 | 85 |
86 } // namespace remoting | 86 } // namespace remoting |
OLD | NEW |