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

Unified Diff: ui/events/keycodes/keyboard_code_conversion_mac.mm

Issue 2309253006: [Mac] Map ContextMenu key to corresponding DomKey and keyCode (Closed)
Patch Set: dtapuska's review, remove unnecessary debug info Created 4 years, 3 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 | « content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/keycodes/keyboard_code_conversion_mac.mm
diff --git a/ui/events/keycodes/keyboard_code_conversion_mac.mm b/ui/events/keycodes/keyboard_code_conversion_mac.mm
index febe56b2375f00f2e12a5c3d2771ff11081850bb..143f9b1f8314b86d9c80651820ef37032903c99f 100644
--- a/ui/events/keycodes/keyboard_code_conversion_mac.mm
+++ b/ui/events/keycodes/keyboard_code_conversion_mac.mm
@@ -20,6 +20,8 @@ namespace {
// This value is not defined but shows up as 0x36.
const int kVK_RightCommand = 0x36;
+// Context menu is not defined but shows up as 0x6E.
+const int kVK_ContextMenu = 0x6E;
// A struct to hold a Windows keycode to Mac virtual keycode mapping.
struct KeyCodeMap {
@@ -426,7 +428,7 @@ KeyboardCode KeyboardCodeFromKeyCode(unsigned short keyCode) {
/* 0x6B */ VKEY_F14,
/* 0x6C */ VKEY_UNKNOWN, // n/a
/* 0x6D */ VKEY_F10,
- /* 0x6E */ VKEY_UNKNOWN, // n/a (Windows95 key?)
+ /* 0x6E */ VKEY_APPS, // Context Menu key
/* 0x6F */ VKEY_F12,
/* 0x70 */ VKEY_UNKNOWN, // n/a
/* 0x71 */ VKEY_F15,
@@ -545,6 +547,8 @@ DomKey DomKeyFromKeyCode(unsigned short keyCode) {
return DomKey::ARROW_DOWN;
case kVK_UpArrow:
return DomKey::ARROW_UP;
+ case kVK_ContextMenu:
+ return DomKey::CONTEXT_MENU;
default:
return DomKey::NONE;
}
« no previous file with comments | « content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698