Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1515)

Unified Diff: Source/devtools/front_end/KeyboardShortcut.js

Issue 212573006: DevTools: Implement batch event forwarding from extension panels (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/ExtensionServer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/KeyboardShortcut.js
diff --git a/Source/devtools/front_end/KeyboardShortcut.js b/Source/devtools/front_end/KeyboardShortcut.js
index 6fd14f4b5db81ce6af97b811258c1a0da4a534fe..17897f032fe821b685b7456a4d4ffd452a67e3c1 100644
--- a/Source/devtools/front_end/KeyboardShortcut.js
+++ b/Source/devtools/front_end/KeyboardShortcut.js
@@ -147,7 +147,13 @@ WebInspector.KeyboardShortcut.makeKeyFromEvent = function(keyboardEvent)
modifiers |= WebInspector.KeyboardShortcut.Modifiers.Alt;
if (keyboardEvent.metaKey)
modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta;
- return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyboardEvent.keyCode, modifiers);
+
+ function keyCodeForEvent(keyboardEvent)
+ {
+ // Use either a real or a synthetic keyCode (for events originating from extensions).
+ return keyboardEvent.keyCode || keyboardEvent["__keyCode"];
+ }
+ return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCodeForEvent(keyboardEvent), modifiers);
}
/**
« no previous file with comments | « Source/devtools/front_end/ExtensionServer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698