fossephate / JoyCon-Driver

A vJoy feeder for the Nintendo Switch JoyCons and Pro Controller
https://fosse.co/latest.zip
MIT License
1.07k stars 196 forks source link

Dualshock 4 emulation #43

Open CrPO4 opened 6 years ago

CrPO4 commented 6 years ago

I don't know if this is the right place to write this, since this project depends on vJoy, and as far as my knowledge goes - it's not possible to "emulate" Dualshock on that without tinkering with project and building it manually, but I'd like to describe the idea anyways.

First of all, what is the point of this? The thing is, Dualshock 4 is the only controller besides Steam Controller that has gyro support via Steam Controller Configurator. Why would I want to use that? Because it allows to use gyro in conjunction with regular controls, instead of regular "gyro OR regular controls". Also, the Steam Controller Configurator will allow user to switch between single/dual Joy-Con mode more easily - it will be possible to make "mirrored JoyCons" config for single mode, and "Independent Joy-Cons" for dual mode, it also will allow to use Joy-Cons on Desktop (browsing Internet, for example) more conveniently.

A lot of cool things come with this feature, and I'd like to ask if it's ever planned or even possible to implement.

Sorry if what I've just said sounds stupid though.

fossephate commented 6 years ago

I don't think I'll ever actually make the program emulate the dual shock controller, but adding better support for steam is a pretty good goal I'll work towards? I'm not sure I understand this post fully, gyro controls are still pretty beta rn and I'd like to eventually get rid of vJoy but it'd take a lot of time and effort, maybe over winter break I'll work on it

fossephate commented 6 years ago

If you have a request, try to make it a single, specific, change (if possible) rather than a list of what you want it to look like.

fossephate commented 6 years ago

I re-read the post and I think I understand now what you're trying to say, the features you're describing are planned, but not through the steam controller configurator, at least for now (I haven't done any testing with the steam controller configurator so I don't even know what works / what doesn't)

Basically I plan to improve gyro controls a bit so they're more usable Also Gyro + regular controls is pretty easy to add, I'm just not sure how I want to add the setting since it would potentially affect multiple joycons and a single check box won't work

CrPO4 commented 6 years ago

Thanks for your responses. It's nice to know that you're going to improve gyro controls, but I see that my post is kinda hard to understand, so I'd try to explain it more clearly this time.

Let's start with a Steam Controller Configurator, the thing that was introduced with a release of Steam Controller. It allows any controller - be it XBox 360, Dualshock 4, or even "generic" DirectInput gamepad - to be used in modern games that requires XInput AND also allows to rebind those controllers - create profiles, with action sets, action layers and a lot of other things too - even if the game itself doesn't support it. Please note that supporting Steam Controller Configurator takes nothing from your side, if it is a controller - it is already supported by Steam Controller Configurator.

Next, why it is important to "emulate" Dualshock 4 for this (even though it's more like "pretend" that our combined controller is Dualshock 4). Steam Controller configurator only allows Dulashock 4, of all the DirectInput gamepads, to bind gyro to something. With Steam Controller Configurator, it is possible to bind, for example, analog stick and gyro to the same axis (let's say, it's camera movement, aka right stick) with different sensitivity, and ALSO have a button to activate gyro, so it's not active all the time, it's pretty convenient.

Another reason to emulate Dualshock 4 is the touchpad, because it's also a button. Since you can press touchpad, there's an option to bind that press to something. And JoyCons have 4 buttons (+, -, Share and Home), while other controllers have only 3 (Share, Option and Home in case of Dualshock 4). So with this, it will be possible to utilize the button for some additional things, could it be switching action sets in Steam Controller Configurator, or even perform a combo attack in a fighting game.

To summarize that, the only feature I request, despite my posts are being all over the place, is "to make combined JoyCons look like a Dualshock 4 for the system", all the stuff I describe comes with this single change. If this post doesn't make you feel like it's worth it - it's alright, I'll just wait for the changes you've already planned to work on.

Anyways, thanks for a great piece of software, and for reading this.

fossephate commented 6 years ago

Thanks for clarifying, I'll have to do some research to see how viable this is, I think the two ways this could happen are: finding a way to get steam to think you are using a dual shock 4 controller, or some kind of middle program that emulates the dual shock 4, so my program -> dual shock emulator -> steam The first is much more preferable, I'll do some research and make another post based on what I find

fossephate commented 6 years ago

So doing some research I found this: http://vjoystick.sourceforge.net/site/index.php/forum/5-Discussion/1229-emulate-ps4-controller-for-playstation-remoteplay Which led to this: https://github.com/nefarius/ViGE Which looks pretty viable but looks like a lot of work, I'll look into it more when I get home in an hour, but I'll add the help wanted tag to this

CrPO4 commented 6 years ago

I'm glad we've come to an understanding that this feature would be a pretty solid addition to the JoyCon functionality on Windows.

While you're looking into it, and since you've mentioned ViGEm (you've got the link wrong though, it's missing M at the end), it maybe worth looking at the VDX source code (https://github.com/nefarius/ViGEm/tree/master/Src/Samples/VDX), it wraps X360ce to emulated ViGEm controllers, including Dualshock 4, so, as a temporary measure, maybe it will be possible to wrap existing vJoy implementation to Dualshock 4 using this example application by Nefarius (not by the means of x360ce, of course, because that defeats the purpose)? I wish I could be more help than just assuming stuff, but I'm not able to write code.