RustAudio / baseview

low-level window system interface for audio plugin UIs
Apache License 2.0
267 stars 57 forks source link

add support for CursorEntered and CursorLeft events in Windows OS #147

Open Amarantheum opened 1 year ago

Amarantheum commented 1 year ago

A simple change that uses TrackMouseEvent to determine if the cursor has left the window. Uses WM_MOUSEMOVE to determine if the mouse has entered back into the window. Adds additional state mouse_in_window to the WindowState struct to determine if the cursor is over the window. This is initialized to true since TrackMouseEvent will immediately register a WM_MOUSELEAVE message if the cursor is not in the window.

Mostly adding this since it's useful for me so it may be useful for others.