mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +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;
|
return;
|
||||||
[super sendEvent:event];
|
[super sendEvent:event];
|
||||||
|
|
||||||
apple = (cocoa_input_data_t*)driver->input_data;
|
|
||||||
event_type = event.type;
|
event_type = event.type;
|
||||||
|
|
||||||
if (!apple)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch ((int32_t)event_type)
|
switch ((int32_t)event_type)
|
||||||
{
|
{
|
||||||
case NSKeyDown:
|
case NSKeyDown:
|
||||||
@ -113,6 +109,11 @@ void apple_rarch_exited(void)
|
|||||||
{
|
{
|
||||||
NSPoint pos;
|
NSPoint pos;
|
||||||
NSPoint mouse_pos;
|
NSPoint mouse_pos;
|
||||||
|
|
||||||
|
apple = (cocoa_input_data_t*)driver->input_data;
|
||||||
|
if (!apple)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Relative */
|
/* Relative */
|
||||||
apple->mouse_rel_x = event.deltaX;
|
apple->mouse_rel_x = event.deltaX;
|
||||||
apple->mouse_rel_y = event.deltaY;
|
apple->mouse_rel_y = event.deltaY;
|
||||||
@ -147,12 +148,18 @@ void apple_rarch_exited(void)
|
|||||||
case NSLeftMouseDown:
|
case NSLeftMouseDown:
|
||||||
case NSRightMouseDown:
|
case NSRightMouseDown:
|
||||||
case NSOtherMouseDown:
|
case NSOtherMouseDown:
|
||||||
|
apple = (cocoa_input_data_t*)driver->input_data;
|
||||||
|
if (!apple)
|
||||||
|
return;
|
||||||
apple->mouse_buttons |= 1 << event.buttonNumber;
|
apple->mouse_buttons |= 1 << event.buttonNumber;
|
||||||
apple->touch_count = 1;
|
apple->touch_count = 1;
|
||||||
break;
|
break;
|
||||||
case NSLeftMouseUp:
|
case NSLeftMouseUp:
|
||||||
case NSRightMouseUp:
|
case NSRightMouseUp:
|
||||||
case NSOtherMouseUp:
|
case NSOtherMouseUp:
|
||||||
|
apple = (cocoa_input_data_t*)driver->input_data;
|
||||||
|
if (!apple)
|
||||||
|
return;
|
||||||
apple->mouse_buttons &= ~(1 << event.buttonNumber);
|
apple->mouse_buttons &= ~(1 << event.buttonNumber);
|
||||||
apple->touch_count = 0;
|
apple->touch_count = 0;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user