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

Unified Diff: chrome/views/accelerator.cc

Issue 28121: Do not map virtual keycodes (VK_0 - VK_9) to characters when accelerators in ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/accelerator.cc
===================================================================
--- chrome/views/accelerator.cc (revision 10268)
+++ chrome/views/accelerator.cc (working copy)
@@ -52,7 +52,15 @@
std::wstring shortcut;
if (!string_id) {
// Our fallback is to try translate the key code to a regular char.
- wchar_t key = LOWORD(::MapVirtualKeyW(key_code_, MAPVK_VK_TO_CHAR));
+ wchar_t key;
+ // Special-case digits. Some keyboard layouts (e.g. French)
+ // have characters other than digits assigned in an unshifted mode.
+ // For display in the menu (e.g. Ctrl-0 for the default zoom level), we
+ // still want to show digits.
+ if (key_code_ >= '0' && key_code_ <= '9')
+ key = key_code_;
+ else
+ key = LOWORD(::MapVirtualKeyW(key_code_, MAPVK_VK_TO_CHAR));
shortcut += key;
} else {
shortcut = l10n_util::GetString(string_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698