Optimize android_keyboard_port_input_pressed

This commit is contained in:
twinaphex 2016-10-23 20:43:14 +02:00
parent 57457c2d70
commit b0ed69f05c
2 changed files with 2 additions and 2 deletions

View File

@ -1162,7 +1162,7 @@ static bool android_input_key_pressed(void *data, int key)
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
int port = 0; int port = 0;
if(android_keyboard_port_input_pressed(settings->input.binds[0],key)) if(settings->input.binds[0][key].valid && android_keyboard_port_input_pressed(settings->input.binds[0],key))
return true; return true;
if (settings->input.all_users_control_menu) if (settings->input.all_users_control_menu)

View File

@ -32,7 +32,7 @@ bool android_keyboard_port_input_pressed(const struct retro_keybind *binds, unsi
{ {
const struct retro_keybind *bind = &binds[id]; const struct retro_keybind *bind = &binds[id];
unsigned bit = input_keymaps_translate_rk_to_keysym(binds[id].key); unsigned bit = input_keymaps_translate_rk_to_keysym(binds[id].key);
return bind->valid && BIT_GET(android_key_state[ANDROID_KEYBOARD_PORT], bit); return BIT_GET(android_key_state[ANDROID_KEYBOARD_PORT], bit);
} }
return false; return false;
} }