(ui_cocoa.m ) Cleanups

This commit is contained in:
twinaphex 2015-11-29 18:06:09 +01:00
parent 1c867cedf0
commit ea18f0f5e3

View File

@ -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;