1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sokol: fix dragging events on macos in sokol_app.h (#8817)

This commit is contained in:
R cqls 2021-02-18 08:40:43 +01:00 committed by GitHub
parent a119affeba
commit a08eb9cd8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3099,14 +3099,14 @@ _SAPP_OBJC_RELEASE( menu_bar );
_sapp.mouse.dy = [event deltaY]; _sapp.mouse.dy = [event deltaY];
} }
// QTODO hack INVALID=>MIDDLE macos bug // QTODO hack INVALID=>MIDDLE macos bug
_sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_MIDDLE , _sapp_macos_mod(event.modifierFlags)); _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_LEFT , _sapp_macos_mod(event.modifierFlags));
} }
- (void)rightMouseDragged:(NSEvent*)event { - (void)rightMouseDragged:(NSEvent*)event {
if (_sapp.mouse.locked) { if (_sapp.mouse.locked) {
_sapp.mouse.dx = [event deltaX]; _sapp.mouse.dx = [event deltaX];
_sapp.mouse.dy = [event deltaY]; _sapp.mouse.dy = [event deltaY];
} }
_sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID, _sapp_macos_mod(event.modifierFlags)); _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_RIGHT, _sapp_macos_mod(event.modifierFlags));
} }
- (void)scrollWheel:(NSEvent*)event { - (void)scrollWheel:(NSEvent*)event {
if (_sapp_events_enabled()) { if (_sapp_events_enabled()) {