35299b18d3
There are a few ways to get mouse position: GCMouse and using NSEvent. GCMouse is newer and better, it reports mouse movement in raw x/y deltas which is exactly what we need. The issue is that it expects you to set up handlers for the movement events , but I couldn't figure out a way to do that with the existing `poll()` paradigm where it passes the device into the function. Ideally I'd be able to do `assign(HID::Mouse::GroupID::Axis, 0, deltaX);` directly in the event handler. The other advantage to GCMouse is that we can use `CGAssociateMouseAndMouseCursorPosition` and then we don't have to worry about moving the hidden cursor over built in UI (such as the dock). This implementation uses regular NSEvent for mouse data which works pretty well with the current poll() paradigm. I had difficulty handing mouse centering/zeroing so I left it out. It works pretty well both full screen and windowed but it is possible to accidentally click the dock. Open to feedback so please let me know what you think! I'd love to get GCMouse working. Demo: https://www.youtube.com/watch?v=UwPyVNWP5hM |
||
---|---|---|
.. | ||
cocoa | ||
core | ||
extension | ||
gtk | ||
platform | ||
qt | ||
resource | ||
windows | ||
GNUmakefile | ||
components.hpp | ||
hiro.cpp | ||
hiro.hpp |