-
Notifications
You must be signed in to change notification settings - Fork 220
Is there a way I can detect Key press and hold with MASShortcut? #148
Comments
The answer is going to be different on whether your keypress is an ansi key-code (like AFAIK the underlying system API used by MASShortcut does not allow you to detect keycode-less shortcuts (like As of ability to detect holds: neither MASShortcut nor SRShortcutRecorder supports it. That's an interesting feature though, please create an issue and detail your use-case. |
What if I say I am okay with using key having ansi key-code (like
I have installed one app on my machine and one of its features works with long press
Can you pl tell me what more details you need? My use-case is that I want to toggle a feature of my app when a user presses and holds a key instead of just pressing once. That's all. |
If you only need to know when Fn is pressed and not prevent / alter how other apps see it, I think
If you answers are "modifier-only", "not blocking" and "no" then I'd use the API I mentioned above to set up a EDIT When timer fires, just check modifier flags again. Or cancel the timer if modifier flags change before it gets a chance to fire. |
I want to perform some actions when the user presses and holds
Fn
key. Can I detect Key press and hold with this library? If yes, a simple code snippet would be great.The text was updated successfully, but these errors were encountered: