mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 19:21:03 +00:00
remap-redux part 2: fix small issue with keymapper
This commit is contained in:
parent
34649d1abf
commit
c4754815b6
@ -28,7 +28,7 @@ RETRO_BEGIN_DECLS
|
||||
|
||||
#define MAX_INPUT_DEVICES 16
|
||||
|
||||
#define MAX_KEYS 136
|
||||
#define RARCH_MAX_KEYS 136
|
||||
|
||||
#define RARCH_FIRST_CUSTOM_BIND 16
|
||||
#define RARCH_FIRST_LIGHTGUN_BIND RARCH_ANALOG_BIND_LIST_END
|
||||
|
@ -128,7 +128,7 @@ static int action_left_input_desc_kbd(unsigned type, const char *label,
|
||||
remap_id =
|
||||
settings->uints.input_keymapper_ids[offset][id];
|
||||
|
||||
for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END -
|
||||
for (key_id = 0; key_id < RARCH_MAX_KEYS +
|
||||
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++)
|
||||
{
|
||||
if(remap_id == key_descriptors[key_id].key)
|
||||
@ -138,7 +138,7 @@ static int action_left_input_desc_kbd(unsigned type, const char *label,
|
||||
if (key_id > 0)
|
||||
key_id--;
|
||||
else
|
||||
key_id = MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
||||
key_id = RARCH_MAX_KEYS + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
||||
|
||||
settings->uints.input_keymapper_ids[offset][id] = key_descriptors[key_id].key;
|
||||
|
||||
|
@ -129,7 +129,7 @@ int action_right_input_desc_kbd(unsigned type, const char *label,
|
||||
break;
|
||||
}
|
||||
|
||||
if (key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN)
|
||||
if (key_id < RARCH_MAX_KEYS + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN)
|
||||
key_id++;
|
||||
else
|
||||
key_id = 0;
|
||||
|
@ -32,7 +32,7 @@ static void menu_cbs_init_log(const char *entry_label, const char *bind_label, c
|
||||
#endif
|
||||
}
|
||||
|
||||
struct key_desc key_descriptors[136] =
|
||||
struct key_desc key_descriptors[RARCH_MAX_KEYS] =
|
||||
{
|
||||
{RETROK_FIRST, "Unmapped"},
|
||||
{RETROK_BACKSPACE, "Backspace"},
|
||||
|
@ -208,7 +208,7 @@ enum menu_settings_type
|
||||
MENU_SETTINGS_INPUT_DESC_BEGIN,
|
||||
MENU_SETTINGS_INPUT_DESC_END = MENU_SETTINGS_INPUT_DESC_BEGIN + (MAX_USERS * (RARCH_FIRST_CUSTOM_BIND + 4)),
|
||||
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN,
|
||||
MENU_SETTINGS_INPUT_DESC_KBD_END = (MENU_SETTINGS_INPUT_DESC_KBD_BEGIN + 136) * MAX_USERS,
|
||||
MENU_SETTINGS_INPUT_DESC_KBD_END = (MENU_SETTINGS_INPUT_DESC_KBD_BEGIN + RARCH_MAX_KEYS) * MAX_USERS,
|
||||
|
||||
MENU_SETTINGS_SUBSYSTEM_LOAD,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user