Create input_driver_key_pressed

This commit is contained in:
twinaphex 2015-03-23 03:22:57 +01:00
parent 71e927020c
commit c274ab94a0
3 changed files with 12 additions and 2 deletions

View File

@ -231,3 +231,12 @@ void input_driver_poll(void)
if (driver->input && driver->input_data && driver->input->poll)
driver->input->poll(driver->input_data);
}
bool input_driver_key_pressed(int key)
{
driver_t *driver = driver_get_ptr();
if (driver && driver->input && driver->input->key_pressed)
return driver->input->key_pressed(driver->input_data, key);
return false;
}

View File

@ -142,6 +142,8 @@ int16_t input_driver_state(const struct retro_keybind **retro_keybinds,
void input_driver_poll(void);
bool input_driver_key_pressed(int key);
#ifdef __cplusplus
}
#endif

View File

@ -848,8 +848,7 @@ static INLINE retro_input_t input_keys_pressed(void)
global->turbo_count++;
driver->block_libretro_input = check_block_hotkey(
driver->input->key_pressed(driver->input_data,
RARCH_ENABLE_HOTKEY));
input_driver_key_pressed(RARCH_ENABLE_HOTKEY));
for (i = 0; i < settings->input.max_users; i++)
{