mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
refactor and restore non-android bind hold behavior
This commit is contained in:
parent
96ea874850
commit
79264c7278
@ -585,32 +585,43 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
|||||||
input_driver_keyboard_mapping_set_block( true );
|
input_driver_keyboard_mapping_set_block( true );
|
||||||
menu_input_key_bind_poll_bind_state( &binds, menu_bind_port, timed_out );
|
menu_input_key_bind_poll_bind_state( &binds, menu_bind_port, timed_out );
|
||||||
|
|
||||||
/*keep resetting bind during the hold period, or we'll potentially bind joystick and mouse, etc.*/
|
/*keep resetting bind during the hold period, or we'll potentially bind joystick and mouse, etc.*/
|
||||||
binds.buffer = *( binds.output );
|
binds.buffer = *( binds.output );
|
||||||
|
|
||||||
if ( menu_input_key_bind_poll_find_hold( &binds, &binds.buffer ) )
|
if ( settings->uints.input_bind_timeout == 0 )
|
||||||
{
|
{
|
||||||
/*inhibit timeout*/
|
if ( ( binds.skip && !menu_input_binds.skip ) ||
|
||||||
rarch_timer_begin_new_time( &binds.timer_timeout, settings->uints.input_bind_timeout );
|
menu_input_key_bind_poll_find_trigger( &menu_input_binds, &binds, &( binds.buffer ) ) )
|
||||||
|
{
|
||||||
/*run hold timer*/
|
complete = true;
|
||||||
rarch_timer_tick( &binds.timer_hold );
|
|
||||||
|
|
||||||
snprintf( bind->s, bind->len,
|
|
||||||
"[%s]\npress keyboard, mouse or joypad\nand hold ...",
|
|
||||||
input_config_bind_map_get_desc(
|
|
||||||
menu_input_binds.begin - MENU_SETTINGS_BIND_BEGIN ) );
|
|
||||||
|
|
||||||
/*hold complete?*/
|
|
||||||
if ( rarch_timer_has_expired( &binds.timer_hold ) )
|
|
||||||
{
|
|
||||||
complete = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*reset hold countdown*/
|
if ( menu_input_key_bind_poll_find_hold( &binds, &binds.buffer ) )
|
||||||
rarch_timer_begin_new_time( &binds.timer_hold, settings->uints.input_bind_hold );
|
{
|
||||||
|
/*inhibit timeout*/
|
||||||
|
rarch_timer_begin_new_time( &binds.timer_timeout, settings->uints.input_bind_timeout );
|
||||||
|
|
||||||
|
/*run hold timer*/
|
||||||
|
rarch_timer_tick( &binds.timer_hold );
|
||||||
|
|
||||||
|
snprintf( bind->s, bind->len,
|
||||||
|
"[%s]\npress keyboard, mouse or joypad\nand hold ...",
|
||||||
|
input_config_bind_map_get_desc(
|
||||||
|
menu_input_binds.begin - MENU_SETTINGS_BIND_BEGIN ) );
|
||||||
|
|
||||||
|
/*hold complete?*/
|
||||||
|
if ( rarch_timer_has_expired( &binds.timer_hold ) )
|
||||||
|
{
|
||||||
|
complete = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*reset hold countdown*/
|
||||||
|
rarch_timer_begin_new_time( &binds.timer_hold, settings->uints.input_bind_hold );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( complete )
|
if ( complete )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user