Skip to content

Commit

Permalink
iOS - Default to not enabling keyboard gamepad (libretro#15340) (libr…
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven authored and Sunderland93 committed Dec 26, 2024
1 parent d07eacd commit 1bad607
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion input/drivers/cocoa_input.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1bad607

Please sign in to comment.