Silence unmapped keybind mappings and add XBox paddles (#3121)

This commit is contained in:
kalaposfos13 2025-06-19 20:35:28 +02:00 committed by GitHub
parent e389d03601
commit 6d65ea7314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -32,6 +32,8 @@
#define KEY_TOGGLE 0x00200000 #define KEY_TOGGLE 0x00200000
#define SDL_UNMAPPED UINT32_MAX - 1
namespace Input { namespace Input {
using Input::Axis; using Input::Axis;
using Libraries::Pad::OrbisPadButtonDataOffset; using Libraries::Pad::OrbisPadButtonDataOffset;
@ -102,6 +104,10 @@ const std::map<std::string, u32> string_to_cbutton_map = {
// this is only for input // this is only for input
{"back", SDL_GAMEPAD_BUTTON_BACK}, {"back", SDL_GAMEPAD_BUTTON_BACK},
{"lpaddle_high", SDL_GAMEPAD_BUTTON_LEFT_PADDLE1},
{"lpaddle_low", SDL_GAMEPAD_BUTTON_LEFT_PADDLE2},
{"rpaddle_high", SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1},
{"rpaddle_low", SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2},
}; };
const std::map<std::string, AxisMapping> string_to_axis_map = { const std::map<std::string, AxisMapping> string_to_axis_map = {
@ -225,6 +231,7 @@ const std::map<std::string, u32> string_to_keyboard_key_map = {
{"kpenter", SDLK_KP_ENTER}, {"kpenter", SDLK_KP_ENTER},
{"kpequals", SDLK_KP_EQUALS}, {"kpequals", SDLK_KP_EQUALS},
{"capslock", SDLK_CAPSLOCK}, {"capslock", SDLK_CAPSLOCK},
{"unmapped", SDL_UNMAPPED},
}; };
void ParseInputConfig(const std::string game_id); void ParseInputConfig(const std::string game_id);

View file

@ -131,6 +131,8 @@ Controller:
Buttons: Buttons:
'triangle', 'circle', 'cross', 'square', 'l1', 'l3', 'triangle', 'circle', 'cross', 'square', 'l1', 'l3',
'options', touchpad', 'up', 'down', 'left', 'right' 'options', touchpad', 'up', 'down', 'left', 'right'
Input-only:
'lpaddle_low', 'lpaddle_high'
Axes if you bind them to a button input: Axes if you bind them to a button input:
'axis_left_x_plus', 'axis_left_x_minus', 'axis_left_y_plus', 'axis_left_y_minus', 'axis_left_x_plus', 'axis_left_x_minus', 'axis_left_y_plus', 'axis_left_y_minus',
'axis_right_x_plus', ..., 'axis_right_y_minus', 'axis_right_x_plus', ..., 'axis_right_y_minus',