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

Unified Diff: ui/events/x/events_x.cc

Issue 1135083004: Revert of Remove EF_FUNCTION_KEY and EF_NUMPAD_KEY. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/test/events_test_utils_x11.cc ('k') | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/events_x.cc
diff --git a/ui/events/x/events_x.cc b/ui/events/x/events_x.cc
index 9bf87c0e24c4e4b2a25aeedddf4d00b1340f4d0e..441aec529b079201084b513750218add7c60b4e3 100644
--- a/ui/events/x/events_x.cc
+++ b/ui/events/x/events_x.cc
@@ -191,6 +191,9 @@
return GetEventFlagsFromXState(xevent->xkey.state) |
(xevent->xkey.send_event ? ui::EF_FINAL : 0) |
+ (IsKeypadKey(XLookupKeysym(&xevent->xkey, 0)) ? ui::EF_NUMPAD_KEY : 0) |
+ (IsFunctionKey(XLookupKeysym(&xevent->xkey, 0)) ?
+ ui::EF_FUNCTION_KEY : 0) |
ime_fabricated_flag;
}
@@ -200,7 +203,11 @@
DCHECK((xievent->evtype == XI_KeyPress) ||
(xievent->evtype == XI_KeyRelease));
return GetEventFlagsFromXState(xievent->mods.effective) |
- (xevent->xkey.send_event ? ui::EF_FINAL : 0);
+ (xevent->xkey.send_event ? ui::EF_FINAL : 0) |
+ (IsKeypadKey(
+ XkbKeycodeToKeysym(xievent->display, xievent->detail, 0, 0))
+ ? ui::EF_NUMPAD_KEY
+ : 0);
}
// Get the event flag for the button in XButtonEvent. During a ButtonPress
@@ -301,6 +308,7 @@
{ui::EF_ALTGR_DOWN, Mod5Mask},
{ui::EF_COMMAND_DOWN, Mod4Mask},
{ui::EF_MOD3_DOWN, Mod3Mask},
+ {ui::EF_NUMPAD_KEY, Mod2Mask},
{ui::EF_LEFT_MOUSE_BUTTON, Button1Mask},
{ui::EF_MIDDLE_MOUSE_BUTTON, Button2Mask},
{ui::EF_RIGHT_MOUSE_BUTTON, Button3Mask},
« no previous file with comments | « ui/events/test/events_test_utils_x11.cc ('k') | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698