Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |