ForwardedInputEventHandler.js 732 B

1234
  1. export default class ForwardedInputEventHandler{constructor(){Host.InspectorFrontendHost.events.addEventListener(Host.InspectorFrontendHostAPI.Events.KeyEventUnhandled,this._onKeyEventUnhandled,this);}
  2. _onKeyEventUnhandled(event){const data=event.data;const type=(data.type);const key=(data.key);const keyCode=(data.keyCode);const modifiers=(data.modifiers);if(type!=='keydown'){return;}
  3. UI.context.setFlavor(UI.ShortcutRegistry.ForwardedShortcut,UI.ShortcutRegistry.ForwardedShortcut.instance);UI.shortcutRegistry.handleKey(UI.KeyboardShortcut.makeKey(keyCode,modifiers),key);UI.context.setFlavor(UI.ShortcutRegistry.ForwardedShortcut,null);}}
  4. self.UI=self.UI||{};UI=UI||{};UI.ForwardedInputEventHandler=ForwardedInputEventHandler;