Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single modifier shortcuts now possible! #136

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ansonkao
Copy link

@ansonkao ansonkao commented Oct 4, 2014

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

@ansonkao
Copy link
Author

ansonkao commented Oct 4, 2014

Addresses Issue #103

@ansonkao
Copy link
Author

ansonkao commented Oct 5, 2014

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!

@Daiz
Copy link

Daiz commented Oct 5, 2014

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.

@ansonkao
Copy link
Author

ansonkao commented Oct 5, 2014

@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

@albell
Copy link

albell commented Oct 23, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants