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

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: 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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (!IsControlDown() && native_event()) { 811 if (!IsControlDown() && native_event()) {
812 character_ = GetCharacterFromXEvent(native_event()); 812 GetMeaningFromXEvent(native_event(), &key_, &character_);
813 // TODO(kpschoedel): set key_ field for X11.
814 return; 813 return;
815 } 814 }
816 #elif defined(USE_OZONE) 815 #elif defined(USE_OZONE)
817 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( 816 if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
818 code, flags(), &key_, &character_, &dummy_key_code, 817 code, flags(), &key_, &character_, &dummy_key_code,
819 &platform_keycode_)) { 818 &platform_keycode_)) {
820 return; 819 return;
821 } 820 }
822 #else 821 #else
823 if (native_event()) { 822 if (native_event()) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 gfx::PointF(x, y), 1008 gfx::PointF(x, y),
1010 time_stamp, 1009 time_stamp,
1011 flags | EF_FROM_TOUCH), 1010 flags | EF_FROM_TOUCH),
1012 details_(details) { 1011 details_(details) {
1013 } 1012 }
1014 1013
1015 GestureEvent::~GestureEvent() { 1014 GestureEvent::~GestureEvent() {
1016 } 1015 }
1017 1016
1018 } // namespace ui 1017 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698