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

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

Issue 929053004: [KeyboardEvent] Add embedder APIs to translate between Dom |key| enum and strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments 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 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 if (!IsControlDown() && native_event()) { 811 character_ = (IsControlDown() || !native_event()) ?
812 character_ = GetCharacterFromXEvent(native_event()); 812 GetCharacterFromKeyCode(key_code_, flags()) :
813 // TODO(kpschoedel): set key_ field for X11. 813 GetCharacterFromXEvent(native_event());
814 return; 814 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
815 }
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()) {
824 DCHECK(EventTypeFromNative(native_event()) == ET_KEY_PRESSED || 823 DCHECK(EventTypeFromNative(native_event()) == ET_KEY_PRESSED ||
825 EventTypeFromNative(native_event()) == ET_KEY_RELEASED); 824 EventTypeFromNative(native_event()) == ET_KEY_RELEASED);
(...skipping 183 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
« content/child/blink_platform_impl.h ('K') | « content/shell/renderer/test_runner/event_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698