1234 |
- export default class ForwardedInputEventHandler{constructor(){Host.InspectorFrontendHost.events.addEventListener(Host.InspectorFrontendHostAPI.Events.KeyEventUnhandled,this._onKeyEventUnhandled,this);}
- _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;}
- 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);}}
- self.UI=self.UI||{};UI=UI||{};UI.ForwardedInputEventHandler=ForwardedInputEventHandler;
|