Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: ui/events/ozone/evdev/keyboard_evdev.cc

Issue 668943003: ozone: evdev: Drop unmapped key events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698