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

Is custom modifier key possible? For instance ` + 1 #250

Closed
ZYinMD opened this issue Oct 29, 2019 · 4 comments
Closed

Is custom modifier key possible? For instance ` + 1 #250

ZYinMD opened this issue Oct 29, 2019 · 4 comments

Comments

@ZYinMD
Copy link

ZYinMD commented Oct 29, 2019

Can I use custom modifier keys other than ctrl, alt, shift, etc? For instnace, I'd like to define a hotkey ` + 1, is it possible?

Thanks!

@greena13
Copy link
Owner

greena13 commented Jan 1, 2020

@ZYinMD,

Going from memory, I believe this should be possible just by defining a `+1 hotkey. I have not attempted it, though, so you may find it doesn't work perfectly in all situations.

@ZYinMD
Copy link
Author

ZYinMD commented Jan 2, 2020

From my test, it doesn't work in either v2 or v1.1.4. The mousetrap doc also didn't mention anything about custom modifiers.

It makes sense that it won't just work, because once you have a hotkey like `+1, you need to think about what happens when you just press `. The usual way of handling it by some other software is to do nothing but wait until key up, if ` was pressed and released without other keys, then fire ` on key up. But since you don't remember writing this mechanism I doubt it's there.

@greena13
Copy link
Owner

greena13 commented Jan 2, 2020

Curious. Would you happen to have the (verbose) logs available for when you tried to trigger this keymap?

@ZYinMD
Copy link
Author

ZYinMD commented Feb 6, 2020

Hi, I tried again, it does work. The only issue is if it happens inside an input or textarea, special handling is required to prevent ` from being typed out, and also if user does need to type ` out, they should be able to do it by press and then release the ` key.

Anyway, it's solvable, thanks for you help! Closing.

@ZYinMD ZYinMD closed this as completed Feb 6, 2020
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

No branches or pull requests

2 participants