Allow more keyboard actions with menu osk (#15662)

This commit is contained in:
sonninnos 2023-09-02 01:48:55 +03:00 committed by GitHub
parent 078df8ba39
commit ea1bdade61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 12 deletions

View File

@ -6307,18 +6307,38 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
&& current_input && current_input
&& current_input->input_state) && current_input->input_state)
{ {
/* Set RetroPad Select bit when pressing Escape while keyboard /* Allow arrows, LCtrl as OK, character map switches,
* is open in order to clear the input window and close it */ * and set RetroPad Select bit when pressing Escape
if (current_input->input_state( * in order to clear the input window and close it. */
input_st->current_data, unsigned i;
joypad, unsigned ids[][2] =
sec_joypad, {
&joypad_info, {RETROK_LCTRL, RETRO_DEVICE_ID_JOYPAD_A },
(const retro_keybind_set *)input_config_binds, {RETROK_UP, RETRO_DEVICE_ID_JOYPAD_UP },
(input_st->flags & INP_FLAG_KB_MAPPING_BLOCKED) ? true : false, {RETROK_DOWN, RETRO_DEVICE_ID_JOYPAD_DOWN },
0, {RETROK_LEFT, RETRO_DEVICE_ID_JOYPAD_LEFT },
RETRO_DEVICE_KEYBOARD, 0, RETROK_ESCAPE)) {RETROK_RIGHT, RETRO_DEVICE_ID_JOYPAD_RIGHT },
BIT256_SET_PTR(current_bits, RETRO_DEVICE_ID_JOYPAD_SELECT); {RETROK_PAGEUP, RETRO_DEVICE_ID_JOYPAD_L },
{RETROK_PAGEDOWN, RETRO_DEVICE_ID_JOYPAD_R },
{RETROK_ESCAPE, RETRO_DEVICE_ID_JOYPAD_SELECT },
};
if (settings->bools.input_menu_swap_ok_cancel_buttons)
ids[0][1] = RETRO_DEVICE_ID_JOYPAD_B;
for (i = 0; i < ARRAY_SIZE(ids); i++)
{
if (current_input->input_state(
input_st->current_data,
joypad,
sec_joypad,
&joypad_info,
(const retro_keybind_set *)input_config_binds,
(input_st->flags & INP_FLAG_KB_MAPPING_BLOCKED) ? true : false,
0,
RETRO_DEVICE_KEYBOARD, 0, ids[i][0]))
BIT256_SET_PTR(current_bits, ids[i][1]);
}
} }
} }
else else