mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(iOS) Add more safeguards in apple_touch_event and apple_input_keyboard
event
This commit is contained in:
parent
88dbe4ee63
commit
945376ab2d
@ -77,6 +77,9 @@ static void handle_touch_event(NSArray* touches)
|
||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
||||
const float scale = [[UIScreen mainScreen] scale];
|
||||
|
||||
if (!apple)
|
||||
return;
|
||||
|
||||
apple->touch_count = 0;
|
||||
|
||||
for(i = 0; i < touches.count && (apple->touch_count < MAX_TOUCHES); i ++)
|
||||
|
@ -284,7 +284,8 @@ void apple_input_keyboard_event(bool down,
|
||||
if (code == 0 || code >= MAX_KEYS)
|
||||
return;
|
||||
|
||||
apple->key_state[code] = down;
|
||||
if (apple)
|
||||
apple->key_state[code] = down;
|
||||
|
||||
mods |= (mod & NSAlphaShiftKeyMask) ? RETROKMOD_CAPSLOCK : 0;
|
||||
mods |= (mod & NSShiftKeyMask) ? RETROKMOD_SHIFT : 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user