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

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: Created 5 years, 10 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 | « content/shell/renderer/test_runner/event_sender.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 (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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 // Therefore, perform only the fallback action. 775 // Therefore, perform only the fallback action.
776 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_); 776 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
777 #elif defined(USE_X11) 777 #elif defined(USE_X11)
778 // When a control key is held, prefer ASCII characters to non ASCII 778 // When a control key is held, prefer ASCII characters to non ASCII
779 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode 779 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode
780 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. 780 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11.
781 // GetCharacterFromXEvent returns 'à' in that case. 781 // GetCharacterFromXEvent returns 'à' in that case.
782 character_ = (IsControlDown() || !native_event()) ? 782 character_ = (IsControlDown() || !native_event()) ?
783 GetCharacterFromKeyCode(key_code_, flags()) : 783 GetCharacterFromKeyCode(key_code_, flags()) :
784 GetCharacterFromXEvent(native_event()); 784 GetCharacterFromXEvent(native_event());
785 // TODO(kpschoedel): set key_ field for X11. 785 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
Wez 2015/02/20 00:00:30 GetMeaningFromKeyCode currently assumes a US Engli
Habib Virji 2015/02/23 10:10:05 I have started looking into enabling |key| attribu
786 #elif defined(USE_OZONE) 786 #elif defined(USE_OZONE)
787 KeyboardCode key_code; 787 KeyboardCode key_code;
788 if (!KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( 788 if (!KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
789 code_, flags(), &key_, &character_, &key_code, &platform_keycode_)) { 789 code_, flags(), &key_, &character_, &key_code, &platform_keycode_)) {
790 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_); 790 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
791 } 791 }
792 #else 792 #else
793 if (native_event()) { 793 if (native_event()) {
794 DCHECK(EventTypeFromNative(native_event()) == ET_KEY_PRESSED || 794 DCHECK(EventTypeFromNative(native_event()) == ET_KEY_PRESSED ||
795 EventTypeFromNative(native_event()) == ET_KEY_RELEASED); 795 EventTypeFromNative(native_event()) == ET_KEY_RELEASED);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 gfx::PointF(x, y), 976 gfx::PointF(x, y),
977 time_stamp, 977 time_stamp,
978 flags | EF_FROM_TOUCH), 978 flags | EF_FROM_TOUCH),
979 details_(details) { 979 details_(details) {
980 } 980 }
981 981
982 GestureEvent::~GestureEvent() { 982 GestureEvent::~GestureEvent() {
983 } 983 }
984 984
985 } // namespace ui 985 } // namespace ui
OLDNEW
« no previous file with comments | « 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