OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 */ | 7 */ |
8 WebInspector.ForwardedInputEventHandler = function() | 8 WebInspector.ForwardedInputEventHandler = function() |
9 { | 9 { |
10 } | 10 } |
11 | 11 |
12 WebInspector.ForwardedInputEventHandler.prototype = { | 12 WebInspector.ForwardedInputEventHandler.prototype = { |
13 /** | 13 /** |
14 * @param {string} type | 14 * @param {string} type |
15 * @param {string} keyIdentifier | 15 * @param {string} keyIdentifier |
16 * @param {number} keyCode | 16 * @param {number} keyCode |
17 * @param {number} modifiers | 17 * @param {number} modifiers |
18 */ | 18 */ |
19 keyEventReceived: function(type, keyIdentifier, keyCode, modifiers) | 19 keyEventReceived: function(type, keyIdentifier, keyCode, modifiers) |
20 { | 20 { |
21 if (type !== "keydown") | 21 if (type !== "keydown") |
22 return; | 22 return; |
23 | 23 |
24 // FIXME: Wire this to the shortcut/action subsystem. | 24 WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedSh
ortcut, WebInspector.ShortcutRegistry.ForwardedShortcut.instance) |
25 if (keyIdentifier === "F8" && !modifiers) | |
26 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorVie
w.showPanel("sources")).togglePause(); | |
27 | |
28 WebInspector.shortcutRegistry.handleKey(WebInspector.KeyboardShortcut.ma
keKey(keyCode, modifiers), keyIdentifier); | 25 WebInspector.shortcutRegistry.handleKey(WebInspector.KeyboardShortcut.ma
keKey(keyCode, modifiers), keyIdentifier); |
| 26 WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedSh
ortcut, null); |
29 } | 27 } |
30 } | 28 } |
31 | 29 |
32 /** @type {!WebInspector.ForwardedInputEventHandler} */ | 30 /** @type {!WebInspector.ForwardedInputEventHandler} */ |
33 WebInspector.forwardedEventHandler = new WebInspector.ForwardedInputEventHandler
(); | 31 WebInspector.forwardedEventHandler = new WebInspector.ForwardedInputEventHandler
(); |
OLD | NEW |