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

Unified Diff: chrome/browser/cocoa/chrome_event_processing_window.mm

Issue 503080: Make cmd-{/} shortcut keys work on any keyboard layouts on Mac (Closed)
Patch Set: rename fix Created 10 years, 12 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 | « chrome/browser/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/global_keyboard_shortcuts_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/chrome_event_processing_window.mm
diff --git a/chrome/browser/cocoa/chrome_event_processing_window.mm b/chrome/browser/cocoa/chrome_event_processing_window.mm
index b5c43e0496fa21a1a8b91d279aa6c99cc840b24f..36fea38c81e89a3c8f622daef908f57e04659875 100644
--- a/chrome/browser/cocoa/chrome_event_processing_window.mm
+++ b/chrome/browser/cocoa/chrome_event_processing_window.mm
@@ -11,7 +11,7 @@
#import "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "chrome/browser/global_keyboard_shortcuts_mac.h"
-typedef int (*KeyToCommandMapper)(bool, bool, bool, bool, int);
+typedef int (*KeyToCommandMapper)(bool, bool, bool, bool, int, unichar);
@implementation ChromeEventProcessingWindow
@@ -23,10 +23,11 @@ typedef int (*KeyToCommandMapper)(bool, bool, bool, bool, int);
const bool shiftKey = modifers & NSShiftKeyMask;
const bool cntrlKey = modifers & NSControlKeyMask;
const bool optKey = modifers & NSAlternateKeyMask;
- const int keyCode = [event keyCode];
+ const unichar keyCode = [event keyCode];
+ const unichar keyChar = KeyCharacterForEvent(event);
int cmdNum = commandForKeyboardShortcut(cmdKey, shiftKey, cntrlKey, optKey,
- keyCode);
+ keyCode, keyChar);
if (cmdNum != -1) {
id executor = [self delegate];
« no previous file with comments | « chrome/browser/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/global_keyboard_shortcuts_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698