mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
Refactor input_keys_pressed_func
This commit is contained in:
parent
d8d9b35a57
commit
4a84e0e609
@ -197,25 +197,6 @@ void input_push_analog_dpad(struct retro_keybind *binds, unsigned mode);
|
|||||||
void input_pop_analog_dpad(struct retro_keybind *binds);
|
void input_pop_analog_dpad(struct retro_keybind *binds);
|
||||||
|
|
||||||
|
|
||||||
static inline bool input_key_pressed_func(int key)
|
|
||||||
{
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
if (!driver.block_hotkey)
|
|
||||||
ret = driver.input->key_pressed(driver.input_data, key);
|
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
|
||||||
ret = ret || (driver.overlay_state.buttons & (1ULL << key));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_COMMAND
|
|
||||||
if (driver.command)
|
|
||||||
ret = ret || rarch_cmd_get(driver.command, key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Returns a 64-bit mask of all pressed buttons, starting
|
/* Returns a 64-bit mask of all pressed buttons, starting
|
||||||
* from the specified key up until the last queryable key
|
* from the specified key up until the last queryable key
|
||||||
* (key_end).
|
* (key_end).
|
||||||
@ -232,7 +213,21 @@ static inline retro_input_t input_keys_pressed_func(unsigned key,
|
|||||||
|
|
||||||
for (; key < key_end; key++)
|
for (; key < key_end; key++)
|
||||||
{
|
{
|
||||||
if (input_key_pressed_func(key))
|
bool state = false;
|
||||||
|
|
||||||
|
if (!driver.block_hotkey)
|
||||||
|
state = driver.input->key_pressed(driver.input_data, key);
|
||||||
|
|
||||||
|
#ifdef HAVE_OVERLAY
|
||||||
|
state = state || (driver.overlay_state.buttons & (1ULL << key));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COMMAND
|
||||||
|
if (driver.command)
|
||||||
|
state = state || rarch_cmd_get(driver.command, key);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (state)
|
||||||
ret |= (1ULL << key);
|
ret |= (1ULL << key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user