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

Side by Side Diff: ui/events/event.cc

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 years, 11 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 | « ui/events/event.h ('k') | ui/events/event_constants.h » ('j') | 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 #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
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
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
OLDNEW
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698