Closed castano closed 1 year ago
This is a good change, but I'll need to check if this fix is also needed on macOS and Linux.
I don't know about Linux, but this certainly needs more work on MacOS. There's no NSEvent object available in the drop event handler, so it wasn't immediately obvious how to update the modifiers. It should not be hard to set these based on the most recent value, though.
Starting to look into this now.
macOS seems to have a class-method (aka static method) on NSEvent which provides the current event mask without requiring an actual event object: https://developer.apple.com/documentation/appkit/nsevent/1535211-modifierflags?language=objc
I'm doing a few slightly related fixes in my merge-branch, notes to self:
SAPP_EVENTTYPE_MOUSE_ENTER/LEAVE
:
SAPP_EVENTTYPES_FILES_DROPPED
:
SAPP_EVENTTYPES_FILES_DROPPED
:
SAPP_EVENTTYPE_FILES_DROPPED
:
...hmm, I can't find a way to get modifier key state in Xlib. The dropped-event doesn't have this info, and polling the current keyboard state always returns that no keys are pressed. Added a fixme-comment for now, but this might not be a feature to rely on in cross-platform apps.
Ok merged. Many thanks for the PR!
Awesome, thanks!
In order to detect if any modifier keys are being pressed at the end of a drop event.