Skip to content

Support impulse triggers via Steam Input#6

Open
Monkatraz wants to merge 1 commit into
andrew-ld:masterfrom
Monkatraz:master
Open

Support impulse triggers via Steam Input#6
Monkatraz wants to merge 1 commit into
andrew-ld:masterfrom
Monkatraz:master

Conversation

@Monkatraz

@Monkatraz Monkatraz commented Dec 8, 2024

Copy link
Copy Markdown

Fixes #4

This PR is not that big it's just due to including all of the Steam API headers.

You may need to make changes on this PR depending on how you're compiling this or differences between my compiling-through-wine-system vs the Windows VM. It shouldn't be too bad though.

Also, first time doing anything with C++ woot lol this language is unbelievably cursed

@Monkatraz

Copy link
Copy Markdown
Author

Here is the DLL I've compiled in case anyone wants to try it.

gameinput.zip

@Monkatraz

Copy link
Copy Markdown
Author

Also, @Kaldaien you may find this interesting.

@andrew-ld

Copy link
Copy Markdown
Owner

thanks for the pr, generally the code is pretty good.
could you fix these warnings reported by visual studio.

Build started at 6:36 PM...
1>------ Build started: Project: gameinput2xinput, Configuration: Debug x64 ------
1>pch.cpp
1>dllmain.cpp
1>Z:\host\fork\dllmain.cpp(110,59): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
1>(compiling source file '/dllmain.cpp')
1>Z:\host\fork\dllmain.cpp(128,26): warning C4018: '>': signed/unsigned mismatch
1>(compiling source file '/dllmain.cpp')
1>   Creating library Z:\host\fork\x64\Debug\gameinput2xinput.lib and object Z:\host\fork\x64\Debug\gameinput2xinput.exp
1>gameinput2xinput.vcxproj -> Z:\host\fork\x64\Debug\gameinput2xinput.dll
1>Done building project "gameinput2xinput.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 6:36 PM and took 02.210 seconds ==========

@Monkatraz

Copy link
Copy Markdown
Author

ah I don't get those when I build, will TAL

@andrew-ld

Copy link
Copy Markdown
Owner
if (pSteamInput()->GetInputTypeForHandle(handle) == k_ESteamInputType_XBoxOneController)
  pSteamInput()->TriggerVibrationExtended(handle, low, high, left, right);
else
  pSteamInput()->TriggerVibrationExtended(handle, low, highMixed, 0, 0);

I don't understand why different things need to be done based on the controller. Doesn't SteamInput abstract controllers and provide the same API for all of them?

@Monkatraz

Copy link
Copy Markdown
Author

It does do that but I'm 99% sure that the left right trigger vibration is ignored on non-compatible controllers, and doing it like this ensures you get at least some effect, previous to how we merged things before with xinput vibration

@Monkatraz

Copy link
Copy Markdown
Author

I'm pretty busy with work right now so if you want to push this ahead and make the changes needed go ahead, I've enabled edits by maintainers so you can push to this branch. I will probably get to this this week otherwise

@andrew-ld

Copy link
Copy Markdown
Owner

in the next few days I will fix the warnings and merge the code

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.

Long-shot: Support Impulse Triggers / Adaptive Triggers

2 participants