Skip to content

Commit

Permalink
Add keybinds for all 128 logical buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
XerTheSquirrel committed Dec 25, 2023
1 parent f802658 commit 4229354
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 10 deletions.
65 changes: 56 additions & 9 deletions config.def.keybinds.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,36 @@
#ifndef __CONFIG_DEF_KEYBINDS_H
#define __CONFIG_DEF_KEYBINDS_H

#define JOYPAD_LOGICAL_ENTRY(note) {\
NULL, NULL,\
AXIS_NONE, AXIS_NONE, AXIS_NONE,\
MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LOGICAL, RETROK_UNKNOWN,\
RARCH_EXTRA_CORE_COMMAND_START, NO_BTN, NO_BTN, 0,\
true\
}
#define JOYPAD_LOGICAL_ENTRY_TEN(note) \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY(), \
JOYPAD_LOGICAL_ENTRY()
#define JOYPAD_LOGICAL_ENTRY_HUNDRED(note) \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN(), \
JOYPAD_LOGICAL_ENTRY_TEN()

#ifndef IS_SALAMANDER

/* User 1 */
Expand Down Expand Up @@ -1928,14 +1958,18 @@ static const struct retro_keybind retro_keybinds_1[] = {
true
},


{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_INPUT_ANALOG_SENSITIVITY, RETROK_UNKNOWN,
RARCH_EXTRA_CORE_COMMAND_START, NO_BTN, NO_BTN, 0,
true
},
/* 128 Logical extra joypad buttons. */
JOYPAD_LOGICAL_ENTRY_HUNDRED(0 - 99),
JOYPAD_LOGICAL_ENTRY_TEN(100 - 109),
JOYPAD_LOGICAL_ENTRY_TEN(110 - 119),
JOYPAD_LOGICAL_ENTRY(120),
JOYPAD_LOGICAL_ENTRY(121),
JOYPAD_LOGICAL_ENTRY(122),
JOYPAD_LOGICAL_ENTRY(123),
JOYPAD_LOGICAL_ENTRY(124),
JOYPAD_LOGICAL_ENTRY(125),
JOYPAD_LOGICAL_ENTRY(126),
JOYPAD_LOGICAL_ENTRY(127),

#if 0
/* Deprecated */
Expand Down Expand Up @@ -2208,10 +2242,23 @@ static const struct retro_keybind retro_keybinds_rest[] = {
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_INPUT_SMALL_KEYBOARD_ENABLE, RETROK_UNKNOWN,
MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LOGICAL, RETROK_UNKNOWN,
RARCH_EXTRA_CORE_COMMAND_START, NO_BTN, NO_BTN, 0,
true
},

/* 128 Logical extra joypad buttons. */
JOYPAD_LOGICAL_ENTRY_HUNDRED(0 - 99),
JOYPAD_LOGICAL_ENTRY_TEN(100 - 109),
JOYPAD_LOGICAL_ENTRY_TEN(110 - 119),
JOYPAD_LOGICAL_ENTRY(120),
JOYPAD_LOGICAL_ENTRY(121),
JOYPAD_LOGICAL_ENTRY(122),
JOYPAD_LOGICAL_ENTRY(123),
JOYPAD_LOGICAL_ENTRY(124),
JOYPAD_LOGICAL_ENTRY(125),
JOYPAD_LOGICAL_ENTRY(126),
JOYPAD_LOGICAL_ENTRY(127),
};

#endif
Expand Down
2 changes: 1 addition & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ enum midi_driver_enum
#define DECLARE_EXTRA_BIND_STRINGY(a) DECLARE_EXTRA_BIND_STRINGY2(a)

/** Declare an extra logical bind, the label used depends on the core. */
#define DECLARE_EXTRA_BIND(id) {DECLARE_EXTRA_BIND_STRINGY(DECLARE_EXTRA_BIND_PASTE(log, id)), MENU_ENUM_LABEL_VALUE_INPUT_KEY, 0, id, true }
#define DECLARE_EXTRA_BIND(id) {DECLARE_EXTRA_BIND_STRINGY(DECLARE_EXTRA_BIND_PASTE(log, id)), MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LOGICAL, 0, id, true }

/** Declare ten binds. */
#define DECLARE_EXTRA_BIND_10(dig) \
Expand Down
6 changes: 6 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -15970,3 +15970,9 @@ MSG_HASH(
MSG_IOS_TOUCH_MOUSE_DISABLED,
"Touch mouse is disabled"
)

/* Extra logical buttons. */
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LOGICAL,
"Logical Button %d"
)
3 changes: 3 additions & 0 deletions msg_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -4121,6 +4121,9 @@ enum msg_hash_enums
MSG_3DS_BOTTOM_MENU_SAVE_STATE,
MSG_3DS_BOTTOM_MENU_LOAD_STATE,

/* Logical menu input. */
MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LOGICAL,

MSG_LAST,

/* Ensure sizeof(enum) == sizeof(int) */
Expand Down

0 comments on commit 4229354

Please sign in to comment.