You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a chord C-h x for a command Regex find and replace. This chord is by convention as most text editors use C-h for find and replace, and the addition of the x invokes the optional regex find and replace. The chord UI accepts this definition and the chord works.
Create another chord C-h for command Global Search and Replace. When prompted to type the chord, your chord input doesn't accept C-h and acts like it's in read only mode.
Remove the C-h x chord.
Define the C-h chord first, it is accepted and works fine.
Try and define the C-h-x chord again. When prompted to type the chord, enter C-h x. As soon as you type the combo C-h, before you are able to type the x, the Global Search and Replace from the C-h chord is invoked and that prevents you from typing the complete C-h x chord.
Advice
I haven't properly reviewed your code yet as it's too untidy for me this early in the morning, but separate classes should be placed in separate files, as should functions outside of classes. The main.ts file should basically only contain the core HotkeysChordPlugin class and import the other classes.
It shouldn't be too hard to suspend chord processing while the Type the chord input has focus? It seems you may have tried to cover this in your ChordCapture function with document.removeEventListener("keydown", keydownhandler);, but you may want to try modifying your handleKeyDown function, because it has precedence over your ChordCapture function for keydown events.
Any way you do it, you should ignore chord events while the user is typing in a chord definition in your plugin UI, but I'm not certain about how you should do this yet. If it comes to me when I wake up more I may put in a PR.
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
Create a chord
C-h x
for a commandRegex find and replace
. This chord is by convention as most text editors useC-h
forfind and replace
, and the addition of thex
invokes the optional regex find and replace. The chord UI accepts this definition and the chord works.Create another chord
C-h
for commandGlobal Search and Replace
. When prompted to type the chord, your chord input doesn't acceptC-h
and acts like it's in read only mode.Remove the
C-h x
chord.Define the
C-h
chord first, it is accepted and works fine.Try and define the
C-h-x
chord again. When prompted to type the chord, enterC-h x
. As soon as you type the comboC-h
, before you are able to type thex
, theGlobal Search and Replace
from theC-h
chord is invoked and that prevents you from typing the completeC-h x
chord.Advice
I haven't properly reviewed your code yet as it's too untidy for me this early in the morning, but separate classes should be placed in separate files, as should functions outside of classes. The
main.ts
file should basically only contain the coreHotkeysChordPlugin
class and import the other classes.It shouldn't be too hard to suspend chord processing while the
Type the chord
input has focus? It seems you may have tried to cover this in yourChordCapture
function withdocument.removeEventListener("keydown", keydownhandler);
, but you may want to try modifying yourhandleKeyDown
function, because it has precedence over yourChordCapture
function forkeydown
events.Any way you do it, you should ignore chord events while the user is typing in a chord definition in your plugin UI, but I'm not certain about how you should do this yet. If it comes to me when I wake up more I may put in a PR.
The text was updated successfully, but these errors were encountered: