iOS - Default to not enabling keyboard gamepad (#15340) (#15955)

This commit is contained in:
Eric Warmenhoven 2023-11-26 22:34:45 -05:00 committed by GitHub
parent ee62cb5407
commit d8c444d44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -1509,6 +1509,12 @@
#define DEFAULT_TURBO_MODE 0
#define DEFAULT_TURBO_DEFAULT_BTN RETRO_DEVICE_ID_JOYPAD_B
#if TARGET_OS_IPHONE
#define DEFAULT_INPUT_KEYBOARD_GAMEPAD_ENABLE false
#else
#define DEFAULT_INPUT_KEYBOARD_GAMEPAD_ENABLE true
#endif
/* Enable input auto-detection. Will attempt to autoconfigure
* gamepads, plug-and-play style. */
#define DEFAULT_INPUT_AUTODETECT_ENABLE true

View File

@ -2067,7 +2067,7 @@ static struct config_bool_setting *populate_settings_bool(
#if TARGET_OS_IPHONE
SETTING_BOOL("small_keyboard_enable", &settings->bools.input_small_keyboard_enable, true, false, false);
#endif
SETTING_BOOL("keyboard_gamepad_enable", &settings->bools.input_keyboard_gamepad_enable, true, true, false);
SETTING_BOOL("keyboard_gamepad_enable", &settings->bools.input_keyboard_gamepad_enable, true, DEFAULT_INPUT_KEYBOARD_GAMEPAD_ENABLE, false);
SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, DEFAULT_INPUT_AUTODETECT_ENABLE, false);
SETTING_BOOL("input_auto_mouse_grab", &settings->bools.input_auto_mouse_grab, true, false, false);
SETTING_BOOL("input_remap_binds_enable", &settings->bools.input_remap_binds_enable, true, true, false);

View File

@ -283,7 +283,7 @@ static bool apple_input_handle_icade_event(unsigned kb_type_idx, unsigned *code,
initialized = true;
}
if ((*code < 0x20) && (icade_maps[kb_type_idx][*code].key != RETROK_UNKNOWN))
if ((*code < MAX_ICADE_KEYS) && (icade_maps[kb_type_idx][*code].key != RETROK_UNKNOWN))
{
*keydown = icade_maps[kb_type_idx][*code].up ? false : true;
ret = true;