mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
(input_driver.c) Style nits
This commit is contained in:
parent
697760d580
commit
d36e7700f7
@ -596,6 +596,76 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2)
|
||||
input_pop_analog_dpad(settings->input.autoconf_binds[i]);
|
||||
}
|
||||
|
||||
static INLINE bool input_menu_keys_pressed_internal(unsigned i)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (
|
||||
(((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY)))
|
||||
|| !input_driver_block_hotkey))
|
||||
&& settings->input.binds[0][i].valid
|
||||
)
|
||||
{
|
||||
int port;
|
||||
int port_max = 1;
|
||||
if (settings->input.all_users_control_menu)
|
||||
port_max = settings->input.max_users;
|
||||
|
||||
for (port = 0; port < port_max; port++)
|
||||
{
|
||||
const input_device_driver_t *first = current_input->get_joypad_driver
|
||||
? current_input->get_joypad_driver(current_input_data) : NULL;
|
||||
const input_device_driver_t *sec = current_input->get_sec_joypad_driver
|
||||
? current_input->get_sec_joypad_driver(current_input_data) : NULL;
|
||||
|
||||
if (sec)
|
||||
{
|
||||
if (input_joypad_pressed(sec, port, settings->input.binds[0], i))
|
||||
return true;
|
||||
}
|
||||
if (first)
|
||||
{
|
||||
if (input_joypad_pressed(first, port, settings->input.binds[0], i))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= RARCH_FIRST_META_KEY)
|
||||
{
|
||||
if (current_input->meta_key_pressed(current_input_data, i))
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (overlay_ptr && input_overlay_key_pressed(overlay_ptr, i))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COMMAND
|
||||
if (input_driver_command)
|
||||
{
|
||||
command_handle_t handle;
|
||||
|
||||
handle.handle = input_driver_command;
|
||||
handle.id = i;
|
||||
|
||||
if (command_get(&handle))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKGAMEPAD
|
||||
if (input_driver_remote)
|
||||
{
|
||||
if (input_remote_key_pressed(i, 0))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static INLINE bool input_keys_pressed_internal(unsigned i,
|
||||
const struct retro_keybind *binds)
|
||||
{
|
||||
@ -689,75 +759,6 @@ uint64_t input_keys_pressed(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static INLINE bool input_menu_keys_pressed_internal(unsigned i)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (
|
||||
(((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY)))
|
||||
|| !input_driver_block_hotkey))
|
||||
&& settings->input.binds[0][i].valid
|
||||
)
|
||||
{
|
||||
int port;
|
||||
int port_max = 1;
|
||||
if (settings->input.all_users_control_menu)
|
||||
port_max = settings->input.max_users;
|
||||
|
||||
for (port = 0; port < port_max; port++)
|
||||
{
|
||||
const input_device_driver_t *first = current_input->get_joypad_driver
|
||||
? current_input->get_joypad_driver(current_input_data) : NULL;
|
||||
const input_device_driver_t *sec = current_input->get_sec_joypad_driver
|
||||
? current_input->get_sec_joypad_driver(current_input_data) : NULL;
|
||||
|
||||
if (sec)
|
||||
{
|
||||
if (input_joypad_pressed(sec, port, settings->input.binds[0], i))
|
||||
return true;
|
||||
}
|
||||
if (first)
|
||||
{
|
||||
if (input_joypad_pressed(first, port, settings->input.binds[0], i))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= RARCH_FIRST_META_KEY)
|
||||
{
|
||||
if (current_input->meta_key_pressed(current_input_data, i))
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (overlay_ptr && input_overlay_key_pressed(overlay_ptr, i))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COMMAND
|
||||
if (input_driver_command)
|
||||
{
|
||||
command_handle_t handle;
|
||||
|
||||
handle.handle = input_driver_command;
|
||||
handle.id = i;
|
||||
|
||||
if (command_get(&handle))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKGAMEPAD
|
||||
if (input_driver_remote)
|
||||
{
|
||||
if (input_remote_key_pressed(i, 0))
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* input_menu_keys_pressed:
|
||||
|
Loading…
x
Reference in New Issue
Block a user