| 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 KeyEvent key_event( | 231 callback_.Run(make_scoped_ptr(new KeyEvent( |
| 232 down ? ET_KEY_PRESSED : ET_KEY_RELEASED, | 232 down ? ET_KEY_PRESSED : ET_KEY_RELEASED, |
| 233 code, | 233 code, |
| 234 KeycodeConverter::NativeKeycodeToCode(key + kXkbKeycodeOffset), | 234 KeycodeConverter::NativeKeycodeToCode(key + kXkbKeycodeOffset), |
| 235 flags); | 235 flags))); |
| 236 callback_.Run(&key_event); | |
| 237 } | 236 } |
| 238 | 237 |
| 239 } // namespace ui | 238 } // namespace ui |
| OLD | NEW |