-
Notifications
You must be signed in to change notification settings - Fork 110
/
DualSenseX.cs
333 lines (262 loc) · 12.7 KB
/
DualSenseX.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DualSenseX
{
class DualSenseX
{
<h1 align="center">DualSenseX</h1>
<h3 align="center"></h3>
</p>
</p>
<p align="center">
<p align="center">
<a href="https://localazy.com/p/dualsensex" alt="langs">
<img src="https://connect.localazy.com/status/dualsensex?logo=ffffff&style=for-the-badge&content=langs" /></a>⠀
<a href="https://github.com/Paliverse/DualSenseX/releases" alt="Contributors">
<img src="https://img.shields.io/github/downloads/Paliverse/DualSenseX/total.svg?style=for-the-badge&color=ffffff&logo=windows" /></a>⠀
<a href="https://discord.gg/PUThpCFByn">
<img src="https://img.shields.io/discord/836790685784211486?logo=discord&label=Discord&style=for-the-badge&color=228B22"
alt="chat on Discord"></a>
</p>
<div align="center">
<img src="imgs/DualSenseX_Icon.png"
alt="dualsensex image"
height="300" width="auto">
</div>
<h1 align="center"></h1>
</p>
## About App
Bring your DualSense Controller to life on PC with support for Adaptive Triggers!
Emulate with the following while also getting the functionality of a DualSense Controller:
`Xbox360`
`DualShock 4`
`OFF (for no Emulation, reading only inside app)`
Wheather you're using Steam or a different platform, you will be able to use DualSenseX with all Games!
Connection type supports both USB and Bluetooth with full functionaliy!
## Download and Install
To use DualSenseX,
* Download the **DualSenseX-Setup.zip** in Assets from the [latest release](https://github.com/Paliverse/DualSenseX/releases/latest).
* To install, double-click `DualSenseX-Setup.exe`.
* Very important and required get ViGEmBus Driver:
* Download the latest `ViGEmBus` drivers from the [ViGEmBus release page](https://github.com/ViGEm/ViGEmBus/releases/latest).
* To install, double-click `ViGEmBus_Setup_{version}.exe` and follow the instructions presented.
* Very important and required get HidHide Driver:
* Download the latest `HidHide` drivers from the [HidHide release page](https://github.com/ViGEm/HidHide/releases/latest).
* To install, double-click `HidHideMSI.msi` and follow the instructions presented.
* **MAKE SURE YOU REBOOT TO TAKE EFFECT**
Once thats done, you can connect your DualSense Controller by pressing `Connect Controller` in the App.
## **Features:**
- Self updating App, we will always strive to make the experience easy and hassle free
- Launch App with Windows Startup
- Test out the controller to make sure all the buttons and joysticks function as inteded
- Get Battery life status of controller (Connecting throught USB cable will show 100% needs to be tweaked)
- Configure Controller LED to your liking
- Test out different Adaptive Trigger Modes and controller vibration
- See a list of supported games in the "Games" Tab (Work in progress)
- Game doesnt support controller? Map keyboard button clicks to controller buttons to simulate key pressess.
- Auto connect controller when app launches, with ability to also kill steam if it's running.
- Change between different hand selected backgrounds for the App
- Dark and Light Mode
- Custom Border RGB Color with Transparency options
## Join [**Discord**](https://discord.gg/PUThpCFByn) Community!
[![Discord Banner 2](https://discordapp.com/api/guilds/836790685784211486/widget.png?style=banner4)](https://discord.gg/PUThpCFByn)
- Report Issues
- Report Bugs
- Get support
- Ask questions regarding the App and more!
## **DualSenseX On Trello**
<h5/>To-Do's, Things being worked on, what's been implemented and more!</h5>
<a href="https://trello.com/b/mDUMw1sN" alt="Contributors">
<img src="https://img.shields.io/badge/Trello-5C2D91?style=for-the-badge&logoColor=white&logo=Trello" /></a>
## **For Translators**
Want to contribute in trasnlating the app? Click below:
<a href="https://localazy.com/p/dualsensex" alt="langs">
<img src="https://connect.localazy.com/status/dualsensex?style=for-the-badge&logo=ffffff" /></a>
## **Screenshot:**
![Screenshot 2021-05-12 205945](https://user-images.githubusercontent.com/4289084/118066856-11678d80-b365-11eb-9739-e12dcfbac3c0.png)
## **Reviews:**
[**AJ Bants YouTube Channel**](https://www.youtube.com/channel/UCTofyjsFVYEXwcNvzwiTWyw)
[![Alt text](https://img.youtube.com/vi/qQVvUA7NJz4/maxresdefault.jpg)](https://www.youtube.com/watch?v=qQVvUA7NJz4)
# **Game Demo**
### [**View on Itch.io**](https://paliverse.itch.io/dualsensex-game-demo)
### [**Watch Video on YouTube**](https://www.youtube.com/watch?v=VQABnviCeRw)
![Screenshot 2021-05-12 205945](https://img.itch.zone/aW1nLzYwMTU0NzcucG5n/original/KQkDLv.png)
# **For Game Devs**
Support your game with DualSense Adaptive Trigger Capabilities With DualSenseX App, find out below how to get it setup, and get your game added within the App for all to see and play!
### **Trigger State**
To get this working with your game, you just have to write to a text file.
There are a few things this App will look for when reading this text file to apply the triggers:
- `LeftTrigger=`
- `RightTrigger=`
- `VibrateTriggerIntensity=` ⠀⠀⠀⠀⠀⠀⠀* A value between 0-255 | VibrateTrigger Required to use this *
- `CustomTriggerValueLeftMode=`⠀⠀⠀⠀⠀* CustomTriggerValue Required to use this *
- `CustomTriggerValueRightMode=`⠀⠀⠀⠀* CustomTriggerValue Required to use this *
- `ForceLeftTrigger=`
- `ForceRightTrigger=`
---
For the `LeftTrigger=` and `RightTrigger=`, there are 19 different state possibilites that you can set which are **CASE SENSITIVE**:
- `Normal`
- `CustomTriggerValue`
- `GameCube`
- `Resistance`
- `Bow`
- `Galloping`
- `SemiAutomaticGun`
- `AutomaticGun`
- `Machine`
- `Choppy`
- `VerySoft`
- `Soft`
- `Medium`
- `Hard`
- `VeryHard`
- `Hardest`
- `Rigid`
- `VibrateTriggerPulse`
- `VibrateTrigger`
---
for `ForceLeftTrigger=` and `ForceRightTrigger=`
* When using CustomTriggerValue there are 7 different values that goes into each parentheses 0-255
* Example: ForceLeftTrigger=(0)(0)(0)(0)(0)(0)(0) or ForceRightTrigger=(0)(0)(0)(0)(0)(0)(0)
* When using Resistance there are 2 different values that goes into each parentheses.
* `First: 0-9` `Second: 0-8`
* Example: ForceLeftTrigger=(0)(0) or ForceRightTrigger=(0)(0)
* When using Bow there are 4 different values that goes into each parentheses.
* `First: 0-8` `Second: 0-8` `Third: 0-8` `Fourth: 0-8`
* Example: ForceLeftTrigger=(0)(0)(0)(0) or ForceRightTrigger=(0)(0)(0)(0)
* When using Galloping there are 5 different values that goes into each parentheses.
* `First: 0-8` `Second: 0-9` `Third: 0-6` `Fourth: 0-7` `Fifth: 0-255 NOT recomended to go over 40`
* Example: ForceLeftTrigger=(0)(0)(0)(0)(0) or ForceRightTrigger=(0)(0)(0)(0)(0)
* When using SemiAutomaticGun there are 4 different values that goes into each parentheses.
* `First: 0-7` `Second: 0-8` `Third: 0-8`
* Example: ForceLeftTrigger=(0)(0)(0) or ForceRightTrigger=(0)(0)(0)
* When using AutomaticGun there are 4 different values that goes into each parentheses.
* `First: 0-9` `Second: 0-8` `Third: 0-255 NOT recomended to go over 40`
* Example: ForceLeftTrigger=(0)(0)(0) or ForceRightTrigger=(0)(0)(0)
* When using Machine there are 6 different values that goes into each parentheses.
* `First: 0-8` `Second: 0-9` `Third: 0-7` `Fourth: 0-7` `Fifth: 0-255 NOT recomended to go over 40` `Sixth: 0-2 in Decimals, example: 0.1, 0.8, 1.0, 1.8, 2.0 etc..`
* Example: ForceLeftTrigger=(0)(0)(0)(0)(0)(0) or ForceRightTrigger=(0)(0)(0)(0)(0)(0)
---
When using CustomTriggerValue, there are 17 different mode possibilites that are **CASE SENSITIVE** you can apply for:
CustomTriggerValueLeftMode=
CustomTriggerValueRightMode=
- `OFF`
- `Rigid`
- `Rigid A`
- `Rigid B`
- `Rigid AB`
- `Pulse`
- `Pulse A`
- `Pulse B`
- `Pulse AB`
- `VibrateResistance`
- `VibrateResistance A`
- `VibrateResistance B`
- `VibrateResistance AB`
- `Vibrate Pulse`
- `Vibrate Pulse A`
- `Vibrate Pulse B`
- `Vibrate Pulse AB`
## **Examples of Trigger States in Textfile:**
____
### **Apply Normal State:**
```
LeftTrigger=Normal
RightTrigger=Normal
```
___________________
### **Apply Rigid State:**
```
LeftTrigger=Rigid
RightTrigger=Rigid
```
___________________
### **Apply VibrateTrigger State for right Trigger:**
```
LeftTrigger=Normal
RightTrigger=VibrateTrigger
VibrateTriggerIntensity=40
```
___________________
### **CustomTriggerValue State for right Trigger and GameCube for left Trigger:**
```
LeftTrigger=GameCube
RightTrigger=CustomTriggerValue
CustomTriggerValueRightMode=VibrateResistance B
ForceRightTrigger=(10)(255)(0)(0)(0)(0)(0)
```
___________________
### **CustomTriggerValue State for both Triggers:**
```
LeftTrigger=CustomTriggerValue
RightTrigger=CustomTriggerValue
CustomTriggerValueLeftMode=Rigid A
CustomTriggerValueRightMode=VibrateResistance B
ForceLeftTrigger=(10)(255)(0)(0)(0)(0)(0)
ForceRightTrigger=(10)(255)(0)(0)(0)(0)(0)
```
___________________
### **VibrateTrigger State for Right Trigger and CustomTriggerValue for the left :**
```
LeftTrigger=CustomTriggerValue
RightTrigger=VibrateTrigger
VibrateTriggerIntensity= 10
CustomTriggerValueLeftMode=Rigid A
ForceLeftTrigger=(10)(255)(0)(0)(0)(0)(0)
```
___________________
### **Resistance State for Right Trigger :**
```
RightTrigger=Resistance
ForceRightTrigger=(0)(8)
```
___________________
### **Machine State for Left Trigger :**
```
RightTrigger=Machine
ForceLeftTrigger=(0)(9)(7)(7)(10)(0.0)
```
___________________
### **AutomaticGun State for right Trigger and GameCube for left Trigger:**
```
LeftTrigger=GameCube
RightTrigger=AutomaticGun
ForceRightTrigger=(0)(8)(15)
```
___________________
`Note` : Best is to not leave spaces or extra unnecessary lines except for the lines you need to reduce the delay in reading the text file.
You can mix and match between states to get the desired effect for your game.
From previous testing, i believe you can write to text file every frame as the App will only read from that file.
For best results i recommend you include the batch file with your game and have it execute when loading your game which is explained below.
## **Batch File:**
This batch file will open the DualSenseX App and auto connect to the controller, and begin applying the trigger states from the text file.
To get started download the zip file from aboove and attach the .Bat file in the directory of your game.
Edit the batch file according to your Game Title and the name of the text file that your game will write to.
Upon launching the game, you should execute this batch file which will open a new window
of DualSenseX that takes in 2 paramaters from the batch file explained below and inside the batch file:
Both the batch file and the text file must be in the same directory with your game, the batch file gets the location of the
textfile depending on where the batch file is located.
- Replace `GAMENAME` with your Game Title.
- Replace `TEXTFILENAME.txt` with your text file name, while also including the .txt extension at the end
# **License**
<a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.
# Acknowledgement and Reference
This App would not be possible without:
* [ViGEmBus](https://github.com/ViGEm/ViGEmBus)
* [HidSharp](https://www.zer7.com/software/hidsharp)
* [DualSense2Xbox](https://github.com/Solla/DualSense2Xbox)
* [Dualsense, Haptics, Leds, and More (Hid Output Report)](https://www.reddit.com/r/gamedev/comments/jumvi5/dualsense_haptics_leds_and_more_hid_output_report/)
* [BLE Inputs](https://gist.github.com/Ryochan7/91a9759deb5dff3096fc5afd50ba19e2)
* [DualSense-Windows](https://github.com/Ohjurot/DualSense-Windows)
* [DS4Windows](https://github.com/Ryochan7/DS4Windows)
* [DualSenseSupport](https://github.com/Mxater/DualSenseSupport)
I thank all of you!
# **Support Me**
To help support the project and devleopment of DualSenseX
[![Paypal.me](https://3.bp.blogspot.com/-8ebAKPD8I84/XKGZxo1IG3I/AAAAAAAAQ1M/cWq0ecuHUy0p4z6A56x32Hz2EycZR5mfwCLcBGAs/s1600/paypal_me-copy-300x140.png)](https://www.paypal.com/paypalme/paliverse)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/L4L14MUFI)
}
}