Chromium Code Reviews| 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 "remoting/client/plugin/pepper_input_handler.h" | 5 #include "remoting/client/plugin/pepper_input_handler.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ppapi/cpp/input_event.h" | 10 #include "ppapi/cpp/input_event.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 // We need to return true here or else we'll get a local (plugin) context | 28 // We need to return true here or else we'll get a local (plugin) context |
| 29 // menu instead of the mouseup event for the right click. | 29 // menu instead of the mouseup event for the right click. |
| 30 return true; | 30 return true; |
| 31 } | 31 } |
| 32 | 32 |
| 33 case PP_INPUTEVENT_TYPE_KEYDOWN: | 33 case PP_INPUTEVENT_TYPE_KEYDOWN: |
| 34 case PP_INPUTEVENT_TYPE_KEYUP: { | 34 case PP_INPUTEVENT_TYPE_KEYUP: { |
| 35 pp::KeyboardInputEvent pp_key_event(event); | 35 pp::KeyboardInputEvent pp_key_event(event); |
| 36 protocol::KeyEvent key_event; | 36 protocol::KeyEvent key_event; |
| 37 | 37 |
| 38 // TODO(garykac): Switch to use |pp_key_event.GetUsbScanCode()|. | |
|
Wez
2012/02/17 01:31:01
I don't think this comment belongs in this CL?
garykac
2012/02/17 18:25:30
Done.
| |
| 38 key_event.set_keycode(pp_key_event.GetKeyCode()); | 39 key_event.set_keycode(pp_key_event.GetKeyCode()); |
| 39 key_event.set_pressed(event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN); | 40 key_event.set_pressed(event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN); |
| 40 | 41 |
| 41 // Dump the modifiers associated with each ESC key release event | 42 // Dump the modifiers associated with each ESC key release event |
| 42 // to facilitate debugging of issues caused by mixed up modifiers. | 43 // to facilitate debugging of issues caused by mixed up modifiers. |
| 43 if ((pp_key_event.GetKeyCode() == ui::VKEY_ESCAPE) && | 44 if ((pp_key_event.GetKeyCode() == ui::VKEY_ESCAPE) && |
| 44 (event.GetType() == PP_INPUTEVENT_TYPE_KEYUP)) { | 45 (event.GetType() == PP_INPUTEVENT_TYPE_KEYUP)) { |
| 45 LOG(INFO) << "ESC released: modifiers=0x" | 46 LOG(INFO) << "ESC released: modifiers=0x" |
| 46 << std::hex << pp_key_event.GetModifiers() << std::dec; | 47 << std::hex << pp_key_event.GetModifiers() << std::dec; |
| 47 } | 48 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 default: { | 116 default: { |
| 116 LOG(INFO) << "Unhandled input event: " << event.GetType(); | 117 LOG(INFO) << "Unhandled input event: " << event.GetType(); |
| 117 break; | 118 break; |
| 118 } | 119 } |
| 119 } | 120 } |
| 120 | 121 |
| 121 return false; | 122 return false; |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // namespace remoting | 125 } // namespace remoting |
| OLD | NEW |