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

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

Issue 1103263004: Set ui::KeyEvent::key_ (DOM Level 3 key) under X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments (wez@) 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
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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 #if defined(OS_WIN) 798 #if defined(OS_WIN)
799 // Native Windows character events always have is_char_ == true, 799 // Native Windows character events always have is_char_ == true,
800 // so this is a synthetic or native keystroke event. 800 // so this is a synthetic or native keystroke event.
801 // Therefore, perform only the fallback action. 801 // Therefore, perform only the fallback action.
802 #elif defined(USE_X11) 802 #elif defined(USE_X11)
803 // When a control key is held, prefer ASCII characters to non ASCII 803 // When a control key is held, prefer ASCII characters to non ASCII
804 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode 804 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode
805 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. 805 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11.
806 // GetCharacterFromXEvent returns 'à' in that case. 806 // GetCharacterFromXEvent returns 'à' in that case.
807 if (!IsControlDown() && native_event()) { 807 if (!IsControlDown() && native_event()) {
808 character_ = GetCharacterFromXEvent(native_event()); 808 GetMeaningFromXEvent(native_event(), &key_, &character_);
809 // TODO(kpschoedel): set key_ field for X11.
810 return; 809 return;
811 } 810 }
812 #elif defined(USE_OZONE) 811 #elif defined(USE_OZONE)
813 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( 812 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
814 code, flags(), &key_, &character_, &dummy_key_code, 813 code, flags(), &key_, &character_, &dummy_key_code,
815 &platform_keycode_)) { 814 &platform_keycode_)) {
816 return; 815 return;
817 } 816 }
818 #else 817 #else
819 if (native_event()) { 818 if (native_event()) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 gfx::PointF(x, y), 1004 gfx::PointF(x, y),
1006 time_stamp, 1005 time_stamp,
1007 flags | EF_FROM_TOUCH), 1006 flags | EF_FROM_TOUCH),
1008 details_(details) { 1007 details_(details) {
1009 } 1008 }
1010 1009
1011 GestureEvent::~GestureEvent() { 1010 GestureEvent::~GestureEvent() {
1012 } 1011 }
1013 1012
1014 } // namespace ui 1013 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698