ares-openbsd/hiro
David DeGraw 35299b18d3
macOS: Implement mouse driver (#1446)
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
2024-04-09 18:05:54 +01:00
..
cocoa macOS: Implement mouse driver (#1446) 2024-04-09 18:05:54 +01:00
core build: enable strict standards conformance with cl (msvc) (#1317) 2023-12-04 12:01:50 +00:00
extension build: enable strict standards conformance with cl (msvc) (#1317) 2023-12-04 12:01:50 +00:00
gtk build: improve pkg-config support on windows (#1337) 2023-12-08 11:55:43 +00:00
platform
qt build: improve pkg-config support on windows (#1337) 2023-12-08 11:55:43 +00:00
resource
windows build: enable strict standards conformance with cl (msvc) (#1317) 2023-12-04 12:01:50 +00:00
GNUmakefile build: improve pkg-config support on windows (#1337) 2023-12-08 11:55:43 +00:00
components.hpp
hiro.cpp
hiro.hpp