Skip to content

Commit

Permalink
Remove Adaptative Trigger support for use DualSenseSupport API
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianAviles committed Nov 20, 2020
1 parent 1de5aa8 commit 3a43142
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 7 deletions.
48 changes: 48 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"WARNING01": "*********************************************************************************",
"WARNING02": "The C# extension was unable to automatically decode projects in the current",
"WARNING03": "workspace to create a runnable launch.json file. A template launch.json file has",
"WARNING04": "been created as a placeholder.",
"WARNING05": "",
"WARNING06": "If OmniSharp is currently unable to load your project, you can attempt to resolve",
"WARNING07": "this by restoring any missing project dependencies (example: run 'dotnet restore')",
"WARNING08": "and by fixing any reported errors from building the projects in your workspace.",
"WARNING09": "If this allows OmniSharp to now load your project then --",
"WARNING10": " * Delete this file",
"WARNING11": " * Open the Visual Studio Code command palette (View->Command Palette)",
"WARNING12": " * run the command: '.NET: Generate Assets for Build and Debug'.",
"WARNING13": "",
"WARNING14": "If your project requires a more complex launch configuration, you may wish to delete",
"WARNING15": "this configuration and pick a different template using the 'Add Configuration...'",
"WARNING16": "button at the bottom of this file.",
"WARNING17": "*********************************************************************************",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
26 changes: 26 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "msbuild",
"args": [
// Ask msbuild to generate full paths for file names.
"/property:GenerateFullPaths=true",
"/t:build",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "silent"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
}
30 changes: 23 additions & 7 deletions DS4Windows/DS4Library/InputDevices/DualSenseDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -683,15 +683,31 @@ private void WriteReport()
{
MergeStates();
outputReport[0] = 0x02;//REPORT TYPE
outputReport[1] = 0xFF;//CONTROL FLAGS
outputReport[2] = 0x1 | 0x2 | 0x4| 0x10; //Control flags
//outputReport[1] = 0xFF;//CONTROL FLAGS
outputReport[1] = 0x01 | 0x02;//CONTROL FLAGS
if (rightTrigger == DS4HapticState.TriggerType.Pulse)
{
//outputReport[1] = 0x01 | 0x02 | 0x03 | 0x04;
}
else
{
//outputReport[1] = 0x01 | 0x02;
}
outputReport[2] = 0x1 | 0x2 | 0x40; //Control flags
outputReport[3] = currentHap.RumbleMotorStrengthRightLightFast; // fast motor
outputReport[4] = currentHap.RumbleMotorStrengthLeftHeavySlow; // slow motor
//outputReport[0] = 0x31;
outputReport[45] = currentHap.LightBarColor.red; //R
outputReport[46] = currentHap.LightBarColor.green; //G
outputReport[47] = currentHap.LightBarColor.blue;//B
outputReport[11] = (byte)rightTrigger;

if (currentHap.LightBarExplicitlyOff)
{
//outputReport[2] += 0x04 | 0x10;
outputReport[2] += 0x04 ;
outputReport[45] = currentHap.LightBarColor.red; //R
outputReport[46] = currentHap.LightBarColor.green; //G
outputReport[47] = currentHap.LightBarColor.blue;//B
}

/*outputReport[11] = (byte)rightTrigger;
outputReport[12] = (byte)rightTriggerForce;
outputReport[13] = (byte)rightTriggerForce2;
outputReport[14] = (byte)rightTriggerForce3;
Expand All @@ -706,7 +722,7 @@ private void WriteReport()
outputReport[26] = (byte)leftTriggerForce4;
outputReport[27] = (byte)leftTriggerForce5;
outputReport[28] = (byte)leftTriggerForce6;
outputReport[31] = (byte)leftTriggerForce7;
outputReport[31] = (byte)leftTriggerForce7;*/
bool res = hDevice.WriteOutputReportViaInterrupt(outputReport, 0);
//Console.WriteLine("STAUTS: {0}", res);
}
Expand Down

0 comments on commit 3a43142

Please sign in to comment.