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

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: "API has been updated on the blink side" Created 5 years, 9 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 // Therefore, perform only the fallback action. 781 // Therefore, perform only the fallback action.
782 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_); 782 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
783 #elif defined(USE_X11) 783 #elif defined(USE_X11)
784 // When a control key is held, prefer ASCII characters to non ASCII 784 // When a control key is held, prefer ASCII characters to non ASCII
785 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode 785 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode
786 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. 786 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11.
787 // GetCharacterFromXEvent returns 'à' in that case. 787 // GetCharacterFromXEvent returns 'à' in that case.
788 character_ = (IsControlDown() || !native_event()) ? 788 character_ = (IsControlDown() || !native_event()) ?
789 GetCharacterFromKeyCode(key_code_, flags()) : 789 GetCharacterFromKeyCode(key_code_, flags()) :
790 GetCharacterFromXEvent(native_event()); 790 GetCharacterFromXEvent(native_event());
791 // TODO(kpschoedel): set key_ field for X11. 791 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
Wez 2015/04/21 02:25:58 Not sure what you're trying to do here. GetMeaning
Habib Virji 2015/04/29 16:05:18 There was a following CL: 954943003 that was tryin
792 #elif defined(USE_OZONE) 792 #elif defined(USE_OZONE)
793 KeyboardCode key_code; 793 KeyboardCode key_code;
794 if (!KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup( 794 if (!KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
795 code_, flags(), &key_, &character_, &key_code, &platform_keycode_)) { 795 code_, flags(), &key_, &character_, &key_code, &platform_keycode_)) {
796 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_); 796 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
797 } 797 }
798 #else 798 #else
799 if (native_event()) { 799 if (native_event()) {
800 DCHECK(EventTypeFromNative(native_event()) == ET_KEY_PRESSED || 800 DCHECK(EventTypeFromNative(native_event()) == ET_KEY_PRESSED ||
801 EventTypeFromNative(native_event()) == ET_KEY_RELEASED); 801 EventTypeFromNative(native_event()) == ET_KEY_RELEASED);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 gfx::PointF(x, y), 981 gfx::PointF(x, y),
982 time_stamp, 982 time_stamp,
983 flags | EF_FROM_TOUCH), 983 flags | EF_FROM_TOUCH),
984 details_(details) { 984 details_(details) {
985 } 985 }
986 986
987 GestureEvent::~GestureEvent() { 987 GestureEvent::~GestureEvent() {
988 } 988 }
989 989
990 } // namespace ui 990 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698