Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dinput Wrapper for SCP Driver
#41
(11-15-2015, 07:00 PM)Ge-Force Wrote: Any idea what version will have all the changes? (and an approximate ETA)

I'm pretty confident in the next 1.6.x release in a few days.
Reply

Sponsored links

#42
I just looked through your code; you might be pretty save to update, the most important change is:

Code:
public event EventHandler<ScpHidReport> NativeFeedReceived;

You can now access the button and axis states through convenient indexers like in this sample:

Code:
private void Parse(object sender, ScpHidReport e)
       {
           lock (this)
           {
               if (e.PadId == (DsPadId)m_SelectedPad)
               {
                   if (e.PadState != DsState.Connected)
                   {
                       ResetControls();
                       return;
                   }

                   //scpProxy.Remap(m_SelectedProfile, e);

                   switch (e.Model)
                   {
                       case DsModel.DS3:
                           {
                               axLX.Value = e[Ds3Axis.Lx].Value;
                               axLY.Value = e[Ds3Axis.Ly].Value;
                               axRX.Value = e[Ds3Axis.Rx].Value;
                               axRY.Value = e[Ds3Axis.Ry].Value;

                               axL1.Value = e[Ds3Axis.L1].Value;
                               axR1.Value = e[Ds3Axis.R1].Value;
                               axL2.Value = e[Ds3Axis.L2].Value;
                               axR2.Value = e[Ds3Axis.R2].Value;

                               axL3.Value = (Byte)(e[Ds3Button.L3].IsPressed ? 255 : 0);
                               axR3.Value = (Byte)(e[Ds3Button.R3].IsPressed ? 255 : 0);

                               axSH.Value = (Byte)(e[Ds3Button.Select].IsPressed ? 255 : 0);
                               axOP.Value = (Byte)(e[Ds3Button.Start].IsPressed ? 255 : 0);

                               axT.Value = e[Ds3Axis.Triangle].Value;
                               axC.Value = e[Ds3Axis.Circle].Value;
                               axX.Value = e[Ds3Axis.Cross].Value;
                               axS.Value = e[Ds3Axis.Square].Value;

                               axU.Value = e[Ds3Axis.Up].Value;
                               axR.Value = e[Ds3Axis.Right].Value;
                               axD.Value = e[Ds3Axis.Down].Value;
                               axL.Value = e[Ds3Axis.Left].Value;

                               axPS.Value = (Byte)(e[Ds3Button.Ps].IsPressed ? 255 : 0);
                           }
                           break;

                       case DsModel.DS4:
                           {
                               axLX.Value = e[Ds4Axis.Lx].Value;
                               axLY.Value = e[Ds4Axis.Ly].Value;
                               axRX.Value = e[Ds4Axis.Rx].Value;
                               axRY.Value = e[Ds4Axis.Ry].Value;

                               axL2.Value = e[Ds4Axis.L2].Value;
                               axR2.Value = e[Ds4Axis.R2].Value;

                               axL1.Value = (Byte)(e[Ds4Button.L1].IsPressed ? 255 : 0);
                               axR1.Value = (Byte)(e[Ds4Button.R1].IsPressed ? 255 : 0);
                               axL3.Value = (Byte)(e[Ds4Button.L3].IsPressed ? 255 : 0);
                               axR3.Value = (Byte)(e[Ds4Button.R3].IsPressed ? 255 : 0);

                               axSH.Value = (Byte)(e[Ds4Button.Share].IsPressed ? 255 : 0);
                               axOP.Value = (Byte)(e[Ds4Button.Options].IsPressed ? 255 : 0);

                               axT.Value = (Byte)(e[Ds4Button.Triangle].IsPressed ? 255 : 0);
                               axC.Value = (Byte)(e[Ds4Button.Circle].IsPressed ? 255 : 0);
                               axX.Value = (Byte)(e[Ds4Button.Cross].IsPressed ? 255 : 0);
                               axS.Value = (Byte)(e[Ds4Button.Square].IsPressed ? 255 : 0);

                               axU.Value = (Byte)(e[Ds4Button.Up].IsPressed ? 255 : 0);
                               axR.Value = (Byte)(e[Ds4Button.Right].IsPressed ? 255 : 0);
                               axD.Value = (Byte)(e[Ds4Button.Down].IsPressed ? 255 : 0);
                               axL.Value = (Byte)(e[Ds4Button.Left].IsPressed ? 255 : 0);

                               axPS.Value = (Byte)(e[Ds4Button.Ps].IsPressed ? 255 : 0);
                               axTP.Value = (Byte)(e[Ds4Button.TouchPad].IsPressed ? 255 : 0);
                           }
                           break;
                   }
               }
           }
       }

Pressure-sensitive information is equally easy to access:

Code:
public SCP_EXTN GetExtended(uint dwUserIndex)
       {
           ScpHidReport inputReport;
           var extended = default(SCP_EXTN);

           try
           {
               inputReport = _packetCache[(DsPadId) dwUserIndex];
           }
           catch (KeyNotFoundException)
           {
               return extended;
           }

           switch (inputReport.Model)
           {
               case DsModel.None:
                   break;
               case DsModel.DS3:
                   // translate and wrap button/axis information
                   extended = new SCP_EXTN
                   {
                       SCP_UP = inputReport[Ds3Axis.Up].Pressure,
                       SCP_RIGHT = inputReport[Ds3Axis.Right].Pressure,
                       SCP_DOWN = inputReport[Ds3Axis.Down].Pressure,
                       SCP_LEFT = inputReport[Ds3Axis.Left].Pressure,
                       SCP_LX = inputReport[Ds3Axis.Lx].Value,
                       SCP_LY = inputReport[Ds3Axis.Ly].Value,
                       SCP_L1 = inputReport[Ds3Axis.L1].Pressure,
                       SCP_L2 = inputReport[Ds3Axis.L2].Pressure,
                       SCP_L3 = inputReport[Ds3Button.L3].Pressure,
                       SCP_RX = inputReport[Ds3Axis.Rx].Value,
                       SCP_RY = inputReport[Ds3Axis.Ry].Value,
                       SCP_R1 = inputReport[Ds3Axis.R1].Pressure,
                       SCP_R2 = inputReport[Ds3Axis.R2].Pressure,
                       SCP_R3 = inputReport[Ds3Button.R3].Pressure,
                       SCP_T = inputReport[Ds3Axis.Triangle].Pressure,
                       SCP_C = inputReport[Ds3Axis.Circle].Pressure,
                       SCP_X = inputReport[Ds3Axis.Cross].Pressure,
                       SCP_S = inputReport[Ds3Axis.Square].Pressure,
                       SCP_SELECT = inputReport[Ds3Button.Select].Pressure,
                       SCP_START = inputReport[Ds3Button.Start].Pressure,
                       SCP_PS = inputReport[Ds3Button.Ps].Pressure
                   };
                   break;
                   // TODO: implement DS4 and Generic
           }

           return extended;
       }

I kicked out most of the hard-coded enums so you can write code in a more object-oriented manor Smile
Reply
#43
Hey Ge-Force, thanks so much for your hard work on this tool.

I just wanted to let you know that one thing right now that I'm struggling with is no Dead-zones for the axes. 
Is there a way currently to configure dead zones and if not, do you plan to add this as a feature into the ScpPad2vJoy app?

Thanks!
Reply
#44
(11-20-2015, 05:33 AM)Lonely188 Wrote: Hey Ge-Force, thanks so much for your hard work on this tool.

I just wanted to let you know that one thing right now that I'm struggling with is no Dead-zones for the axes. 
Is there a way currently to configure dead zones and if not, do you plan to add this as a feature into the ScpPad2vJoy app?

Thanks!

Currently there is no Dead-zone support, I am looking into adding support for this, thanks for the suggestion.
Reply
#45
hey ge-force, i just recently upgraded to windows 10 and can't seem to run ScpPad2vJoy.exe itself anymore. I upgraded to the latest version of vjoy, scpserver reloaded, and also scpPad2vjoy that you have attached in the first post as well. any idea how to go about getting this to run again? trying compatiblity with windows 8 didn't work either.

thanks
Reply
#46
I'm unable to load ScpPad2vJoy it ask for administrator rights and then nothing loads. Would this be due to the ScpTool update? Is it incompatible or is there something I'm missing?

UPDATE: Downgraded to ScpToolKit 1.5 and was able to get it working. But unfortunately it seems my controllers bluetooth connection isnt working in that version. Any idea when you will be releasing a 1.6 supported version?

Thanks for making this it's what I've been looking for.
Reply
#47
Can someone try this with PPSSPP and tell me if your controller is detected as x360 or dpad1? If this disables xinput then it should be detected as dpad but mine shows x360 which is xinput. All others are ignored which is a xinput issue with PPSSPP it only supports one xinput device.
Reply
#48
(12-03-2015, 01:50 PM)delti Wrote: hey ge-force, i just recently upgraded to windows 10 and can't seem to run ScpPad2vJoy.exe itself anymore.  I upgraded to the latest version of vjoy, scpserver reloaded, and also scpPad2vjoy that you have attached in the first post as well.  any idea how to go about getting this to run again?  trying compatiblity with windows 8 didn't work either.

thanks

I haven't had any problems on Windows 10 as far as running the executables. You have tried reinstalling right? The user account control appears when I run it. Do you have UAC disabled? Maybe that is messing with it? Make sure that you follow these rules too:

ScpToolkit_Setup_v1.5.5787.40106.exe is required to work with SCPPad2Vjoy - V1.5
Don't use ScpToolKit 1.6 as it will not work right now. Also use vJoy 2.1.6.

Install Direct Input (Older games support):
1. Install vJoy - "vJoy_216_150815.exe"
2. Extract SCPPad2Vjoy to the ScpToolKit (v1.5) main directory
3. Run the ScpPad2vJoy.exe
4. A window should appear, load config will bind buttons from txt files (found in the vJConfigs.7z)
5. Click Start to override XInput to Direct Input
6. Stop when you are done playing the Direct Input required game
Reply
#49
i setup the version 1.6 scp toolkit the only thing i want is to swap trigers l1 to l2 r1 to r2 and all tollkit dont have the provile swapper like v scp 1.2.175 its have it but it dont work good in my ps controler the vibration not work so i have to use toolkit but swaping trigers is not working
Reply
#50
I have a iPega bluetooth controller and need Xinput support.
You think this wrapper works with it?

Main Rig: i7-3770k @4.5ghz | 16GB DDR3 | Nvidia GTX 980 TI | Win 10 X64
Laptop: MSI GT62VR | i7-6700HQ | 16GB DDR4 | Nvidia GTX 1060 | Win 10 X64

Reply




Users browsing this thread: 1 Guest(s)