mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(ui_cocoa.m ) Cleanups
This commit is contained in:
parent
1c867cedf0
commit
ea18f0f5e3
@ -53,12 +53,8 @@ void apple_rarch_exited(void)
|
||||
return;
|
||||
[super sendEvent:event];
|
||||
|
||||
apple = (cocoa_input_data_t*)driver->input_data;
|
||||
event_type = event.type;
|
||||
|
||||
if (!apple)
|
||||
return;
|
||||
|
||||
switch ((int32_t)event_type)
|
||||
{
|
||||
case NSKeyDown:
|
||||
@ -113,6 +109,11 @@ void apple_rarch_exited(void)
|
||||
{
|
||||
NSPoint pos;
|
||||
NSPoint mouse_pos;
|
||||
|
||||
apple = (cocoa_input_data_t*)driver->input_data;
|
||||
if (!apple)
|
||||
return;
|
||||
|
||||
/* Relative */
|
||||
apple->mouse_rel_x = event.deltaX;
|
||||
apple->mouse_rel_y = event.deltaY;
|
||||
@ -147,12 +148,18 @@ void apple_rarch_exited(void)
|
||||
case NSLeftMouseDown:
|
||||
case NSRightMouseDown:
|
||||
case NSOtherMouseDown:
|
||||
apple = (cocoa_input_data_t*)driver->input_data;
|
||||
if (!apple)
|
||||
return;
|
||||
apple->mouse_buttons |= 1 << event.buttonNumber;
|
||||
apple->touch_count = 1;
|
||||
break;
|
||||
case NSLeftMouseUp:
|
||||
case NSRightMouseUp:
|
||||
case NSOtherMouseUp:
|
||||
apple = (cocoa_input_data_t*)driver->input_data;
|
||||
if (!apple)
|
||||
return;
|
||||
apple->mouse_buttons &= ~(1 << event.buttonNumber);
|
||||
apple->touch_count = 0;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user