-
Notifications
You must be signed in to change notification settings - Fork 594
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
hotkey.modal that ignores anything but given hotkeys #1505
Comments
I am looking for this exact feature as a way to keep the footprint of global shortcuts that I use through hammerspoon low. This is important whenever keyboard-heavy apps are in use (IDEs like Intellij, design-tools like sketch, etc). |
I imagine you could do this using the |
@deryni I am not talking about disabling registered hotkeys. I am talking about making all the keys (hotkeys or not) disabled and leave only those that needed in that modal. So if modal expects |
simple answer no, longer answer but you might be able to fake it. couple of ideas come to mind but not sure which will work best for you. First idea, add hotkeys to the modal key that cover all of the most likely mistypes with an empty callback function, e.g. Second idea is to create an eventtap in the |
@agzam Ah, I misunderstood. Sorry. Then yeah, my only thought is what asmagill suggested with the eventtap to ignore everything. |
This is an interesting idea and I wouldn't be opposed to it being implemented in Hammerspoon (likely as a pure-ObjC version of @asmagill 's eventtap idea). |
See https://github.com/asmagill/hammerspoon-config/blob/master/_scratch/modalSuppression.lua for a solution which examines the specific modal hotkey and creates the eventtap for you |
@cmsj, I don't see a need to make this objc, and my only objection to making it part of |
@asmagill interesting. What do you think about having this be an optional parameter of an hs.hotkey.modal? (I'd suggest something like |
I think I like that, though I want to mull it over a bit more to see if we want to (or even can) add some additional checks to minimize the likelihood of someone accidentally "locking up" their machine. |
@asmagill I also think a valid option would be for it to be a completely separate thing, as a Spoon, that creates a menubar item to a) show it's in exclusive mode, b) break out of that mode. |
Liking the menubar item and doing this as a spoon. Will add to my list, but not adding to 0.9.56 since a spoon can be easily added in between releases. |
Is it possible to have a
hs.hotkey.modal
with a few bindings that would ignore all the other keys. Let's say if I have:Then if I press
cmd+space
, it will activate the modal, in which it would only respond tog
,f
, ands
. Any other keys would be simply ignored. Is that even possible?The text was updated successfully, but these errors were encountered: