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/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <X11/keysym.h> | 10 #include <X11/keysym.h> |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
742 return *this; | 742 return *this; |
743 } | 743 } |
744 | 744 |
745 KeyEvent::~KeyEvent() {} | 745 KeyEvent::~KeyEvent() {} |
746 | 746 |
747 void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) { | 747 void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) { |
748 extended_key_event_data_ = data.Pass(); | 748 extended_key_event_data_ = data.Pass(); |
749 } | 749 } |
750 | 750 |
751 void KeyEvent::ApplyLayout() const { | 751 void KeyEvent::ApplyLayout() const { |
752 // If the client has set the character (e.g. faked key events from virtual | |
753 // keyboard), it's client's responsibility to set the dom key correctly. | |
754 // Otherwise, set the dom key as unidentified. | |
755 // Please refer to crbug.com/443889. | |
756 if (character_ != 0) { | |
757 key_ = DomKey::UNIDENTIFIED; | |
Shu Chen
2014/12/19 08:29:21
Not sure whether it's more appropriate to set as D
kpschoedel
2014/12/19 16:08:51
UNIDENTIFIED is fine for this CL, as it is defined
| |
758 return; | |
759 } | |
752 #if defined(OS_WIN) | 760 #if defined(OS_WIN) |
753 // Native Windows character events always have is_char_ == true, | 761 // Native Windows character events always have is_char_ == true, |
754 // so this is a synthetic or native keystroke event. | 762 // so this is a synthetic or native keystroke event. |
755 // Therefore, perform only the fallback action. | 763 // Therefore, perform only the fallback action. |
756 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_); | 764 GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_); |
757 #elif defined(USE_X11) | 765 #elif defined(USE_X11) |
758 // When a control key is held, prefer ASCII characters to non ASCII | 766 // When a control key is held, prefer ASCII characters to non ASCII |
759 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode | 767 // characters in order to use it for shortcut keys. GetCharacterFromKeyCode |
760 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. | 768 // returns 'a' for VKEY_A even if the key is actually bound to 'à' in X11. |
761 // GetCharacterFromXEvent returns 'à' in that case. | 769 // GetCharacterFromXEvent returns 'à' in that case. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1025 gfx::PointF(x, y), | 1033 gfx::PointF(x, y), |
1026 time_stamp, | 1034 time_stamp, |
1027 flags | EF_FROM_TOUCH), | 1035 flags | EF_FROM_TOUCH), |
1028 details_(details) { | 1036 details_(details) { |
1029 } | 1037 } |
1030 | 1038 |
1031 GestureEvent::~GestureEvent() { | 1039 GestureEvent::~GestureEvent() { |
1032 } | 1040 } |
1033 | 1041 |
1034 } // namespace ui | 1042 } // namespace ui |
OLD | NEW |