import{KeyboardShortcut}from'./KeyboardShortcut.js';import{ForwardedShortcut}from'./ShortcutRegistry.js';export 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(ForwardedShortcut,ForwardedShortcut.instance);UI.shortcutRegistry.handleKey(KeyboardShortcut.makeKey(keyCode,modifiers),key);UI.context.setFlavor(ForwardedShortcut,null);}}