Uh oh!
There was an error while loading. Please reload this page.
Listen for some hotkeys on form fields #85
Answered
bykeithamus
sethhorsley
asked this question in
Q&A
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How doees github listen for all command palette hotkeys |
Answered by
keithamus
Mar 6, 2023
Replies: 1 comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In cases where we need a global shortcut that will work in all inputs, we use manual event listeners. The code might look a bit like: import{eventToHotkeyString}from'@github/hotkey'constGLOBAL_HOTKEY='Cmd+K'document.addEventListener('keydown',(event)=>{lethotkeyString=eventToHotkeyString(event)if(!hotkeyString)returnif(hotkeyString!==GLOBAL_HOTKEY)returnrunGlobalHotkeyCommand()}) |
0 replies
Answer selected bykeithamus
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
In cases where we need a global shortcut that will work in all inputs, we use manual event listeners. The code might look a bit like: