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 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 bool KeyEvent::IsUnicodeKeyCode() const { | 865 bool KeyEvent::IsUnicodeKeyCode() const { |
866 #if defined(OS_WIN) | 866 #if defined(OS_WIN) |
867 if (!IsAltDown()) | 867 if (!IsAltDown()) |
868 return false; | 868 return false; |
869 const int key = key_code(); | 869 const int key = key_code(); |
870 if (key >= VKEY_NUMPAD0 && key <= VKEY_NUMPAD9) | 870 if (key >= VKEY_NUMPAD0 && key <= VKEY_NUMPAD9) |
871 return true; | 871 return true; |
872 // Check whether the user is using the numeric keypad with num-lock off. | 872 // Check whether the user is using the numeric keypad with num-lock off. |
873 // In that case, EF_EXTENDED will not be set; if it is set, the key event | 873 // In that case, EF_EXTENDED will not be set; if it is set, the key event |
874 // originated from the relevant non-numpad dedicated key, e.g. [Insert]. | 874 // originated from the relevant non-numpad dedicated key, e.g. [Insert]. |
875 return (!(flags() & EF_EXTENDED) && | 875 return (!(flags() & EF_IS_EXTENDED_KEY) && |
876 (key == VKEY_INSERT || key == VKEY_END || key == VKEY_DOWN || | 876 (key == VKEY_INSERT || key == VKEY_END || key == VKEY_DOWN || |
877 key == VKEY_NEXT || key == VKEY_LEFT || key == VKEY_CLEAR || | 877 key == VKEY_NEXT || key == VKEY_LEFT || key == VKEY_CLEAR || |
878 key == VKEY_RIGHT || key == VKEY_HOME || key == VKEY_UP || | 878 key == VKEY_RIGHT || key == VKEY_HOME || key == VKEY_UP || |
879 key == VKEY_PRIOR)); | 879 key == VKEY_PRIOR)); |
880 #else | 880 #else |
881 return false; | 881 return false; |
882 #endif | 882 #endif |
883 } | 883 } |
884 | 884 |
885 void KeyEvent::NormalizeFlags() { | 885 void KeyEvent::NormalizeFlags() { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 gfx::PointF(x, y), | 982 gfx::PointF(x, y), |
983 time_stamp, | 983 time_stamp, |
984 flags | EF_FROM_TOUCH), | 984 flags | EF_FROM_TOUCH), |
985 details_(details) { | 985 details_(details) { |
986 } | 986 } |
987 | 987 |
988 GestureEvent::~GestureEvent() { | 988 GestureEvent::~GestureEvent() { |
989 } | 989 } |
990 | 990 |
991 } // namespace ui | 991 } // namespace ui |
OLD | NEW |