OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/global_keyboard_shortcuts_mac.h" | 5 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const KeyboardShortcutData* GetBrowserKeyboardShortcutTable( | 99 const KeyboardShortcutData* GetBrowserKeyboardShortcutTable( |
100 size_t* num_entries) { | 100 size_t* num_entries) { |
101 static const KeyboardShortcutData keyboard_shortcuts[] = { | 101 static const KeyboardShortcutData keyboard_shortcuts[] = { |
102 //cmd shift cntrl option | 102 //cmd shift cntrl option |
103 //--- ----- ----- ------ | 103 //--- ----- ----- ------ |
104 {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK}, | 104 {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK}, |
105 {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD}, | 105 {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD}, |
106 {false, false, false, false, kVK_Delete, 0, IDC_BACK}, | 106 {false, false, false, false, kVK_Delete, 0, IDC_BACK}, |
107 {false, true, false, false, kVK_Delete, 0, IDC_FORWARD}, | 107 {false, true, false, false, kVK_Delete, 0, IDC_FORWARD}, |
108 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, | 108 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, |
| 109 {true, true, false, false, kVK_ANSI_Period, 0, |
| 110 IDC_TOGGLE_SPEECH_INPUT}, |
109 }; | 111 }; |
110 | 112 |
111 *num_entries = arraysize(keyboard_shortcuts); | 113 *num_entries = arraysize(keyboard_shortcuts); |
112 | 114 |
113 return keyboard_shortcuts; | 115 return keyboard_shortcuts; |
114 } | 116 } |
115 | 117 |
116 static bool MatchesEventForKeyboardShortcut( | 118 static bool MatchesEventForKeyboardShortcut( |
117 const KeyboardShortcutData& shortcut, | 119 const KeyboardShortcutData& shortcut, |
118 bool command_key, bool shift_key, bool cntrl_key, bool opt_key, | 120 bool command_key, bool shift_key, bool cntrl_key, bool opt_key, |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 292 } |
291 } | 293 } |
292 | 294 |
293 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). | 295 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). |
294 if ([event modifierFlags] & NSAlternateKeyMask) | 296 if ([event modifierFlags] & NSAlternateKeyMask) |
295 return rawChar; | 297 return rawChar; |
296 } | 298 } |
297 | 299 |
298 return noModifiersChar; | 300 return noModifiersChar; |
299 } | 301 } |
OLD | NEW |