From 1338e4467b3538de598223e98939147f62d96789 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 24 Mar 2021 19:35:51 +0100 Subject: [PATCH] Added support for controller analog sticks click. --- es-core/src/InputManager.cpp | 3 +++ es-core/src/components/HelpComponent.cpp | 1 + es-core/src/guis/GuiInputConfig.cpp | 6 +++--- resources/help/{analog_thumb.svg => analog_click.svg} | 0 4 files changed, 7 insertions(+), 3 deletions(-) rename resources/help/{analog_thumb.svg => analog_click.svg} (100%) diff --git a/es-core/src/InputManager.cpp b/es-core/src/InputManager.cpp index ed727ca15..d2126920f 100644 --- a/es-core/src/InputManager.cpp +++ b/es-core/src/InputManager.cpp @@ -413,6 +413,9 @@ void InputManager::loadDefaultKBConfig() cfg->mapInput("rightshoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEDOWN, 1, true)); cfg->mapInput("lefttrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_HOME, 1, true)); cfg->mapInput("righttrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_END, 1, true)); + + cfg->mapInput("leftanalogclick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F2, 1, true)); + cfg->mapInput("rightanalogclick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F3, 1, true)); } void InputManager::writeDeviceConfig(InputConfig* config) diff --git a/es-core/src/components/HelpComponent.cpp b/es-core/src/components/HelpComponent.cpp index 30ff0e363..0f63f611a 100644 --- a/es-core/src/components/HelpComponent.cpp +++ b/es-core/src/components/HelpComponent.cpp @@ -26,6 +26,7 @@ static const std::map ICON_PATH_MAP { { "up/down", ":/help/dpad_updown.svg" }, { "left/right", ":/help/dpad_leftright.svg" }, { "up/down/left/right", ":/help/dpad_all.svg" }, + { "analogclick", ":/help/analog_click.svg" }, { "a", ":/help/button_a.svg" }, { "b", ":/help/button_b.svg" }, { "x", ":/help/button_x.svg" }, diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index 308b79d5a..194a529a3 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -22,7 +22,7 @@ struct InputConfigStructure { std::string icon; }; -static const int inputCount = 22; +static const int inputCount = 24; static const InputConfigStructure GUI_INPUT_CONFIG_LIST[inputCount] = { @@ -40,16 +40,16 @@ static const InputConfigStructure GUI_INPUT_CONFIG_LIST[inputCount] = { "RightShoulder", true, "RIGHT SHOULDER", ":/help/button_r.svg" }, { "LeftTrigger", true, "LEFT TRIGGER", ":/help/button_lt.svg" }, { "RightTrigger", true, "RIGHT TRIGGER", ":/help/button_rt.svg" }, -// { "LeftThumb", true, "LEFT THUMB", ":/help/analog_thumb.svg" }, -// { "RightThumb", true, "RIGHT THUMB", ":/help/analog_thumb.svg" }, { "LeftAnalogUp", true, "LEFT ANALOG UP", ":/help/analog_up.svg" }, { "LeftAnalogDown", true, "LEFT ANALOG DOWN", ":/help/analog_down.svg" }, { "LeftAnalogLeft", true, "LEFT ANALOG LEFT", ":/help/analog_left.svg" }, { "LeftAnalogRight", true, "LEFT ANALOG RIGHT", ":/help/analog_right.svg" }, + { "LeftAnalogClick", true, "LEFT ANALOG CLICK", ":/help/analog_click.svg" }, { "RightAnalogUp", true, "RIGHT ANALOG UP", ":/help/analog_up.svg" }, { "RightAnalogDown", true, "RIGHT ANALOG DOWN", ":/help/analog_down.svg" }, { "RightAnalogLeft", true, "RIGHT ANALOG LEFT", ":/help/analog_left.svg" }, { "RightAnalogRight", true, "RIGHT ANALOG RIGHT", ":/help/analog_right.svg" }, + { "RightAnalogClick", true, "RIGHT ANALOG CLICK", ":/help/analog_click.svg" }, // { "HotKeyEnable", true, "HOTKEY ENABLE", ":/help/button_hotkey.svg" } }; diff --git a/resources/help/analog_thumb.svg b/resources/help/analog_click.svg similarity index 100% rename from resources/help/analog_thumb.svg rename to resources/help/analog_click.svg