(Cocoa) Add mouse down events

This commit is contained in:
Twinaphex 2019-09-20 18:22:14 +02:00
parent 3da84396b6
commit 73c63d8768

View File

@ -207,6 +207,21 @@ static void app_terminate(void)
#endif
/* TODO/FIXME - properly implement. */
break;
case NSEventTypeLeftMouseDown:
case NSEventTypeRightMouseDown:
case NSEventTypeOtherMouseDown:
{
#ifdef HAVE_COCOA_METAL
NSPoint pos = [apple_platform.renderView convertPoint:[event locationInWindow] fromView:nil];
#else
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
#endif
apple = (cocoa_input_data_t*)input_driver_get_data();
if (!apple || pos.y < 0)
return;
apple->mouse_buttons |= (1 << event.buttonNumber);
}
break;
case NSEventTypeLeftMouseUp:
case NSEventTypeRightMouseUp:
case NSEventTypeOtherMouseUp: