diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 14:59:06 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 14:59:06 +0000 |
commit | 3641da6c02910960ef419d38a161081a9ce1d7b2 (patch) | |
tree | 1123c9e72bc88275779d8e89060ed0cfe73cb172 /chrome/browser/global_keyboard_shortcuts_mac.h | |
parent | 73820078eac1040173047912c1f4d413a0eca696 (diff) | |
download | chromium_src-3641da6c02910960ef419d38a161081a9ce1d7b2.zip chromium_src-3641da6c02910960ef419d38a161081a9ce1d7b2.tar.gz chromium_src-3641da6c02910960ef419d38a161081a9ce1d7b2.tar.bz2 |
Add facitility for Global Keyboard shortcuts.
Also, do some housekeeping for our current shortcuts.
* Command-Option-l - Downloads [same shortcut as Safari].
* Command-Shift-[/] - Back/forward tab.
* cntrl-pageup/pagedn - Back/forward tab.
Global Keyboard events are intercepted by a new BrowserWindow custom class.
BUG=12537,15486
TEST=Check that above keyboard shortcuts work as advertised.
Review URL: http://codereview.chromium.org/149325
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/global_keyboard_shortcuts_mac.h')
-rw-r--r-- | chrome/browser/global_keyboard_shortcuts_mac.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/global_keyboard_shortcuts_mac.h b/chrome/browser/global_keyboard_shortcuts_mac.h new file mode 100644 index 0000000..45d9a69 --- /dev/null +++ b/chrome/browser/global_keyboard_shortcuts_mac.h @@ -0,0 +1,27 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_GLOBAL_KEYBOARD_SHORTCUTS_MAC_H_ +#define CHROME_BROWSER_GLOBAL_KEYBOARD_SHORTCUTS_MAC_H_ + +#include "base/basictypes.h"; + +struct KeyboardShortcutData { + bool command_key; + bool shift_key; + bool cntrl_key; + int vkey_code; // Virtual Key code for the command. + int chrome_command; // The chrome command # to execute for this shortcut. +}; + +// Check if a given keycode + modifiers correspond to a given Chrome command. +// returns: Command number (as passed to Browser::ExecuteCommand) or -1 if there +// was no match. +int CommandForKeyboardShortcut(bool command_key, bool shift_key, bool cntrl_key, + int vkey_code); + +// For testing purposes. +const KeyboardShortcutData* GetKeyboardShortCutTable(size_t* num_entries); + +#endif // #ifndef CHROME_BROWSER_GLOBAL_KEYBOARD_SHORTCUTS_MAC_H_ |