ryanmcgrath / cacao

Rust bindings for AppKit (macOS) and UIKit (iOS/tvOS). Experimental, but working!
MIT License
1.79k stars 65 forks source link

Global NSEvent listener and some mouse methods #94

Closed agg23 closed 11 months ago

agg23 commented 11 months ago

I found that global NSEvent monitoring was not currently implemented, and on further investigation, local monitoring only used a single possible mask value.

This PR introduces a mechanism for handling bitmasks from enums (though I understand if you'd like me to remove it), unblocking the proper implementation of those methods. It also adds the missing event type enum values and a few NSEvent getters (though there are many more still to do).

ryanmcgrath commented 11 months ago

This PR is great and I'm totally down to merge it once we're finished addressing the comments and all (non-iOS) checks pass.

I threw together the initial NSEvent stuff in a rush for demo purposes (the calculator IIRC) and then just never have time to circle back. It's very useful tho so happy to see it!

Thanks!

ryanmcgrath commented 11 months ago

Merged - thanks!