mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
[PR #1078] [MERGED] Add SDL_Joystick support #305
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stenzek/duckstation/pull/1078
Author: @CookiePLMonster
Created: 11/15/2020
Status: ✅ Merged
Merged: 11/21/2020
Merged by: @stenzek
Base:
master← Head:sdl-joystick-support📝 Commits (3)
99ec667Factorize input hooks into reusable monitor classes2880b71Support for SDL Joysticks086f251Tidy up SDL controller methods interface📊 Changes
17 files changed (+700 additions, -180 deletions)
View changed files
📝
src/core/negcon.cpp(+2 -3)📝
src/duckstation-qt/CMakeLists.txt(+2 -0)📝
src/duckstation-qt/duckstation-qt.vcxproj(+2 -0)📝
src/duckstation-qt/duckstation-qt.vcxproj.filters(+2 -0)📝
src/duckstation-qt/inputbindingdialog.cpp(+17 -46)📝
src/duckstation-qt/inputbindingdialog.h(+3 -1)➕
src/duckstation-qt/inputbindingmonitor.cpp(+148 -0)➕
src/duckstation-qt/inputbindingmonitor.h(+64 -0)📝
src/duckstation-qt/inputbindingwidgets.cpp(+18 -55)📝
src/duckstation-qt/inputbindingwidgets.h(+3 -1)📝
src/frontend-common/common_host_interface.cpp(+57 -10)📝
src/frontend-common/controller_interface.cpp(+5 -3)📝
src/frontend-common/controller_interface.h(+17 -4)📝
src/frontend-common/sdl_controller_interface.cpp(+328 -36)📝
src/frontend-common/sdl_controller_interface.h(+16 -9)📝
src/frontend-common/xinput_controller_interface.cpp(+12 -10)📝
src/frontend-common/xinput_controller_interface.h(+4 -2)📄 Description
This PR needs testing with libretro and NeGcon controllers! The range of I/II buttons has been modified so I can't guarantee there are no regressions.
This PR refactors and extends the SDL controller interface to not only support GameController peripherals, but also Joystick ones. This allows users to use various peripherals which don't fit the standardized game controller interface.
This PR was only tested with a steering wheel, but in theory it should make it possible to use e.g. flight sticks or other devices matching the official ones for PS1.
It's possible that the new extended mapping heuristics don't cover all possible cases, but I have verified that mapping works as expected e.g. with both separate pedal axes as well as combined axes. Inverted axes are also now supported.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.