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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 return keyboard_shortcuts; | 96 return keyboard_shortcuts; |
97 } | 97 } |
98 | 98 |
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_BACKSPACE_BACK}, |
| 107 {false, true, false, false, kVK_Delete, 0, IDC_BACKSPACE_FORWARD}, |
106 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, | 108 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, |
107 }; | 109 }; |
108 | 110 |
109 *num_entries = arraysize(keyboard_shortcuts); | 111 *num_entries = arraysize(keyboard_shortcuts); |
110 | 112 |
111 return keyboard_shortcuts; | 113 return keyboard_shortcuts; |
112 } | 114 } |
113 | 115 |
114 static bool MatchesEventForKeyboardShortcut( | 116 static bool MatchesEventForKeyboardShortcut( |
115 const KeyboardShortcutData& shortcut, | 117 const KeyboardShortcutData& shortcut, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 } | 290 } |
289 } | 291 } |
290 | 292 |
291 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). | 293 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). |
292 if ([event modifierFlags] & NSAlternateKeyMask) | 294 if ([event modifierFlags] & NSAlternateKeyMask) |
293 return rawChar; | 295 return rawChar; |
294 } | 296 } |
295 | 297 |
296 return noModifiersChar; | 298 return noModifiersChar; |
297 } | 299 } |
OLD | NEW |