Fix crash when defining gamepad keys

This commit is contained in:
Diablodiab 2016-02-08 01:53:33 +01:00
parent bdb9471d13
commit 84b6b505ad

View File

@ -976,8 +976,11 @@ static void android_input_poll_input(void *data)
if (is_keyboard_id(id)) if (is_keyboard_id(id))
{ {
if (!predispatched) android_input_poll_event_type_keyboard(event, keycode, &handled); if (!predispatched)
android_input_poll_event_type_key(android_app, event, ANDROID_KEYBOARD_PORT, keycode, source, type_event, &handled); {
android_input_poll_event_type_keyboard(event, keycode, &handled);
android_input_poll_event_type_key(android_app, event, ANDROID_KEYBOARD_PORT, keycode, source, type_event, &handled);
}
} }
else else
android_input_poll_event_type_key(android_app, android_input_poll_event_type_key(android_app,
@ -1113,8 +1116,6 @@ static int16_t android_input_state(void *data,
case RETRO_DEVICE_JOYPAD: case RETRO_DEVICE_JOYPAD:
return input_joypad_pressed(android->joypad, port, binds[port], id) || return input_joypad_pressed(android->joypad, port, binds[port], id) ||
android_keyboard_port_input_pressed(binds[port],id); android_keyboard_port_input_pressed(binds[port],id);
case RETRO_DEVICE_KEYBOARD:
android_keyboard_port_input_pressed(binds[0],id);
case RETRO_DEVICE_ANALOG: case RETRO_DEVICE_ANALOG:
return input_joypad_analog(android->joypad, port, idx, id, return input_joypad_analog(android->joypad, port, idx, id,
binds[port]); binds[port]);
@ -1205,7 +1206,6 @@ static uint64_t android_input_get_capabilities(void *data)
return return
(1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_JOYPAD) |
(1 << RETRO_DEVICE_KEYBOARD) |
(1 << RETRO_DEVICE_POINTER) | (1 << RETRO_DEVICE_POINTER) |
(1 << RETRO_DEVICE_ANALOG); (1 << RETRO_DEVICE_ANALOG);
} }