diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/devtools/front_end/ForwardedInputEventHandler.js')
-rw-r--r-- | chromium/third_party/WebKit/Source/devtools/front_end/ForwardedInputEventHandler.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/devtools/front_end/ForwardedInputEventHandler.js b/chromium/third_party/WebKit/Source/devtools/front_end/ForwardedInputEventHandler.js new file mode 100644 index 00000000000..93cc2569029 --- /dev/null +++ b/chromium/third_party/WebKit/Source/devtools/front_end/ForwardedInputEventHandler.js @@ -0,0 +1,31 @@ +// Copyright 2014 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. + +/** + * @constructor + */ +WebInspector.ForwardedInputEventHandler = function() +{ +} + +WebInspector.ForwardedInputEventHandler.prototype = { + /** + * @param {string} type + * @param {string} keyIdentifier + * @param {number} keyCode + * @param {number} modifiers + */ + keyEventReceived: function(type, keyIdentifier, keyCode, modifiers) + { + if (type !== "keydown") + return; + + WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut, WebInspector.ShortcutRegistry.ForwardedShortcut.instance) + WebInspector.shortcutRegistry.handleKey(WebInspector.KeyboardShortcut.makeKey(keyCode, modifiers), keyIdentifier); + WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut, null); + } +} + +/** @type {!WebInspector.ForwardedInputEventHandler} */ +WebInspector.forwardedEventHandler = new WebInspector.ForwardedInputEventHandler(); |