[PR #2550] [CLOSED] Support for multiple controllers and players #2819

Closed
opened 2026-02-27 22:01:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2550
Author: @kalaposfos13
Created: 2/27/2025
Status: Closed

Base: mainHead: multiple-controllers


📝 Commits (10+)

📊 Changes

15 files changed (+700 additions, -611 deletions)

View changed files

📝 src/common/config.cpp (+82 -62)
📝 src/common/config.h (+2 -2)
📝 src/core/libraries/np/np_manager.cpp (+3 -2)
📝 src/core/libraries/pad/pad.cpp (+58 -43)
📝 src/core/libraries/system/userservice.cpp (+34 -16)
📝 src/core/libraries/system/userservice.h (+3 -1)
📝 src/emulator.cpp (+2 -2)
📝 src/emulator.h (+2 -2)
📝 src/imgui/renderer/imgui_impl_sdl3.cpp (+3 -4)
📝 src/input/controller.cpp (+152 -81)
📝 src/input/controller.h (+39 -28)
📝 src/input/input_handler.cpp (+124 -95)
📝 src/input/input_handler.h (+98 -9)
📝 src/sdl_window.cpp (+93 -244)
📝 src/sdl_window.h (+5 -20)

📄 Description

Edit: this description is outdated, don't take everything in it as the current state of this PR.

Contains:

  • replacing a whole lot of things that were just a global with a 4 long array global
  • implementing sceUserServiceGetEvent to handle users connecting/disconnecting (only half done, currently you need to specify the number of players from config
  • Even more shit added to remapping, this time a new field denoting the controller ID for the input or output (for inputs it only concerns gamepads, as those are the only ones that you can connect more than one of)
  • reverts ngoquang's engine, as it's currently unused, and I didn't want to deal with yet another system that had to be updated
  • Non-remappable controls now work correctly

What's missing yet:

  • Handling connecting and disconnecting controllers properly
  • Compatibility with rainmaker's controller selection code

How to use:

  • If you use controllers, all of them will default to the mapping that's set in the remap file
  • If you use the keyboard, you can set inputs to go to a certain controller by adding : <controllerNumber> after the output. Example:
axis_left_x_minus = a
axis_left_x_plus = d
axis_left_y_minus = w
axis_left_y_plus = s

axis_left_x_minus : 2 = j
axis_left_x_plus : 2 = l
axis_left_y_minus : 2  = i
axis_left_y_plus : 2 = k

🔄 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/shadps4-emu/shadPS4/pull/2550 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 2/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `multiple-controllers` --- ### 📝 Commits (10+) - [`180a348`](https://github.com/shadps4-emu/shadPS4/commit/180a34808a2ad1cf63d6f24b4fcaeadedd892e85) Multiple controllers v0 - [`8cc101b`](https://github.com/shadps4-emu/shadPS4/commit/8cc101b3b0ea7b0ddc17016722f2d9f97d9b95e0) clang - [`c1bb630`](https://github.com/shadps4-emu/shadPS4/commit/c1bb630dfdaaeefb8aa10d7d87605621a24fe604) Make non-remappable inputs work - [`303b4c4`](https://github.com/shadps4-emu/shadPS4/commit/303b4c4ce2a676ae0af2506edd619db7ee79702e) Correctly handle sceUserServiceGetLoginUserIdList - [`f04cdd7`](https://github.com/shadps4-emu/shadPS4/commit/f04cdd7cc89d0e8adaa47cbb6c5acdacf6792113) clang - [`a2264e9`](https://github.com/shadps4-emu/shadPS4/commit/a2264e9bd0835cd23ef2f9df847185104ee59d24) Cleanup - [`c9ece44`](https://github.com/shadps4-emu/shadPS4/commit/c9ece44207bfd19e249e7554121f7d97760f8091) really - [`c05a522`](https://github.com/shadps4-emu/shadPS4/commit/c05a5223ca63acbb855f96be683e8251089973b6) Stash - [`7d80d13`](https://github.com/shadps4-emu/shadPS4/commit/7d80d133eba761eaee5dc4c6be4316396f87bae5) More logging - [`e924817`](https://github.com/shadps4-emu/shadPS4/commit/e92481770cc2940b61f9bda5ccc39e7600bf13cf) clang ### 📊 Changes **15 files changed** (+700 additions, -611 deletions) <details> <summary>View changed files</summary> 📝 `src/common/config.cpp` (+82 -62) 📝 `src/common/config.h` (+2 -2) 📝 `src/core/libraries/np/np_manager.cpp` (+3 -2) 📝 `src/core/libraries/pad/pad.cpp` (+58 -43) 📝 `src/core/libraries/system/userservice.cpp` (+34 -16) 📝 `src/core/libraries/system/userservice.h` (+3 -1) 📝 `src/emulator.cpp` (+2 -2) 📝 `src/emulator.h` (+2 -2) 📝 `src/imgui/renderer/imgui_impl_sdl3.cpp` (+3 -4) 📝 `src/input/controller.cpp` (+152 -81) 📝 `src/input/controller.h` (+39 -28) 📝 `src/input/input_handler.cpp` (+124 -95) 📝 `src/input/input_handler.h` (+98 -9) 📝 `src/sdl_window.cpp` (+93 -244) 📝 `src/sdl_window.h` (+5 -20) </details> ### 📄 Description Edit: this description is outdated, don't take everything in it as the current state of this PR. Contains: - replacing a whole lot of things that were just a global with a 4 long array global - implementing sceUserServiceGetEvent to handle users connecting/disconnecting (only half done, currently you need to specify the number of players from config - Even more shit added to remapping, this time a new field denoting the controller ID for the input or output (for inputs it only concerns gamepads, as those are the only ones that you can connect more than one of) - reverts ngoquang's engine, as it's currently unused, and I didn't want to deal with yet another system that had to be updated - Non-remappable controls now work correctly What's missing yet: - Handling connecting and disconnecting controllers properly - Compatibility with rainmaker's controller selection code How to use: - If you use controllers, all of them will default to the mapping that's set in the remap file - If you use the keyboard, you can set inputs to go to a certain controller by adding ` : <controllerNumber>` after the output. Example: ``` axis_left_x_minus = a axis_left_x_plus = d axis_left_y_minus = w axis_left_y_plus = s axis_left_x_minus : 2 = j axis_left_x_plus : 2 = l axis_left_y_minus : 2 = i axis_left_y_plus : 2 = k ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2819
No description provided.