[PR #1078] [MERGED] Add SDL_Joystick support #305

Open
opened 2026-01-29 19:07:18 +00:00 by claunia · 0 comments
Owner

📋 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: masterHead: sdl-joystick-support


📝 Commits (3)

  • 99ec667 Factorize input hooks into reusable monitor classes
  • 2880b71 Support for SDL Joysticks
  • 086f251 Tidy 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.

## 📋 Pull Request Information **Original PR:** https://github.com/stenzek/duckstation/pull/1078 **Author:** [@CookiePLMonster](https://github.com/CookiePLMonster) **Created:** 11/15/2020 **Status:** ✅ Merged **Merged:** 11/21/2020 **Merged by:** [@stenzek](https://github.com/stenzek) **Base:** `master` ← **Head:** `sdl-joystick-support` --- ### 📝 Commits (3) - [`99ec667`](https://github.com/stenzek/duckstation/commit/99ec667b208500f1d59d7a4650e414d28f26110b) Factorize input hooks into reusable monitor classes - [`2880b71`](https://github.com/stenzek/duckstation/commit/2880b71b485adbe33657d88d49ea104c51df144b) Support for SDL Joysticks - [`086f251`](https://github.com/stenzek/duckstation/commit/086f251370a6a0ccf6062395d0b98df88f04ec20) Tidy up SDL controller methods interface ### 📊 Changes **17 files changed** (+700 additions, -180 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 19:07:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#305