Modals have some delay
If I hit my keyboard shortcuts quickly enough (which I typically do), there is a <1s delay between hitting e.g. a in the first modal and the app switcher coming up in the next modal. In practice this means I have to wait between hitting keys in the modals of Spacehammer.
The modules are lazy loaded, and would be reset every-time hammerspoon reloads config. In your personal init.fnl you could try preloading the application switcher module and see if that speeds it up, though it might slow down startup.
Yeah, I don't know if the delay is just visual, or also affects the keyboard latency. For the first thing, you can try lowering the animation duration. In your ~/.spacehammer/config.fnl, right before config at the end, add this:
(set hs.window.animationDuration 0.1)
I don't know, perhaps we should consider setting it as the default value. I think the speed should be prioritized over the aesthetics.
update: Oh wait, what I am saying? This var has nothing to do with the modal animation.
This is what you can do, to improve the animation speed of the modals:
(tset hs.alert.defaultStyle :fadeInDuration 0.1)
(tset hs.alert.defaultStyle :fadeOutDuration 0.1)
@eccentric-j Is there a more elegant way of doing this? We don't have something like clojure.core/assoc, do we? (damn, it's been so long since I the last time I wrote anything in Fennel, I'm feeling out of touch)
Unfortunately this doesn't seem to help (at least, noticeably); I still have to wait a beat between a and e.g. e for emacs, otherwise I have to hit e twice. I'll have to see if I can figure out how to preload the app switcher module, poked around a bit but didn't find what I needed.
Yeah, typing ae quickly enough does sometimes result in keys getting "swallowed". I'm not sure at the moment if we can fix this quickly. Or even if that's Spacehammer's, Hammerspoon's, or OSX's problem. I have blazingly fast keyboard repeat rate, and I would love to be able to utilize that power, I don't want it to stutter when I'm switching between the apps.
I suspect this has to do with some setup\teardown time of the https://www.hammerspoon.org/docs/hs.hotkey.modal.html system that powers the modal system.
I'll try creating a state machine that only manages a hs.hotkey.modal and see how fast that operates. If there's no noticeable delay or dropped keys then it's the modal logic, if there is a delay then it's either the state machines (unlikely, they're pretty light-weight), or the hs.hotkey.modal performance itself.
@ihodes Could you please give #139 a shot? Just tested it now and it seems to have fixed that issue.
Closing due to inactivity. Seems fixed.