Open qqilihq opened 4 years ago
Hey @qqilihq! Interesting question. I think for a) the answer is no, since this is handled by the macOS API and the event is triggered natively. For b), this might be possible, but currently no such event is exposed through the Phoenix API. This might be something we can improve. I think the manual delay is likely the best stopgap for now.
Hi there,
I found this issue while looking for a way to capture mouse dragging (or rather, its end), and would also like to have this. I'm currently looking for a way to do window "drag and snap" to arbitrary zones, and without mouse event capture or just a simple modifier release, it's really hard to to.
@rcarmo Hi! Have you noticed the mouse events? https://github.com/kasper/phoenix/blob/2.6.7/docs/API.md#mouse. These events also provide the key modifiers that were active when the event happened. Combine with debouncing (https://lodash.com/docs/4.17.15#debounce) and you should be able achieve what you are looking for. Would that help?
Thanks, that sounds like a plan. Since there are so few examples, I overlooked them.
@rcarmo Let me know if there’s anything else you need help with. True, it might be valuable to add some more examples to the API documentation. Fair feedback! 🙂
Well, I've already got an XMonad-like tiling arrangement going: https://gist.github.com/rcarmo/1daccbe9abbbb5c133b7b48d05cc09e7 (am hacking another example, so this is missing some bits, but gives the general idea)
I’m using Phoenix with Cliclick (thanks for the hint somewhere here in the tickets!)
The challenge: When the handler is executed, the modifier keys might still be pressed (only the actual key has been released), thus the text to be inserted is typed while the modifiers are still down, which leads to unexpected behavior. I can work around this using a few ms wait.
Simple example:
Is there a possibility to (a) either execute the handler once all keys have been released, or (b) have some event which triggered once the modifiers are released, or (c) some other way which I haven’t thought of?