From c274ab94a0509553b79b45300a0bba78113dd486 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 23 Mar 2015 03:22:57 +0100 Subject: [PATCH] Create input_driver_key_pressed --- input/input_driver.c | 9 +++++++++ input/input_driver.h | 2 ++ runloop.c | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 844b8d6a23..088d3553d9 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -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; +} diff --git a/input/input_driver.h b/input/input_driver.h index c4d43840ca..25bc5509bf 100644 --- a/input/input_driver.h +++ b/input/input_driver.h @@ -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 diff --git a/runloop.c b/runloop.c index e88162b2b9..3b11677585 100644 --- a/runloop.c +++ b/runloop.c @@ -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++) {