Injected keys from SpaceCadet are not replayed
christo-auer opened this issue · 1 comments
Hey!
I am using SpaceCadet and injected keys from SpaceCadet are not replayed, they are just ignored. I had the same problem with my plugin (https://github.com/christo-auer/Kaleidoscope-AdhocMacros) and solved it by registering SpaceCadet AFTER my plugin in the use-call. Also, SpaceCadet just issues a press event but not release event. In the normal Kaleidoscope loop, a release event is triggered each loop for injected keys.
I currently inject a release event manually for injected presses (not elegant, but it works for most cases). A more elegant solution maybe is to track which keys are pressed during recording but not released and then release then force releasing them after replay.
Great plugin!
Christopher
Hi Christopher,
Sorry for the (months)-delayed response, I've been working on other things. Do I understand correctly that everything works properly if MacrosOnTheFly and SpaceCadet are registered in the correct order? (If so, I'm tempted to say there's no bug here; there are many plugins which only work properly if registered in a certain order, and furthermore MacrosOnTheFly specifically says in its README to register MacrosOnTheFly as early as possible, in general. Maybe someday Kaleidoscope will have a better system for plugins to negotiate a registration order a la dependencies or something.)
I hear your suggestion for MacrosOnTheFly to track presses and make sure to insert matching releases. This gives me a little bit of an uneasy feeling that we would break compatibility with other plugins - maybe it works for SpaceCadet but would break something else. However, I'm not totally against it if we have no other option; we'd just have to be careful. All that said, if registration order fixes the problem, I'm strongly tempted to leave it at that.