diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 16:24:24 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 16:24:24 +0000 |
commit | b6b0ca4a70ad07fbd144068306b3f554cec60963 (patch) | |
tree | be2247f2428ebed157462c405d58132b27e9352f /chrome | |
parent | eb6c2e81d2f759712b05ab0bb444875c266330d3 (diff) | |
download | chromium_src-b6b0ca4a70ad07fbd144068306b3f554cec60963.zip chromium_src-b6b0ca4a70ad07fbd144068306b3f554cec60963.tar.gz chromium_src-b6b0ca4a70ad07fbd144068306b3f554cec60963.tar.bz2 |
Switch to using vkey constants rather than hardcoded decimal values
BUG=none
TEST=switching tabs via key combos should still work.
Review URL: http://codereview.chromium.org/209031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/global_keyboard_shortcuts_mac.mm | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/chrome/browser/global_keyboard_shortcuts_mac.mm b/chrome/browser/global_keyboard_shortcuts_mac.mm index ab23695..63982ef 100644 --- a/chrome/browser/global_keyboard_shortcuts_mac.mm +++ b/chrome/browser/global_keyboard_shortcuts_mac.mm @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <Carbon/Carbon.h> + #include "chrome/browser/global_keyboard_shortcuts_mac.h" #include "base/basictypes.h" @@ -9,23 +11,27 @@ const KeyboardShortcutData* GetKeyboardShortCutTable(size_t* num_entries) { static const KeyboardShortcutData keyboard_shortcuts[] = { - {true, true, false, 30 /* ] */, IDC_SELECT_NEXT_TAB}, - {false, false, true, 121 /* pg down */, IDC_SELECT_NEXT_TAB}, - {false, false, true, 48 /* tab */, IDC_SELECT_NEXT_TAB}, - {true, true, false, 33 /* [ */, IDC_SELECT_PREVIOUS_TAB}, - {false, false, true, 116 /* pg_up */, IDC_SELECT_PREVIOUS_TAB}, - {false, true, true, 48 /* tab */, IDC_SELECT_PREVIOUS_TAB}, - // Cmd-0..8 select the Nth tab, with cmd-9 being "last tab". Note that the - // vkeys are *not* in natural order. - {true, false, false, 18 /* 1 */, IDC_SELECT_TAB_0}, - {true, false, false, 19 /* 2 */, IDC_SELECT_TAB_1}, - {true, false, false, 20 /* 3 */, IDC_SELECT_TAB_2}, - {true, false, false, 21 /* 4 */, IDC_SELECT_TAB_3}, - {true, false, false, 23 /* 5 */, IDC_SELECT_TAB_4}, - {true, false, false, 22 /* 6 */, IDC_SELECT_TAB_5}, - {true, false, false, 26 /* 7 */, IDC_SELECT_TAB_6}, - {true, false, false, 28 /* 8 */, IDC_SELECT_TAB_7}, - {true, false, false, 25 /* 9 */, IDC_SELECT_LAST_TAB}, + {true, true, false, kVK_ANSI_RightBracket, IDC_SELECT_NEXT_TAB}, + {false, false, true, kVK_PageDown, IDC_SELECT_NEXT_TAB}, + {false, false, true, kVK_Tab, IDC_SELECT_NEXT_TAB}, + {true, true, false, kVK_ANSI_LeftBracket, IDC_SELECT_PREVIOUS_TAB}, + {false, false, true, kVK_PageUp, IDC_SELECT_PREVIOUS_TAB}, + {false, true, true, kVK_Tab, IDC_SELECT_PREVIOUS_TAB}, + // Cmd-0..8 select the Nth tab, with cmd-9 being "last tab". + {true, false, false, kVK_ANSI_1, IDC_SELECT_TAB_0}, + {true, false, false, kVK_ANSI_2, IDC_SELECT_TAB_1}, + {true, false, false, kVK_ANSI_3, IDC_SELECT_TAB_2}, + {true, false, false, kVK_ANSI_4, IDC_SELECT_TAB_3}, + {true, false, false, kVK_ANSI_5, IDC_SELECT_TAB_4}, + {true, false, false, kVK_ANSI_6, IDC_SELECT_TAB_5}, + {true, false, false, kVK_ANSI_7, IDC_SELECT_TAB_6}, + {true, false, false, kVK_ANSI_8, IDC_SELECT_TAB_7}, + {true, false, false, kVK_ANSI_9, IDC_SELECT_LAST_TAB}, + // TODO(pinkerton): These can't live here yet, they need to be plumbed + // through the renderer first so it can override if in a text field. + // http://crbug.com/12557 + // {true, false, false, kVK_LeftArrow, IDC_BACK}, + // {true, false, false, kVK_RightArrow, IDC_FORWARD}, }; *num_entries = arraysize(keyboard_shortcuts); |