keymaster
keymaster copied to clipboard
Single modifier shortcuts now possible!
This change allows the possibility of doing key('ctrl', function(){ ... });
which the prior logic would actually interpret as key('c', function(){ ... });
Addresses Issue #103
Okay, after further testing, it turns out my patch is no good.
If you hold down the modifier keys, after half a second you start receiving multiple events kinda like thisssssssssssssssssssssssssss if you hold down on the 'S'. Need logic around that. Would appreciate if the owners of the repo can give me advice on whether or not my hack makes any sense or not!
If you hold down the modifier keys, after half a second you start receiving multiple events kinda like thisssssssssssssssssssssssssss if you hold down on the 'S'.
That should be just default behavior, as I had to add in some extra glue to prevent quick repeats on my keybinds when adding keymaster to a project recently. I don't think the library actually supports single keypress binds (eg. key('left, a', someFunction)
will get you repeated calls of someFunction if you hold left
or a
down) with no repeats as it is.
@Daiz- you're right, thanks. I'll have to tackle the repeats issue separately.
In that case, any thoughts on my patch? Regarding single modifier shortcuts
+1 It is sometimes essential to be able to bind to "modifier" keys individually. E.g. make something happen on keydown of shift
. There should also be a manual workaround that allows the input of keycode(s) as the first argument, to allow getting around this limitation while still using all the Keymaster goodness like the scope
feature.