Controlling DS4 input programmatically (PC)
-
@harry said in Controlling DS4 input programmatically (PC):
All calls but one seem to be working fine. Specifically, VIGEM_API BOOL vigem_target_is_attached(PVIGEM_TARGET target); never returns true, even when the target is actually attached and I can send reports to it. Perhaps I got the API wrong?
Oh? That's odd, it's expected to return
TRUE
when the bus has brought it to working stage. This application uses the API so I suspect it to function properly@harry said in Controlling DS4 input programmatically (PC):
Isn't that API call supposed to be used right after a vigem_target_add call (with polling for instance) to ensure that the device is attached before starting to send reports?
vigem_target_add
is blocking until the device is truly operational and callingvigem_target_is_attached
afterwards is expected to returnTRUE
.Cheers
-
-
@nefarius said in Controlling DS4 input programmatically (PC):
@harry said in Controlling DS4 input programmatically (PC):
All calls but one seem to be working fine. Specifically, VIGEM_API BOOL vigem_target_is_attached(PVIGEM_TARGET target); never returns true, even when the target is actually attached and I can send reports to it. Perhaps I got the API wrong?
Oh? That's odd, it's expected to return
TRUE
when the bus has brought it to working stage. This application uses the API so I suspect it to function properlyIn fact, I used that code as a reference and I was expecting it to work like you described, but it didn't. Everything else is working fine. I've actually integrated it with some tools that I have and it works like a charm.
Hats off to you sir! You've done an excellent job
I'll try that specific API again, see if I did something wrong in the first place.
-
@harry said in Controlling DS4 input programmatically (PC):
Hats off to you sir! You've done an excellent job
Years of
stealingstudying other peoples C/C++ code got me there, and for my first real public API it's surprisingly solid and even considers backwards compatibility, the wet dream of every Windows developerBut thanks, appreciate it.
If it still bombs for whatever reason maybe we can spin up a quick debugging session; I'm always on the bug-hunt
-
This post is deleted! -
Had to signup to thank you for this...
within 20 minutes, I had it installed and sending buttons to remote play.
then...
Used a real xbox one controller with xinput, and mapped all the controls.now have a nice little app to let you use remote play with an xbox controller, without having a real PS4 controller plugged in.
-
ran into a problem...
I can't get the trigger buttons to work.
tried all the combos below:
report.SetAxis(DualShock4Axes.RightTrigger, 255);
report.RightTrigger = 255;
report.SetButtonState(DualShock4Buttons.TriggerRight, true);all the other buttons work flawless...so IDK
some info:
Windows 10 1809 - 17763.348
PS4 Pro 6.50
Driver 1.14.3.0 (untouched and signed by you)I really don't know if it worked a few days ago before the PS4 updated to 6.5
any idea?
-
made a new test app...
winform + timer
https://pastebin.com/Tw2dV7asQuick map of keyboard WSAD + numpad to test trigger.
triggers do work local, but remote play doesn't...
ran a game I know uses PS4 controllers local(axiom verge) + remote play.
video here:
Youtube Videonotice the stick movement works on both..but when I "press" the trigger
*axiom verge works (laser) (local)
*remote play not working(diablo) should shot out 360 knifes -
I figured it out!
Checked the windows controller settings and noticed these 2 buttons didn't light up on my emulated controller.
*did light up on a real controlleradded the following code:
byte lt = XtoP2(xbox.Triggers.Left);//convert float (0-1) to byte (0-255) byte rt = XtoP2(xbox.Triggers.Right); report.LeftTrigger = lt; report.RightTrigger = rt; if (lt > 0) report.SetButtonState(DualShock4Buttons.TriggerLeft, true); else report.SetButtonState(DualShock4Buttons.TriggerLeft, false); if (rt > 0) report.SetButtonState(DualShock4Buttons.TriggerRight, true); else report.SetButtonState(DualShock4Buttons.TriggerRight, false);
working now.
didn't realize triggers have an axis and button assigned to the same button.
-
@BOCS Cool! That needs documentation then I guess