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
0b1a204949
commit
b3642df33f
@ -109,9 +109,10 @@ static void app_terminate(void)
|
|||||||
case NSFlagsChanged:
|
case NSFlagsChanged:
|
||||||
{
|
{
|
||||||
static uint32_t old_flags = 0;
|
static uint32_t old_flags = 0;
|
||||||
uint32_t new_flags = event.modifierFlags;
|
uint32_t new_flags = event.modifierFlags;
|
||||||
bool down = (new_flags & old_flags) == old_flags;
|
bool down = (new_flags & old_flags) == old_flags;
|
||||||
old_flags = new_flags;
|
|
||||||
|
old_flags = new_flags;
|
||||||
|
|
||||||
apple_input_keyboard_event(down, event.keyCode,
|
apple_input_keyboard_event(down, event.keyCode,
|
||||||
0, event.modifierFlags, RETRO_DEVICE_KEYBOARD);
|
0, event.modifierFlags, RETRO_DEVICE_KEYBOARD);
|
||||||
@ -148,27 +149,27 @@ static void app_terminate(void)
|
|||||||
case NSLeftMouseDown:
|
case NSLeftMouseDown:
|
||||||
case NSRightMouseDown:
|
case NSRightMouseDown:
|
||||||
case NSOtherMouseDown:
|
case NSOtherMouseDown:
|
||||||
{
|
{
|
||||||
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
||||||
apple = (cocoa_input_data_t*)input_driver_get_data();
|
apple = (cocoa_input_data_t*)input_driver_get_data();
|
||||||
if (!apple || pos.y < 0)
|
if (!apple || pos.y < 0)
|
||||||
return;
|
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:
|
||||||
{
|
{
|
||||||
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
NSPoint pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
||||||
apple = (cocoa_input_data_t*)input_driver_get_data();
|
apple = (cocoa_input_data_t*)input_driver_get_data();
|
||||||
if (!apple || pos.y < 0)
|
if (!apple || pos.y < 0)
|
||||||
return;
|
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