Skip to content

Commit 16470e5

Browse files
committed
Merge branch 'input_enhancements'
This PR adds extended input configuration support (analog, triggers, X, Y). It can be enabled by the `EXTENDED_INPUT_CFG` CMake configuration flag. Based partially on the patch by Florian.
2 parents b6724dc + 36f0640 commit 16470e5

File tree

14 files changed

+150
-25
lines changed

14 files changed

+150
-25
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ if(XDG_ON_OSX)
6565
add_definitions(-DUSE_XDG_OSX)
6666
endif()
6767

68+
option(EXTENDED_INPUT_CFG "Extended input config (analog, triggers, XY)" OFF)
69+
if(EXTENDED_INPUT_CFG)
70+
add_definitions(-DEXTENDED_INPUT_CFG)
71+
endif()
72+
6873
#-------------------------------------------------------------------------------
6974

7075
# Require C++11

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ When you first start EmulationStation, you will be prompted to configure an inpu
9898

9999
1. Hold a button on the device you want to configure. This includes the keyboard.
100100

101-
2. Press the buttons as they appear in the list. Some inputs can be skipped by holding any button down for a few seconds (e.g. page up/page down).
101+
2. Press the buttons as they appear in the list. Some inputs can be skipped by holding any button down for a few seconds (e.g. left/right shoulders).
102102

103103
3. You can review your mappings by pressing up and down, making any changes by pressing A.
104104

Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

data/resources/help/analog_up.svg

Lines changed: 17 additions & 0 deletions
Loading

es-app/src/components/TextListComponent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,20 +242,20 @@ bool TextListComponent<T>::input(InputConfig* config, Input input)
242242
listInput(-1);
243243
return true;
244244
}
245-
if(config->isMappedTo("pagedown", input))
245+
if(config->isMappedTo("rightshoulder", input))
246246
{
247247
listInput(10);
248248
return true;
249249
}
250250

251-
if(config->isMappedTo("pageup", input))
251+
if(config->isMappedTo("leftshoulder", input))
252252
{
253253
listInput(-10);
254254
return true;
255255
}
256256
}else{
257257
if(config->isMappedTo("down", input) || config->isMappedTo("up", input) ||
258-
config->isMappedTo("pagedown", input) || config->isMappedTo("pageup", input))
258+
config->isMappedTo("rightshoulder", input) || config->isMappedTo("leftshoulder", input))
259259
{
260260
stopScrolling();
261261
}

es-core/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ set(EMBEDDED_ASSET_SOURCES
121121
${emulationstation-all_SOURCE_DIR}/data/converted/frame_png.cpp
122122
${emulationstation-all_SOURCE_DIR}/data/converted/scroll_gradient_png.cpp
123123

124+
${emulationstation-all_SOURCE_DIR}/data/converted/help_analog_left_svg.cpp
125+
${emulationstation-all_SOURCE_DIR}/data/converted/help_analog_right_svg.cpp
126+
${emulationstation-all_SOURCE_DIR}/data/converted/help_analog_up_svg.cpp
127+
${emulationstation-all_SOURCE_DIR}/data/converted/help_analog_down_svg.cpp
128+
${emulationstation-all_SOURCE_DIR}/data/converted/help_analog_thumb_svg.cpp
124129
${emulationstation-all_SOURCE_DIR}/data/converted/help_button_a_svg.cpp
125130
${emulationstation-all_SOURCE_DIR}/data/converted/help_button_b_svg.cpp
126131
${emulationstation-all_SOURCE_DIR}/data/converted/help_button_x_svg.cpp

es-core/src/InputManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ void InputManager::loadDefaultKBConfig()
287287
cfg->mapInput("start", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F1, 1, true));
288288
cfg->mapInput("select", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F2, 1, true));
289289

290-
cfg->mapInput("pageup", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHTBRACKET, 1, true));
291-
cfg->mapInput("pagedown", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFTBRACKET, 1, true));
290+
cfg->mapInput("leftshoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHTBRACKET, 1, true));
291+
cfg->mapInput("rightshoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFTBRACKET, 1, true));
292292
}
293293

294294
void InputManager::writeDeviceConfig(InputConfig* config)

0 commit comments

Comments
 (0)