..:: PCSX2 Forums ::..

Full Version: DS4 To XInput Wrapper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(02-25-2014, 09:08 AM)Aleksandr Wrote: [ -> ]Did you try ticking the scan code option when mapping the keys?

Enabling "Scan Code" on the Guide button's remapped Escape key fixed it for good in all programs, thanks for the tip!

I saw that and the repeat option, and while I could figure what repeat meant I had no clue what scan code meant and so I didn't touch it.

Can we get a quick explanation on what that does and when/where we should be using it?

Thanks again guys. This tool is really starting to get incredibly fleshed out.
@InhexSTER
I would like to ask a question about DS4 To XInput Wrapper:

Does "DS4 To XInput Wrapper" inject any code to Dualshock 4 controller or make any changes on its firmware?
or it just do its job by change "Microsoft Windows"?

i ask this question to know is there any danger on DualShock 4 controller when use your DS4 To XInput Wrapper?
Essentially DS4 Tool uses default driver to read/send data back to the controller. Only thing is being sent to the controller is output report containing lightbar/rumble information.
DS4 still works with PS4 after using the tool. You have to re-pair if using BT every time you want to switch. I try to make sure that the data being sent to the controller is safe, but since its unofficial i can't give 100% guarantee.

When scan code is not enabled, virtual key code system (windows based i believe) is used, when scan code is enabled hardware key code is used. Some applications work better with lower hardware level key codes
(02-25-2014, 08:16 PM)InhexSTER Wrote: [ -> ]When scan code is not enabled, virtual key code system (windows based i believe) is used, when scan code is enabled hardware key code is used. Some applications work better with lower hardware level key codes

Ahhh that explains why it works better with scan code enabled. Thanks for the explanation.

Now this might sound weird, but any chance of using scan code with the touchpad simulated mouse clicks? Because I noticed the very same programs that didn't like my remapped key without scan code, the touchpad works flakey as well. The mouse movement works okay, but tap to click never really does.
(02-25-2014, 08:32 PM)DaRkL3AD3R Wrote: [ -> ]Ahhh that explains why it works better with scan code enabled. Thanks for the explanation.

Now this might sound weird, but any chance of using scan code with the touchpad simulated mouse clicks? Because I noticed the very same programs that didn't like my remapped key without scan code, the touchpad works flakey as well. The mouse movement works okay, but tap to click never really does.

I added the scan code for the keyboard version of SendInput, but the mouse version does not differentiate between virtual and hardware emulated input. You can see more about this here: http://msdn.microsoft.com/en-us/library/...s.85).aspx

By the way @InhexSTER/electrobrains, I think we should change 'sendInputs[0].Data.Keyboard.Scan = MapVirtualKey(key, MAPVK_VK_TO_VSC);' to only map the virtual key once (on load) and then store it in place of the virtual key code for performance. Thoughts?
(02-25-2014, 08:32 PM)DaRkL3AD3R Wrote: [ -> ]Ahhh that explains why it works better with scan code enabled. Thanks for the explanation.

Now this might sound weird, but any chance of using scan code with the touchpad simulated mouse clicks? Because I noticed the very same programs that didn't like my remapped key without scan code, the touchpad works flakey as well. The mouse movement works okay, but tap to click never really does.

Does holding touch button work? there is no scan codes for mouse inputs in Windows API
(02-25-2014, 08:41 PM)HecticSeptic Wrote: [ -> ]By the way @InhexSTER/electrobrains, I think we should change 'sendInputs[0].Data.Keyboard.Scan = MapVirtualKey(key, MAPVK_VK_TO_VSC);' to only map the virtual key once (on load) and then store it in place of the virtual key code for performance. Thoughts?

This doesn't affect performance as i would assume is a simple conversion or table lookup, the biggest influence from the mappings atm is getting mapped dictionary from global every read. I already have an idea how to make it better. I can be part of future profiling support where i also would use events, trigger and event when hokey is pressed and subscriber would do a specific code for that event.
For example scpcontrol can send signal to scpserver to load new profile, and when profile is loaded scpserver sends back request to refresh a mapping dictionary
I just figured out a Steam Big Picture work-around: have a timeout that, when you start pressing Guide/PS button, it stops sending it to the Xinput virtual device after, say, three seconds. The Guide/PS button still works for normal situations. This can be an option so people can keep Steam Big Picture's functionality, maybe like force the user to hit R2+L2+PS to activate Steam, and if only PS/Guide button is being pressed, it is filtered out.

Basically, Steam benefits by our software accidentally launching Big Picture mode, so they can essentially get free advertisement. They have zero incentive to "fix" this problem. I would add the old R1+L1+PS button combo to turn off the controller but I can't figure out how to actually turn it off from the software....
(02-25-2014, 08:50 PM)InhexSTER Wrote: [ -> ]This doesn't affect performance much, the biggest influence from the mappings atm is getting mapped dictionary from global every read. I already have an idea how to make it better.

While surprising at first, that does make sense from a usage point of view. Although it uses an unmanaged call every time I suppose 'every time' is only as often as a person presses a mapped button, which is nothing in comparison to the amount of times the dictionary is looked up (per report).

On another note, do you think the drop in frame rate mentioned by one of the users earlier with motioninjoy installed might be due to caught and ignored exceptions? I think we should at least log these behind the scenes if not in the front end?
(02-25-2014, 08:54 PM)electrobrains Wrote: [ -> ]I would add the old R1+L1+PS button combo to turn off the controller but I can't figure out how to actually turn it off from the software....

I also have not seen anything obvious for this.

On something you mentioned earlier as well, I read a pretty extensive hardware overview of the controller (struggling to find it in history), in which the author insists that audio cannot be sent through USB, nor through the standard Bluetooth 'channel'. Instead remarking that the controller maintains 2 separate entities which it uses for audio, that will only pair with a specific MAC (probably the same in each console).