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

Side by Side Diff: ui/events/event.cc

Issue 954943003: [KeyboardEvent] Use DOM |code| rather than Windows-based key code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/BUILD.gn ('k') | ui/events/events.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/events/event.h" 5 #include "ui/events/event.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/keysym.h> 9 #include <X11/keysym.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 KeyboardCode dummy_key_code; 801 KeyboardCode dummy_key_code;
802 #if defined(OS_WIN) 802 #if defined(OS_WIN)
803 // Native Windows character events always have is_char_ == true, 803 // Native Windows character events always have is_char_ == true,
804 // so this is a synthetic or native keystroke event. 804 // so this is a synthetic or native keystroke event.
805 // Therefore, perform only the fallback action. 805 // Therefore, perform only the fallback action.
806 #elif defined(USE_X11) 806 #elif defined(USE_X11)
807 // When a control key is held, prefer ASCII characters to non ASCII 807 // When a control key is held, prefer ASCII characters to non ASCII
808 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode 808 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode
809 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. 809 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11.
810 // GetCharacterFromXEvent returns 'à' in that case. 810 // GetCharacterFromXEvent returns 'à' in that case.
811
811 if (!IsControlDown() && native_event()) { 812 if (!IsControlDown() && native_event()) {
812 character_ = GetCharacterFromXEvent(native_event()); 813 character_ = GetCharacterFromXEvent(native_event());
813 // TODO(kpschoedel): set key_ field for X11. 814 // TODO(kpschoedel): set key_ field for X11.
814 return; 815 return;
815 } 816 }
816 #elif defined(USE_OZONE) 817 #elif defined(USE_OZONE)
817 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( 818 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
818 code, flags(), &key_, &character_, &dummy_key_code, 819 code, flags(), &key_, &character_, &dummy_key_code,
819 &platform_keycode_)) { 820 &platform_keycode_)) {
820 return; 821 return;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 gfx::PointF(x, y), 1010 gfx::PointF(x, y),
1010 time_stamp, 1011 time_stamp,
1011 flags | EF_FROM_TOUCH), 1012 flags | EF_FROM_TOUCH),
1012 details_(details) { 1013 details_(details) {
1013 } 1014 }
1014 1015
1015 GestureEvent::~GestureEvent() { 1016 GestureEvent::~GestureEvent() {
1016 } 1017 }
1017 1018
1018 } // namespace ui 1019 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/BUILD.gn ('k') | ui/events/events.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698