Skip to content

wip: emulate steam_input through sdl3#242

Open
f8ith wants to merge 5 commits intoDetanup01:devfrom
f8ith:dev
Open

wip: emulate steam_input through sdl3#242
f8ith wants to merge 5 commits intoDetanup01:devfrom
f8ith:dev

Conversation

@f8ith
Copy link
Copy Markdown

@f8ith f8ith commented Jun 3, 2025

Very WIP PR, currently handles most of the major controller types. Tested to work on Elden Ring Nightreign with a stock Dualsense.

Implements

  • Querying controller types and connected controllers
  • Rumble
  • Action set layers
  • GetActionOrigins, GetGlyphForActionOrigin, GetActionOriginFromXboxOrigin....

Note on XInput Emulation

Real steam emulates Xinput for non-Xinput gamepads on windows. We could attempt to do the same by hooking Xinput same way that Steam does, but it's tricky and would only work well on experimental builds most likely

TODO

  • Fix reconnecting controllers
  • Implement action layers -> fixes gamepad detection
  • Loading action set layers
  • Test rumble
  • Customizable deadzone, layers, etc.

- steam_input emulation with sdl3 instead of gamepad.c
- implemented ActionSetLayers
- added configurable deadzone under main::gamepad
@f8ith
Copy link
Copy Markdown
Author

f8ith commented Jun 8, 2025

Not sure why protoc is failing on github actions but builds fine locally

@universal963
Copy link
Copy Markdown
Collaborator

Not sure why protoc is failing on github actions but builds fine locally

The deps cache in Github Actions has now been regenerated, and PR #249 builds successfully.

@item520
Copy link
Copy Markdown

item520 commented Jul 11, 2025

I hope to achieve the controller effect of RUNE. RUNE can customize the controller type, but some require Steam input, which still doesn't work. For example, although the PS5 controller can be played with, it still simulates XBinput because the touchpad doesn't support it, and linear triggers don't support many games. I have tested that the touchpad of the PS5 controller is invalid, but it can recognize it, but everything works normally with GLR

@ilcheese2
Copy link
Copy Markdown

Is this still being worked on? I was trying to build for Mac but I'd have to port the gamepad library.

@item520
Copy link
Copy Markdown

item520 commented Jan 17, 2026

这还在进行中吗?我本来想为Mac开发,但得把手柄库移植。

I think it would be great if we could finally handle the selection of controller characters. For the rest, we could convert to SDL, so that we can set up our own controller mode patterns that developers don't have options for in the game

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Jan 21, 2026

Is this still being worked on? I was trying to build for Mac but I'd have to port the gamepad library.

in terms of emulating the basic steam input api itself, the code should be relatively complete though a little messy but rumble + multiple controller still hasn't been tested because I do not have access to those things/a game with rumble myself right now.

What do you mean by porting the gamepad library? sdl3 should be crossplatform though you may need to edit the build script

@ilcheese2
Copy link
Copy Markdown

I was talking about the library that is currently used. I ended up implementing the functions with Apple's Game Controller Framework, and it built, but I haven't verified whether it works.

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Jan 21, 2026

This PR should remove the need for libgamepad. With SDL iirc there shouldn't be any relevant code that references libgamepad anymore.

@utkarshdalal
Copy link
Copy Markdown

utkarshdalal commented Jan 23, 2026

Curious about this one, would it fix issues where games aren't detecting the gamepad? I just opened an issue for this for No Man's Sky. If it's complete and we're only waiting to see if rumble works, I could request someone to test for you, or we could put the new implementation behind a flag like sdl3_input=1 (0 by default, legacy input)

@utkarshdalal
Copy link
Copy Markdown

@f8ith sorry for the ping, but would love your thoughts on the message above! ^

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Jan 27, 2026

would it fix issues where games aren't detecting the gamepad?

It should enable controller functionality, this PR stubs/implements most steam input function calls. You could try using the compiled dlls

add a flag like sdl3_input=1

Since I already have added a couple settings for other functionality I could add this in probably within this week

@utkarshdalal
Copy link
Copy Markdown

utkarshdalal commented Jan 27, 2026

Where could I get the compiled DLLs?

I'd also love to learn more about what the changes do if you're open to sharing, so I can contribute too.

@Detanup01
Copy link
Copy Markdown
Owner

Hey If you add rumble (AND IF Works with Xbox controllers) I can test them with a new test "game" that just start rambling your controller for X sec if has one & etc.

No DLLs being made since the PR is in Draft mode. (Made by author)

@f8ith f8ith marked this pull request as ready for review February 4, 2026 23:50
@f8ith
Copy link
Copy Markdown
Author

f8ith commented Feb 5, 2026

@Detanup01 the rumble should already work theoretically. My branch should now build correctly

About action_set_layers

Right now the action_set_layers is essentially stubbed. I don't see a point in implementing this fully since games seems to work fine now

@utkarshdalal
Copy link
Copy Markdown

@f8ith i think there are conflicts that would need to be resolved.

If you want to send me over the dlls (preferably for the experimental steamclient) I can test on a few games that aren't working currently!

@Detanup01
Copy link
Copy Markdown
Owner

well need to fix conflicts but if you build in your end to windows x64 debug i appricite if you upload to anywhere currently MS suck ass with not supporting vs26 build yet so all my things on-hold and current dev env is fucked cus of it.

tlrd:
If you upload your build to anywhere i can download and test your stuff via custom script

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Feb 8, 2026

Published a debug x64 build at https://github.com/f8ith/gbe_fork/releases/tag/2026-02-08

@item520
Copy link
Copy Markdown

item520 commented Feb 9, 2026

Published a debug x64 build at https://github.com/f8ith/gbe_fork/releases/tag/2026-02-08

INAZUMA ELEVEN Victory Road no works
STEAM_LOG_2498165777.zip

@Detanup01
Copy link
Copy Markdown
Owner

Real steam
image
vs
your gbe build
image

Basicly this, it isnt getting my controller whatever I do.

Code / call is basicly this
// steam ini & runcallback before calling any steam function.
Steam_Controller::Init() 1
Steam_Controller::GetConnectedControllers()
Steam_Controller::TriggerHapticPulse() // TODO
Steam_Controller::TriggerVibration() 10000 10000
Steam_Controller::Shutdown()

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Feb 9, 2026

Perhaps I unintentionally changed something when making the build after so long. Are the test scripts in the repo so that I can test it myself

@item520
Copy link
Copy Markdown

item520 commented Feb 10, 2026

也许我在制作构建时无意中改动了什么。测试脚本在仓库里吗?这样我就能自己测试了

Can we just add the option to select font styles in the controller, and use external plugins for other conversions

Force a controller type, which will mainly override shown glpyhs, if used by the game

Possible values: Xbox360, XboxOne, PS3, PS4, PS5, SwitchPro, Generic

#ForceController=XboxOne

@utkarshdalal
Copy link
Copy Markdown

Hi @f8ith any update here? happy to help out if needed. Just noticed you said it works with Elden Ring Nightreign which would be a big win for me!

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Feb 21, 2026

After rebasing again I'm getting errors from protobuf externs. Once I get it to build I can make my own tests, but fyi my build at June 2025 worked completely fine for me in Elden Ring: Nightreign on a stock Dualsense over USB + BT, not sure what changed between then and now or if it's an issue related to Xbox controllers.

@utkarshdalal
Copy link
Copy Markdown

Can I help somehow?

@item520
Copy link
Copy Markdown

item520 commented Feb 24, 2026

重新按底后,我遇到了 protobuf externs 的错误。一旦我组装好了,我可以自己做测试,但顺便说一句,我在2025年6月的版本在《艾尔登法环:夜之统治》中用原装Dualsense通过USB+蓝牙运行完全正常,不确定从那时到现在之间发生了什么变化,或者是不是Xbox手柄的问题。

Do you only offer an option to modify internal font icons? In many game settings, glyphs cannot be changed. I can use DSX to simulate XINPUT, but I cannot set the game's controller type

@f8ith
Copy link
Copy Markdown
Author

f8ith commented Feb 24, 2026

Controller glyphs are entirely game dependent. Forcing a certain controller type is an entirely separate issue from what this PR is trying to achieve and generally requires mods

你需要的东西是游戏普丁,展示什么图案不关这软件的事

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants