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 "ui/events/ozone/evdev/keyboard_evdev.h" | 5 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
6 | 6 |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 #include "ui/events/keycodes/dom4/keycode_converter.h" | 8 #include "ui/events/keycodes/dom4/keycode_converter.h" |
9 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 9 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
10 | 10 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 if (locking) | 221 if (locking) |
222 modifiers_->UpdateModifierLock(modifier, down); | 222 modifiers_->UpdateModifierLock(modifier, down); |
223 else | 223 else |
224 modifiers_->UpdateModifier(modifier, down); | 224 modifiers_->UpdateModifier(modifier, down); |
225 } | 225 } |
226 | 226 |
227 void KeyboardEvdev::DispatchKey(unsigned int key, bool down) { | 227 void KeyboardEvdev::DispatchKey(unsigned int key, bool down) { |
228 ui::KeyboardCode code = KeyboardCodeFromEvdevKey(key); | 228 ui::KeyboardCode code = KeyboardCodeFromEvdevKey(key); |
229 int flags = modifiers_->GetModifierFlags(); | 229 int flags = modifiers_->GetModifierFlags(); |
230 | 230 |
| 231 if (code == VKEY_UNKNOWN) |
| 232 return; |
| 233 |
231 callback_.Run(make_scoped_ptr(new KeyEvent( | 234 callback_.Run(make_scoped_ptr(new KeyEvent( |
232 down ? ET_KEY_PRESSED : ET_KEY_RELEASED, | 235 down ? ET_KEY_PRESSED : ET_KEY_RELEASED, |
233 code, | 236 code, |
234 KeycodeConverter::NativeKeycodeToCode(key + kXkbKeycodeOffset), | 237 KeycodeConverter::NativeKeycodeToCode(key + kXkbKeycodeOffset), |
235 flags))); | 238 flags))); |
236 } | 239 } |
237 | 240 |
238 } // namespace ui | 241 } // namespace ui |
OLD | NEW |