keymaster icon indicating copy to clipboard operation
keymaster copied to clipboard

Single modifier shortcuts now possible!

Open ansonkao opened this issue 10 years ago • 5 comments

This change allows the possibility of doing key('ctrl', function(){ ... }); which the prior logic would actually interpret as key('c', function(){ ... });

ansonkao avatar Oct 04 '14 21:10 ansonkao

Addresses Issue #103

ansonkao avatar Oct 04 '14 21:10 ansonkao

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!

ansonkao avatar Oct 05 '14 03:10 ansonkao

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 avatar Oct 05 '14 04:10 Daiz

@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

ansonkao avatar Oct 05 '14 04:10 ansonkao

+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.

albell avatar Oct 23 '15 18:10 albell