diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-02-02 17:08:53 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-02-02 17:08:53 +0100 |
| commit | d8454bf1f6d1066758ed088f63a342c8ac4e75d4 (patch) | |
| tree | 5a7c24d4848cef1c3bff2708e825862e763fb309 | |
| parent | 07ca7631ee9a0854a0f269bd53df5a54fe235bd5 (diff) | |
sokol_app.h macOS: add support for SAPP_MOUSEBUTTON_MIDDLE (needs testing)
| -rw-r--r-- | sokol_app.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sokol_app.h b/sokol_app.h index d8947fe5..6970add1 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -1663,6 +1663,16 @@ _SOKOL_PRIVATE void _sapp_macos_app_event(sapp_event_type type) { - (void)rightMouseUp:(NSEvent*)event { _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_RIGHT, _sapp_macos_mod(event.modifierFlags)); } +- (void)otherMouseDown:(NSEvent*)event { + if (2 == event.buttonNumber) { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, SAPP_MOUSEBUTTON_MIDDLE, _sapp_macos_mod(event.modifierFlags)); + } +} +- (void)otherMouseUp:(NSEvent*)event { + if (2 == event.buttonNumber) { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_MIDDLE, _sapp_macos_mod(event.modifierFlags)); + } +} - (void)mouseMoved:(NSEvent*)event { _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID , _sapp_macos_mod(event.modifierFlags)); } |