├── .gitattributes ├── .gitignore ├── DSX ├── DSX.exe ├── DSX.sln └── DSX │ ├── DSX.cpp │ ├── DSX.vcxproj │ ├── DSX.vcxproj.filters │ └── DSX.vcxproj.user ├── DualsenseY.sln ├── DualsenseY ├── App.config ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── Constants.cs ├── ControllerEmulation.cs ├── DualSenseY.csproj ├── Events.cs ├── HotkeyEdit.xaml ├── HotkeyEdit.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── bt.png │ ├── discordicon.jpg │ ├── ds4.png │ ├── ds4_icon.png │ ├── dualsenseyicon.ico │ ├── edge_icon.png │ ├── githubicon.jpg │ ├── usb.png │ └── x360.png ├── Settings.cs ├── UDP.cs ├── Utils.cs ├── Version.cs ├── app.manifest ├── dualsenseyicon.ico └── icon.png ├── README.md └── version /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /DSX/DSX.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DSX/DSX.exe -------------------------------------------------------------------------------- /DSX/DSX.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.10.35013.160 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSX", "DSX\DSX.vcxproj", "{057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Debug|x64.ActiveCfg = Debug|x64 17 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Debug|x64.Build.0 = Debug|x64 18 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Debug|x86.ActiveCfg = Debug|Win32 19 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Debug|x86.Build.0 = Debug|Win32 20 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Release|x64.ActiveCfg = Release|x64 21 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Release|x64.Build.0 = Release|x64 22 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Release|x86.ActiveCfg = Release|Win32 23 | {057EBAB1-5BD7-440E-AAF0-05FFBFD66C9B}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {EFE67605-361B-49B4-98BE-285A0E1390DF} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /DSX/DSX/DSX.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | bool isDSY() { 8 | PROCESSENTRY32 entry; 9 | entry.dwSize = sizeof(PROCESSENTRY32); 10 | 11 | HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 12 | 13 | if (Process32First(snapshot, &entry) == TRUE) 14 | { 15 | while (Process32Next(snapshot, &entry) == TRUE) 16 | { 17 | if ((std::wstring)entry.szExeFile == L"DualSenseY.exe") 18 | { 19 | return true; 20 | } 21 | } 22 | 23 | } 24 | 25 | CloseHandle(snapshot); 26 | return false; 27 | } 28 | 29 | int main() 30 | { 31 | while (true) 32 | { 33 | Sleep(5000); 34 | 35 | if (isDSY() == false) { 36 | break; 37 | } 38 | } 39 | 40 | return 0; 41 | } -------------------------------------------------------------------------------- /DSX/DSX/DSX.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 17.0 23 | Win32Proj 24 | {057ebab1-5bd7-440e-aaf0-05ffbfd66c9b} 25 | DSX 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | true 77 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 78 | true 79 | 80 | 81 | Console 82 | true 83 | 84 | 85 | 86 | 87 | Level3 88 | true 89 | true 90 | true 91 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 92 | true 93 | 94 | 95 | Console 96 | true 97 | true 98 | true 99 | 100 | 101 | 102 | 103 | Level3 104 | true 105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 106 | true 107 | 108 | 109 | Console 110 | true 111 | 112 | 113 | 114 | 115 | Level3 116 | true 117 | true 118 | true 119 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | 122 | 123 | Console 124 | true 125 | true 126 | true 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /DSX/DSX/DSX.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /DSX/DSX/DSX.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /DualsenseY.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34526.213 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DualSenseY", "DualsenseY\DualSenseY.csproj", "{7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Debug|x64.ActiveCfg = Debug|x64 19 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Debug|x64.Build.0 = Debug|x64 20 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Release|x64.ActiveCfg = Release|x64 23 | {7AA6D8E2-241A-4C42-BD32-F30C7E8B796A}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {235FB679-0574-428E-811E-BF85096E388F} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /DualsenseY/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | False 15 | 16 | 17 | False 18 | 19 | 20 | False 21 | 22 | 23 | False 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 | False 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /DualsenseY/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DualsenseY/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DualsenseY 4 | { 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | 11 | /// 12 | /// InitializeComponent 13 | /// 14 | [System.Diagnostics.DebuggerNonUserCodeAttribute()] 15 | public void InitializeComponent() 16 | { 17 | 18 | #line 4 "..\..\..\App.xaml" 19 | this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); 20 | 21 | #line default 22 | #line hidden 23 | } 24 | 25 | /// 26 | /// Application Entry Point. 27 | /// 28 | [STAThread] 29 | [System.Diagnostics.DebuggerNonUserCodeAttribute()] 30 | public static void Main() 31 | { 32 | DualsenseY.App app = new DualsenseY.App(); 33 | app.InitializeComponent(); 34 | app.Run(); 35 | } 36 | 37 | 38 | private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) 39 | { 40 | MessageBox.Show("Error" + Environment.NewLine + e.Exception.Message, "Error"); 41 | e.Handled = true; 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /DualsenseY/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /DualsenseY/Constants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DualSenseY 8 | { 9 | // stupid resources wouldnt work 10 | public static class Constants 11 | { 12 | public static string Changelog = "6.2\nFixed emulated DualShock 4 triggers in some games\n\n"+ 13 | "6.1\nFixed hide to tray (thanks CommandGenius)\n\n" + 14 | "6.0\nAdded save screenshot to file option\n\n" + 15 | "5.9\nStability fixes\n\n" + 16 | "5.8\nFixed gyroscope for games that need correct sensor timestamp (ex. Detroit: Become Human)\nFixed screenshot/ds4 sound not playing\n\n" + 17 | "5.7\nUpdated HidHide API\nFixed crashing on some configs with DualShock4\nAdded lightbar blinking below 5% battery\nUpdated Haptic Feedback UDP instruction (tutorial soon)\n\n" + 18 | "5.6\nFixed DPAD on DualShock4 controllers\n\n" + 19 | "5.5\nAdded experimental DualShock 4 V2 support\n\n" + 20 | "5.4\nAdded experimental DualShock 4 support\n\n" + 21 | "5.3\nBluetooth connections are now more reliable\nSound to LED now works on bluetooth\nAdded LED battery status display option\n\n" + 22 | "5.2\nReplaced startup config with per port configuration\n\n" + 23 | "5.1\nAdded multi controller support\nAdded DualSense Edge indicator\n\n" + 24 | "5.0\nAdded changelog tab\nApplication now correctly reports battery level to UDP mods\nError messagebox should now display on fatal crashes\n\n" + 25 | "4.9\nFixed \"Cyberpunk 2077 Enhanced DualSense Support\" mod crashing randomly\r\nDisco Mode will disable automatically on UDP connection\n\n" + 26 | "4.8\nAdded \"Motion\" tab\n\n" + 27 | "4.7\nMade it less likely that Windows Defender will incorrectly flag a fake DSX process as a Trojan (please report if this still happens)\r\nBlocked \"Disco Mode\" option while using \"Sound To LED\"\n\n" + 28 | "4.6\nAdded disco mode for lightbar\n\n" + 29 | "4.5\nIncreased UDP timeout time\r\nStartup is now faster\n\n" + 30 | "4.4\nIncreased mod compatibility\n\n" + 31 | "4.3\nFixed gyro directions for DS4 emulation\n\n" + 32 | "4.2\nEmulated DS4 now supports touchpad\r\nEmulated DS4 now supports gyro\n\n" + 33 | "4.1\nAdded keyboard mapping for hotkeys\n\n" + 34 | "4.0\nAdded battery status for bluetooth connections\n\n" + 35 | "3.9\nFixed \"Sound to LED\" not working when changing default audio output device\n\n" + 36 | "3.8\nTouchpad tab should now work on bluetooth connections\r\nAdded \"Help\" tab\n\n" + 37 | "3.7\nFixed connection type indication icon not appearing when using connect on startup option\r\nChanged \"Save Config\" dialog box to Windows' save file dialog\n\n" + 38 | "3.6\nFixed adaptive triggers tab\r\nSpeaker test and screenshot sound now work even when Audio Passthrough is enabled\r\nAudio Passthrough output device should change automatically now\r\nFixed Audio Passthrough not working on devices with more than 2 channels\n\n" + 39 | "3.5\nAdded an option to load your config on startup\r\nAdded minimize to tray option\r\nAdded connect on startup option\r\nAdded minimize on startup option\r\nAdded hotkeys (Screenshot, X360 emu, DS4 emu, audio passthrough)\r\nLeft and right stereo channels now split correctly when using audio passthrough\r\nFixed microphone\r\nAdjusted UI\n\n" + 40 | "3.4\nClicking \"Disconnect Controller\" will turn off the LEDs, which previously only worked when the application was closed.\r\nAdded external headset support\r\nAdded connection type indication\n\n" + 41 | "3.3\nDisconnecting from the controller lets go off the lightbar\r\nAdded new UDP instructions\n\n" + 42 | "3.2\nFixed rumble not working on bluetooth\n\n" + 43 | "3.1\nDS4 lightbar emulation now works for games that support it\r\nConfigs now save touchpad, microphone, sound and emulation settings\n\n" + 44 | "3.0\nFixed UDP status falsely reporting \"Active\" on startup\r\nFixed app crashing on PCs with Intel Audio driver on USB connection\r\nFixed \"node removal failed\" error in some situations.\n\n" + 45 | "2.9\nAdded sensitivity slider to the touchpad tab\r\nDualSense controller will now be hidden durning controller emulation (HidHide required)\n\n" + 46 | "2.8\nFixed vibration test\r\nFixed app crashing on connect via bluetooth\n\n" + 47 | "2.7\nImproved UDP support\n\n" + 48 | "2.6\nFixed controller not being detected on computers with uncommon audio devices\r\nAdded audio to haptics\r\nAdded audio to LED\r\nRemoved microphone monitoring (it didn't work well anyway)\n\n" + 49 | "2.5\nFixed app crashing on startup in some instances\r\nChanged default microphone volume to 35\n\n" + 50 | "2.4\nAudio device detection was rewritten (Thanks Nefarius)\n\n" + 51 | "2.3\nRunning vibrations at 0 will change the UseRumbleNotHaptics flag to native\n\n" + 52 | "2.2\nAdded touchpad support\n\n" + 53 | "2.1\nFrom this version, exiting the application will automatically set the controller to native mode (Useful for games like ZZZ)\r\nFixed app crashing on controller disconnect\n\n" + 54 | "2.0\nFixed rumble not working when emulating x360 controller/ds4\n\n" + 55 | "1.9\nAdded configs\n\n" + 56 | "1.8\nAdded auto updater\n\n" + 57 | "1.7\nAdded an icon\r\nAdded minimize button\r\nAdded haptic feedback and speaker test\n\n" + 58 | "1.6\nFixed UDP status not updating\n\n" + 59 | "1.5\nAdded microphone control\r\nMade lightbar transition on controller connection more smooth\n\n" + 60 | "1.4\nAdded Player LED customization support\r\nAdded an option to toggle Microphone LED\n\n" + 61 | "1.3\nFixed app not launching on some computers\n\n" + 62 | "1.2\nDrastically decreased CPU usage\n\n" + 63 | "1.1\nFixed lightbar flickering\r\nFixed adaptive trigger labels being set to 255 on startup"; 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /DualsenseY/ControllerEmulation.cs: -------------------------------------------------------------------------------- 1 | using Nefarius.ViGEm.Client; 2 | using Nefarius.ViGEm.Client.Exceptions; 3 | using Nefarius.ViGEm.Client.Targets; 4 | using Nefarius.ViGEm.Client.Targets.DualShock4; 5 | using Nefarius.ViGEm.Client.Targets.Xbox360; 6 | using Newtonsoft.Json.Linq; 7 | using System.Diagnostics; 8 | using System.Windows; 9 | using Wujek_Dualsense_API; 10 | 11 | namespace DualSenseY 12 | { 13 | public class ControllerEmulation : IDisposable 14 | { 15 | private ViGEmClient client; 16 | public bool isEmulating360 = false; 17 | public bool Emulating = false; 18 | public IDualShock4Controller dualshock4; 19 | public IXbox360Controller x360Controller; 20 | public Dualsense dualsense; 21 | public int leftTriggerThreshold = 0; 22 | public int rightTriggerThreshold = 0; 23 | public bool ForceStopRumble = true; 24 | public bool isViGEMBusInstalled = false; 25 | public bool IgnoreDS4Lightbar = false; 26 | 27 | public ControllerEmulation() 28 | { 29 | try 30 | { 31 | client = new ViGEmClient(); 32 | isViGEMBusInstalled = true; 33 | } 34 | catch (VigemBusNotFoundException) 35 | { 36 | isViGEMBusInstalled = false; 37 | } 38 | } 39 | 40 | public void StartX360Emulation() 41 | { 42 | if (isViGEMBusInstalled) 43 | { 44 | Emulating = false; 45 | 46 | if (x360Controller != null) 47 | { 48 | x360Controller.Disconnect(); 49 | } 50 | 51 | if (dualshock4 != null) 52 | { 53 | dualshock4.Disconnect(); 54 | } 55 | 56 | if (x360Controller == null) 57 | x360Controller = client.CreateXbox360Controller(); 58 | 59 | x360Controller.Connect(); 60 | x360Controller.FeedbackReceived += X360Controller_FeedbackReceived; 61 | isEmulating360 = true; 62 | Emulating = true; 63 | 64 | new Thread(() => Emulate()).Start(); 65 | } 66 | } 67 | 68 | private void X360Controller_FeedbackReceived(object sender, Xbox360FeedbackReceivedEventArgs e) 69 | { 70 | if (!ForceStopRumble) 71 | { 72 | dualsense.SetVibrationType(Vibrations.VibrationType.Standard_Rumble); 73 | dualsense.SetStandardRumble(e.LargeMotor, e.SmallMotor); 74 | } 75 | } 76 | 77 | public void StartDS4Emulation() 78 | { 79 | if (isViGEMBusInstalled) 80 | { 81 | Emulating = false; 82 | 83 | if (x360Controller != null) 84 | { 85 | x360Controller.Disconnect(); 86 | } 87 | 88 | if (dualshock4 != null) 89 | { 90 | dualshock4.Disconnect(); 91 | } 92 | 93 | if (dualshock4 == null) 94 | dualshock4 = client.CreateDualShock4Controller(); 95 | 96 | dualshock4.Connect(); 97 | dualshock4.FeedbackReceived += Dualshock4_FeedbackReceived; 98 | isEmulating360 = false; 99 | Emulating = true; 100 | new Thread(() => 101 | { 102 | Thread.CurrentThread.Priority = ThreadPriority.Lowest; 103 | Emulate(); 104 | }).Start(); 105 | } 106 | } 107 | 108 | public void StopEmulation() 109 | { 110 | Emulating = false; 111 | 112 | if (x360Controller != null) 113 | { 114 | x360Controller.Disconnect(); 115 | } 116 | 117 | if (dualshock4 != null) 118 | { 119 | dualshock4.Disconnect(); 120 | } 121 | } 122 | 123 | private void Dualshock4_FeedbackReceived(object sender, DualShock4FeedbackReceivedEventArgs e) 124 | { 125 | if (!ForceStopRumble) 126 | { 127 | dualsense.SetVibrationType(Vibrations.VibrationType.Standard_Rumble); 128 | dualsense.SetStandardRumble(e.LargeMotor, e.SmallMotor); 129 | } 130 | 131 | if (!IgnoreDS4Lightbar) 132 | { 133 | if (e.LightbarColor.Red != 0 || e.LightbarColor.Green != 0 || e.LightbarColor.Blue != 0) 134 | { 135 | dualsense.SetLightbar(e.LightbarColor.Red, e.LightbarColor.Green, e.LightbarColor.Blue); 136 | } 137 | } 138 | } 139 | 140 | private void Emulate() 141 | { 142 | byte[] rawDS4 = new byte[63]; 143 | 144 | while (Emulating) 145 | { 146 | if (isEmulating360) 147 | { 148 | x360Controller.SetButtonState(Xbox360Button.A, dualsense.ButtonState.cross); 149 | x360Controller.SetButtonState(Xbox360Button.B, dualsense.ButtonState.circle); 150 | x360Controller.SetButtonState(Xbox360Button.Y, dualsense.ButtonState.triangle); 151 | x360Controller.SetButtonState(Xbox360Button.X, dualsense.ButtonState.square); 152 | x360Controller.SetButtonState(Xbox360Button.Up, dualsense.ButtonState.DpadUp); 153 | x360Controller.SetButtonState(Xbox360Button.Left, dualsense.ButtonState.DpadLeft); 154 | x360Controller.SetButtonState(Xbox360Button.Right, dualsense.ButtonState.DpadRight); 155 | x360Controller.SetButtonState(Xbox360Button.Down, dualsense.ButtonState.DpadDown); 156 | 157 | //-32767 minimum 158 | //32766 max 159 | x360Controller.SetAxisValue(Xbox360Axis.LeftThumbX, (short)ConvertRange(dualsense.ButtonState.LX, 0, 255, -32767, 32766)); 160 | x360Controller.SetAxisValue(Xbox360Axis.LeftThumbY, (short)ConvertRange(dualsense.ButtonState.LY, 255, 0, -32767, 32766)); 161 | x360Controller.SetAxisValue(Xbox360Axis.RightThumbX, (short)ConvertRange(dualsense.ButtonState.RX, 0, 255, -32767, 32766)); 162 | x360Controller.SetAxisValue(Xbox360Axis.RightThumbY, (short)ConvertRange(dualsense.ButtonState.RY, 255, 0, -32767, 32766)); 163 | x360Controller.SetButtonState(Xbox360Button.LeftThumb, dualsense.ButtonState.L3); 164 | x360Controller.SetButtonState(Xbox360Button.RightThumb, dualsense.ButtonState.R3); 165 | 166 | if ((byte)dualsense.ButtonState.L2 >= leftTriggerThreshold) 167 | x360Controller.LeftTrigger = (byte)dualsense.ButtonState.L2; 168 | else 169 | x360Controller.LeftTrigger = (byte)0; 170 | 171 | if ((byte)dualsense.ButtonState.R2 >= rightTriggerThreshold) 172 | x360Controller.RightTrigger = (byte)dualsense.ButtonState.R2; 173 | else 174 | x360Controller.RightTrigger = (byte)0; 175 | 176 | x360Controller.SetButtonState(Xbox360Button.Start, dualsense.ButtonState.options); 177 | x360Controller.SetButtonState(Xbox360Button.Back, dualsense.ButtonState.share); 178 | x360Controller.SetButtonState(Xbox360Button.LeftShoulder, dualsense.ButtonState.L1); 179 | x360Controller.SetButtonState(Xbox360Button.RightShoulder, dualsense.ButtonState.R1); 180 | x360Controller.SetButtonState(Xbox360Button.Guide, dualsense.ButtonState.ps); 181 | } 182 | else 183 | { 184 | rawDS4[0] = (byte)dualsense.ButtonState.LX; 185 | rawDS4[1] = (byte)dualsense.ButtonState.LY; 186 | rawDS4[2] = (byte)dualsense.ButtonState.RX; 187 | rawDS4[3] = (byte)dualsense.ButtonState.RY; 188 | 189 | byte xoState = 0x0; 190 | xoState = (byte)(dualsense.ButtonState.triangle ? xoState | (byte)DualShock4Buttons.Tringle : xoState); 191 | xoState = (byte)(dualsense.ButtonState.circle ? xoState | (byte)DualShock4Buttons.Circle : xoState); 192 | xoState = (byte)(dualsense.ButtonState.cross ? xoState | (byte)DualShock4Buttons.Cross : xoState); 193 | xoState = (byte)(dualsense.ButtonState.square ? xoState | (byte)DualShock4Buttons.Square : xoState); 194 | 195 | if (dualsense.ButtonState.DpadUp && dualsense.ButtonState.DpadLeft) 196 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_NorthWest); 197 | 198 | if (dualsense.ButtonState.DpadDown && dualsense.ButtonState.DpadLeft) 199 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_SouthWest); 200 | else if (dualsense.ButtonState.DpadDown && dualsense.ButtonState.DpadRight) 201 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_SouthEast); 202 | else if (dualsense.ButtonState.DpadUp && dualsense.ButtonState.DpadRight) 203 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_NorthEast); 204 | else if (dualsense.ButtonState.DpadLeft) 205 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_West); 206 | else if (dualsense.ButtonState.DpadDown) 207 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_South); 208 | else if (dualsense.ButtonState.DpadRight) 209 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_East); 210 | else if (dualsense.ButtonState.DpadUp) 211 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_North); 212 | else if (!dualsense.ButtonState.DpadUp && !dualsense.ButtonState.DpadDown && !dualsense.ButtonState.DpadLeft && !dualsense.ButtonState.DpadRight) 213 | xoState = (byte)(xoState | (byte)DualShock4Buttons.Dpad_Neutral); 214 | rawDS4[4] = xoState; 215 | 216 | byte lState = 0x0; 217 | lState = (byte)(dualsense.ButtonState.R3 ? lState | (byte)DualShock4Buttons.R3 : lState); 218 | lState = (byte)(dualsense.ButtonState.L3 ? lState | (byte)DualShock4Buttons.L3 : lState); 219 | lState = (byte)(dualsense.ButtonState.options ? lState | (byte)DualShock4Buttons.Options : lState); 220 | lState = (byte)(dualsense.ButtonState.share ? lState | (byte)DualShock4Buttons.Share : lState); 221 | lState = (byte)(dualsense.ButtonState.R2Btn ? lState | (byte)DualShock4Buttons.R2 : lState); 222 | lState = (byte)(dualsense.ButtonState.L2Btn ? lState | (byte)DualShock4Buttons.L2 : lState); 223 | lState = (byte)(dualsense.ButtonState.R1 ? lState | (byte)DualShock4Buttons.R1 : lState); 224 | lState = (byte)(dualsense.ButtonState.L1 ? lState | (byte)DualShock4Buttons.L1 : lState); 225 | rawDS4[5] = lState; 226 | 227 | byte tState = 0x0; 228 | tState = (byte)(dualsense.ButtonState.touchBtn ? tState | (byte)DualShock4Buttons.TPAD_Click : tState); 229 | tState = (byte)(dualsense.ButtonState.ps ? tState | (byte)DualShock4Buttons.PS : tState); 230 | rawDS4[6] = tState; 231 | 232 | rawDS4[7] = (byte)dualsense.ButtonState.L2; 233 | rawDS4[8] = (byte)dualsense.ButtonState.R2; 234 | 235 | short timestamp = (short)(dualsense.ButtonState.accelerometer.SensorTimestamp / 16); 236 | rawDS4[9] = (byte)(timestamp & 0xFF); 237 | rawDS4[10] = (byte)((timestamp >> 8) & 0xFF); 238 | 239 | rawDS4[18] = (byte)(dualsense.ButtonState.accelerometer.X & 0xFF); 240 | rawDS4[19] = (byte)((dualsense.ButtonState.accelerometer.X >> 8) & 0xFF); 241 | 242 | rawDS4[20] = (byte)(dualsense.ButtonState.accelerometer.Y & 0xFF); 243 | rawDS4[21] = (byte)((dualsense.ButtonState.accelerometer.Y >> 8) & 0xFF); 244 | 245 | rawDS4[22] = (byte)(dualsense.ButtonState.accelerometer.Z & 0xFF); 246 | rawDS4[23] = (byte)((dualsense.ButtonState.accelerometer.Z >> 8) & 0xFF); 247 | 248 | rawDS4[12] = (byte)(dualsense.ButtonState.gyro.X & 0xFF); 249 | rawDS4[13] = (byte)((dualsense.ButtonState.gyro.X >> 8) & 0xFF); 250 | 251 | rawDS4[14] = (byte)(dualsense.ButtonState.gyro.Y & 0xFF); 252 | rawDS4[15] = (byte)((dualsense.ButtonState.gyro.Y >> 8) & 0xFF); 253 | 254 | rawDS4[16] = (byte)(dualsense.ButtonState.gyro.Z & 0xFF); 255 | rawDS4[17] = (byte)((dualsense.ButtonState.gyro.Z >> 8) & 0xFF); 256 | 257 | rawDS4[32] = 1; 258 | rawDS4[33] = (byte)dualsense.ButtonState.TouchPacketNum; 259 | rawDS4[34] = (byte)dualsense.ButtonState.trackPadTouch0.RawTrackingNum; 260 | rawDS4[35] = (byte)(dualsense.ButtonState.trackPadTouch0.X & 0xFF); 261 | rawDS4[36] = (byte)((byte)(dualsense.ButtonState.trackPadTouch0.X >> 8) & 0x0F | (dualsense.ButtonState.trackPadTouch0.Y << 4) & 0xF0); 262 | rawDS4[37] = (byte)(dualsense.ButtonState.trackPadTouch0.Y >> 4); 263 | 264 | rawDS4[38] = (byte)dualsense.ButtonState.trackPadTouch1.RawTrackingNum; 265 | rawDS4[39] = (byte)(dualsense.ButtonState.trackPadTouch1.X & 0xFF); 266 | rawDS4[40] = (byte)((byte)(dualsense.ButtonState.trackPadTouch1.X >> 8) & 0x0F | (dualsense.ButtonState.trackPadTouch1.Y << 4) & 0xF0); 267 | rawDS4[41] = (byte)(dualsense.ButtonState.trackPadTouch1.Y >> 4); 268 | 269 | 270 | dualshock4.SubmitRawReport(rawDS4); 271 | } 272 | 273 | Thread.Sleep(1); 274 | } 275 | } 276 | 277 | private enum DualShock4Buttons 278 | { 279 | Tringle = 1 << 7, 280 | Circle = 1 << 6, 281 | Cross = 1 << 5, 282 | Square = 1 << 4, 283 | 284 | R3 = 1 << 7, 285 | L3 = 1 << 6, 286 | Options = 1 << 5, 287 | Share = 1 << 4, 288 | R2 = 1 << 3, 289 | L2 = 1 << 2, 290 | R1 = 1 << 1, 291 | L1 = 1 << 0, 292 | 293 | TPAD_Click = 1 << 1, 294 | PS = 1 << 0, 295 | 296 | Dpad_Neutral = 0b_1000, 297 | Dpad_NorthWest = 0b_0111, 298 | Dpad_West = 0b_0110, 299 | Dpad_SouthWest = 0b_0101, 300 | Dpad_South = 0b_0100, 301 | Dpad_SouthEast = 0b_0011, 302 | Dpad_East = 0b_0010, 303 | Dpad_NorthEast = 0b_0001, 304 | Dpad_North = 0b_0000 305 | } 306 | 307 | private int ConvertRange(int value, int oldMin, int oldMax, int newMin, int newMax) 308 | { 309 | if (oldMin == oldMax) 310 | { 311 | throw new ArgumentException("Old minimum and maximum cannot be equal."); 312 | } 313 | float ratio = (float)(newMax - newMin) / (float)(oldMax - oldMin); 314 | float scaledValue = (value - oldMin) * ratio + newMin; 315 | return Math.Clamp((int)scaledValue, newMin, newMax); 316 | } 317 | 318 | public void Dispose() 319 | { 320 | Emulating = false; 321 | if (dualshock4 != null) 322 | { 323 | dualshock4.Disconnect(); 324 | dualshock4.Dispose(); 325 | } 326 | if (x360Controller != null) 327 | { 328 | x360Controller.Disconnect(); 329 | } 330 | } 331 | 332 | 333 | } 334 | } 335 | 336 | -------------------------------------------------------------------------------- /DualsenseY/DualSenseY.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net8.0-windows10.0.22621.0 6 | enable 7 | enable 8 | true 9 | dualsenseyicon.ico 10 | AnyCPU;x64 11 | app.manifest 12 | 10.0.17763.0 13 | DualSenseY 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 | ResXFileCodeGenerator 44 | Resources.Designer.cs 45 | Always 46 | 47 | 48 | Always 49 | 50 | 51 | Always 52 | 53 | 54 | Always 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Always 69 | 70 | 71 | Always 72 | 73 | 74 | Always 75 | 76 | 77 | Always 78 | 79 | 80 | Always 81 | 82 | 83 | Always 84 | 85 | 86 | 87 | 88 | 89 | True 90 | True 91 | Resources.resx 92 | 93 | 94 | True 95 | True 96 | Settings.settings 97 | 98 | 99 | 100 | 101 | 102 | SettingsSingleFileGenerator 103 | Settings.Designer.cs 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /DualsenseY/Events.cs: -------------------------------------------------------------------------------- 1 | using static DualSenseY.UDP; 2 | 3 | namespace DualSenseY 4 | { 5 | public class Events 6 | { 7 | public class PacketEvent : EventArgs 8 | { 9 | public Packet packet { get; set; } 10 | 11 | public PacketEvent(Packet newPacket) 12 | { 13 | packet = newPacket; 14 | } 15 | } 16 | 17 | public event EventHandler NewPacket; 18 | public void OnNewPacket(Packet Packet) 19 | { 20 | if (this.NewPacket != null) 21 | { 22 | this.NewPacket(this, new PacketEvent(Packet)); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DualsenseY/HotkeyEdit.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 285 | 288 | 289 | 438 | 439 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | -------------------------------------------------------------------------------- /DualsenseY/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DualSenseY.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DualSenseY.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap ds4 { 67 | get { 68 | object obj = ResourceManager.GetObject("ds4", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap ds4_icon { 77 | get { 78 | object obj = ResourceManager.GetObject("ds4_icon", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap x360 { 87 | get { 88 | object obj = ResourceManager.GetObject("x360", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /DualsenseY/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\ds4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\ds4_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\x360.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | -------------------------------------------------------------------------------- /DualsenseY/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DualSenseY.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string defaultConfigPath { 30 | get { 31 | return ((string)(this["defaultConfigPath"])); 32 | } 33 | set { 34 | this["defaultConfigPath"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 41 | public bool minimizeToTray { 42 | get { 43 | return ((bool)(this["minimizeToTray"])); 44 | } 45 | set { 46 | this["minimizeToTray"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 53 | public bool connectOnStartup { 54 | get { 55 | return ((bool)(this["connectOnStartup"])); 56 | } 57 | set { 58 | this["connectOnStartup"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 65 | public bool launchWithWindows { 66 | get { 67 | return ((bool)(this["launchWithWindows"])); 68 | } 69 | set { 70 | this["launchWithWindows"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 77 | public bool launchMinimized { 78 | get { 79 | return ((bool)(this["launchMinimized"])); 80 | } 81 | set { 82 | this["launchMinimized"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("")] 89 | public string port1 { 90 | get { 91 | return ((string)(this["port1"])); 92 | } 93 | set { 94 | this["port1"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("")] 101 | public string port2 { 102 | get { 103 | return ((string)(this["port2"])); 104 | } 105 | set { 106 | this["port2"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("")] 113 | public string port3 { 114 | get { 115 | return ((string)(this["port3"])); 116 | } 117 | set { 118 | this["port3"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("")] 125 | public string port4 { 126 | get { 127 | return ((string)(this["port4"])); 128 | } 129 | set { 130 | this["port4"] = value; 131 | } 132 | } 133 | 134 | [global::System.Configuration.UserScopedSettingAttribute()] 135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 136 | [global::System.Configuration.DefaultSettingValueAttribute("")] 137 | public string config1 { 138 | get { 139 | return ((string)(this["config1"])); 140 | } 141 | set { 142 | this["config1"] = value; 143 | } 144 | } 145 | 146 | [global::System.Configuration.UserScopedSettingAttribute()] 147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 148 | [global::System.Configuration.DefaultSettingValueAttribute("")] 149 | public string config2 { 150 | get { 151 | return ((string)(this["config2"])); 152 | } 153 | set { 154 | this["config2"] = value; 155 | } 156 | } 157 | 158 | [global::System.Configuration.UserScopedSettingAttribute()] 159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 160 | [global::System.Configuration.DefaultSettingValueAttribute("")] 161 | public string config3 { 162 | get { 163 | return ((string)(this["config3"])); 164 | } 165 | set { 166 | this["config3"] = value; 167 | } 168 | } 169 | 170 | [global::System.Configuration.UserScopedSettingAttribute()] 171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 172 | [global::System.Configuration.DefaultSettingValueAttribute("")] 173 | public string config4 { 174 | get { 175 | return ((string)(this["config4"])); 176 | } 177 | set { 178 | this["config4"] = value; 179 | } 180 | } 181 | 182 | [global::System.Configuration.UserScopedSettingAttribute()] 183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 184 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 185 | public bool saveScreenshotsToDocuments { 186 | get { 187 | return ((bool)(this["saveScreenshotsToDocuments"])); 188 | } 189 | set { 190 | this["saveScreenshotsToDocuments"] = value; 191 | } 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /DualsenseY/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | False 10 | 11 | 12 | False 13 | 14 | 15 | False 16 | 17 | 18 | False 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 | False 46 | 47 | 48 | -------------------------------------------------------------------------------- /DualsenseY/Resources/bt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/bt.png -------------------------------------------------------------------------------- /DualsenseY/Resources/discordicon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/discordicon.jpg -------------------------------------------------------------------------------- /DualsenseY/Resources/ds4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/ds4.png -------------------------------------------------------------------------------- /DualsenseY/Resources/ds4_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/ds4_icon.png -------------------------------------------------------------------------------- /DualsenseY/Resources/dualsenseyicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/dualsenseyicon.ico -------------------------------------------------------------------------------- /DualsenseY/Resources/edge_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/edge_icon.png -------------------------------------------------------------------------------- /DualsenseY/Resources/githubicon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/githubicon.jpg -------------------------------------------------------------------------------- /DualsenseY/Resources/usb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/usb.png -------------------------------------------------------------------------------- /DualsenseY/Resources/x360.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/Resources/x360.png -------------------------------------------------------------------------------- /DualsenseY/Settings.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.IO; 3 | using System.Windows; 4 | using Wujek_Dualsense_API; 5 | 6 | namespace DualSenseY 7 | { 8 | public class Settings 9 | { 10 | public readonly static string Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\DualSenseY\\Configs"; 11 | public readonly static string ScPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\DualSenseY\\Screenshots\\"; 12 | 13 | public void SaveProfileToFile(string fileName, Profile profile) 14 | { 15 | if (!Directory.Exists(Path)) 16 | Directory.CreateDirectory(Path); 17 | 18 | File.WriteAllText(fileName, JsonConvert.SerializeObject(profile)); 19 | } 20 | 21 | public Profile ReadProfileFromFile(string path) 22 | { 23 | if (File.Exists(path)) 24 | { 25 | string file = File.ReadAllText(path); 26 | return JsonConvert.DeserializeObject(file); 27 | } 28 | else 29 | { 30 | MessageBox.Show("This file doesn't exist"); 31 | return null; 32 | } 33 | } 34 | 35 | public class Profile 36 | { 37 | public int R { get; set; } 38 | public int G { get; set; } 39 | public int B { get; set; } 40 | public bool IgnoreDS4Lightbar { get; set; } 41 | public int ControllerEmulation { get; set; } // 0 = off, 1 = x360, 2 = ds4 42 | public bool UseTouchpadAsMouse { get; set; } 43 | public bool LightbarBattery { get; set; } 44 | public bool LEDBattery { get; set; } 45 | public int TouchpadSensitivity { get; set; } 46 | public int MicrophoneVolume { get; set; } 47 | public float SpeakerVolume { get; set; } 48 | public float LeftActuatorVolume { get; set; } 49 | public float RightActuatorVolume { get; set; } 50 | public int HotKey1 { get; set; } 51 | public int HotKey2 { get; set; } 52 | public int HotKey3 { get; set; } 53 | public int HotKey4 { get; set; } 54 | public int HotKey5 { get; set; } 55 | public string[] customHotkey = new string[5]; 56 | public int[] customHotkeyIndex = new int[20]; 57 | 58 | public bool DiscoMode { get; set; } 59 | public int DiscoSpeed { get; set; } 60 | public bool UseHeadset { get; set; } 61 | public LED.PlayerLED playerLED { get; set; } 62 | public LED.MicrophoneLED microphoneLED { get; set; } 63 | public TriggerType.TriggerModes leftTriggerMode { get; set; } 64 | public int[] leftTriggerForces { get; set; } 65 | public TriggerType.TriggerModes rightTriggerMode { get; set; } 66 | public int[] rightTriggerForces { get; set; } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /DualsenseY/UDP.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Net; 5 | using System.Net.Sockets; 6 | using System.Text; 7 | using System.Windows; 8 | 9 | namespace DualSenseY 10 | { 11 | public class UDP : IDisposable 12 | { 13 | private UdpClient client; 14 | private IPEndPoint ipendPoint = new IPEndPoint(IPAddress.Any, 0); 15 | public bool serverOn = false; 16 | public bool newPacket = false; 17 | public Packet currentPacket; 18 | public Events Events = new Events(); 19 | public int Battery = 100; 20 | public bool unavailable = false; 21 | 22 | public UDP() 23 | { 24 | if (!Directory.Exists(@"C:\Temp\DualSenseX\")) 25 | Directory.CreateDirectory(@"C:\Temp\DualSenseX\"); 26 | 27 | if (!File.Exists(@"C:\Temp\DualSenseX\DualSenseX_PortNumber.txt")) 28 | File.WriteAllText(@"C:\Temp\DualSenseX\DualSenseX_PortNumber.txt", "6969"); 29 | 30 | Connect(); 31 | } 32 | 33 | private void Connect() 34 | { 35 | try 36 | { 37 | serverOn = false; 38 | var portNumber = File.ReadAllText(@"C:\Temp\DualSenseX\DualSenseX_PortNumber.txt"); 39 | client = new UdpClient(Convert.ToInt32(portNumber)); 40 | serverOn = true; 41 | new Thread(() => Listen()).Start(); 42 | } 43 | catch 44 | { 45 | serverOn = false; 46 | unavailable = true; 47 | } 48 | } 49 | 50 | private void Listen() 51 | { 52 | string string_json = string.Empty; 53 | 54 | while (serverOn) 55 | { 56 | try 57 | { 58 | newPacket = false; 59 | byte[] bytes = client.Receive(ref ipendPoint); 60 | newPacket = true; 61 | UDPResponse response = new UDPResponse(); 62 | response.Status = "DSX Received UDP Instructions"; 63 | response.TimeReceived = string.Format("{0}", DateTime.Now); 64 | response.isControllerConnected = true; 65 | response.BatteryLevel = Battery; // doesn't matter 66 | string s = JsonConvert.SerializeObject(response); 67 | byte[] bytes2 = Encoding.ASCII.GetBytes(s); 68 | client.Send(bytes2, bytes2.Length, ipendPoint); 69 | string_json = Encoding.ASCII.GetString(bytes); 70 | currentPacket = JsonConvert.DeserializeObject(string_json); 71 | Events.OnNewPacket(currentPacket); 72 | } 73 | catch { continue; } // Ignore bad packets 74 | } 75 | } 76 | 77 | public static void StartFakeDSXProcess() 78 | { 79 | if (File.Exists("DSX.exe")) 80 | { 81 | Process proc = new Process(); 82 | proc.StartInfo.UseShellExecute = false; 83 | proc.StartInfo.CreateNoWindow = true; 84 | proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; 85 | proc.StartInfo.FileName = "DSX.exe"; 86 | proc.StartInfo.Arguments = string.Empty; 87 | proc.StartInfo.RedirectStandardError = false; 88 | proc.StartInfo.RedirectStandardOutput = false; 89 | proc.StartInfo.UseShellExecute = false; 90 | proc.StartInfo.CreateNoWindow = true; 91 | proc.Start(); 92 | } 93 | } 94 | 95 | public void Dispose() 96 | { 97 | serverOn = false; 98 | if(client != null) 99 | { 100 | client.Dispose(); 101 | } 102 | } 103 | 104 | public class UDPResponse 105 | { 106 | // Token: 0x0400073E RID: 1854 107 | public string Status; 108 | 109 | // Token: 0x0400073F RID: 1855 110 | public string TimeReceived; 111 | 112 | // Token: 0x04000740 RID: 1856 113 | public bool isControllerConnected; 114 | 115 | // Token: 0x04000741 RID: 1857 116 | public int BatteryLevel; 117 | } 118 | 119 | public enum TriggerMode 120 | { 121 | Normal = 0, 122 | GameCube = 1, 123 | VerySoft = 2, 124 | Soft = 3, 125 | Hard = 4, 126 | VeryHard = 5, 127 | Hardest = 6, 128 | Rigid = 7, 129 | VibrateTrigger = 8, 130 | Choppy = 9, 131 | Medium = 10, 132 | VibrateTriggerPulse = 11, 133 | CustomTriggerValue = 12, 134 | Resistance = 13, 135 | Bow = 14, 136 | Galloping = 15, 137 | SemiAutomaticGun = 16, 138 | AutomaticGun = 17, 139 | Machine = 18 140 | } 141 | 142 | public enum CustomTriggerValueMode 143 | { 144 | OFF = 0, 145 | Rigid = 1, 146 | RigidA = 2, 147 | RigidB = 3, 148 | RigidAB = 4, 149 | Pulse = 5, 150 | PulseA = 6, 151 | PulseB = 7, 152 | PulseAB = 8, 153 | VibrateResistance = 9, 154 | VibrateResistanceA = 10, 155 | VibrateResistanceB = 11, 156 | VibrateResistanceAB = 12, 157 | VibratePulse = 13, 158 | VibratePulseA = 14, 159 | VibratePulsB = 15, 160 | VibratePulseAB = 16 161 | } 162 | 163 | public enum PlayerLEDNewRevision 164 | { 165 | One = 0, 166 | Two = 1, 167 | Three = 2, 168 | Four = 3, 169 | Five = 4, // Five is Also All On 170 | AllOff = 5 171 | } 172 | 173 | public enum MicLEDMode 174 | { 175 | On = 0, 176 | Pulse = 1, 177 | Off = 2 178 | } 179 | 180 | public enum Trigger 181 | { 182 | Invalid, 183 | Left, 184 | Right 185 | } 186 | 187 | public enum InstructionType 188 | { 189 | Invalid, 190 | TriggerUpdate, 191 | RGBUpdate, 192 | PlayerLED, 193 | TriggerThreshold, 194 | MicLED, 195 | PlayerLEDNewRevision, 196 | ResetToUserSettings, 197 | HapticFeedback, 198 | RGBTransitionUpdate, 199 | } 200 | 201 | public struct Instruction 202 | { 203 | public InstructionType type; 204 | public object[] parameters; 205 | } 206 | 207 | public class Packet 208 | { 209 | public Instruction[] instructions; 210 | } 211 | } 212 | } -------------------------------------------------------------------------------- /DualsenseY/Utils.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.IO; 3 | using System.Windows.Forms; 4 | 5 | namespace DualSenseY 6 | { 7 | public class Utils 8 | { 9 | public static void ScreenshotToClipboard(bool SaveToFile) 10 | { 11 | Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); 12 | Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image); 13 | graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size); 14 | System.Windows.Clipboard.SetDataObject(bitmap); 15 | 16 | if (SaveToFile) 17 | { 18 | if (!Directory.Exists(Settings.ScPath)) 19 | { 20 | Directory.CreateDirectory(Settings.ScPath); 21 | } 22 | 23 | bitmap.Save(Settings.ScPath + DateTime.Now.ToString("yyyy-dd-M--HH-mm-ss-fff") + ".png", System.Drawing.Imaging.ImageFormat.Png); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DualsenseY/Version.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.IO; 3 | using System.IO.Compression; 4 | using System.Net; 5 | 6 | namespace DualSenseY 7 | { 8 | public class Version 9 | { 10 | public double CurrentVersion = 6.2; 11 | 12 | public void Update() 13 | { 14 | using (WebClient client = new WebClient()) 15 | { 16 | string _RemoteVersion = client.DownloadString("https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/master/version").Replace("\n", ""); 17 | double RemoteVersion = Convert.ToDouble(_RemoteVersion); 18 | 19 | string fileName = $"DualSenseY.{_RemoteVersion}v.zip"; 20 | client.DownloadFile($"https://github.com/WujekFoliarz/DualSenseY/releases/latest/download/" + "DualSenseY." + _RemoteVersion + "v.zip", "update.zip"); 21 | if (File.Exists("update.zip")) 22 | { 23 | foreach (string file in Directory.GetFiles(Directory.GetCurrentDirectory())) 24 | { 25 | if (file.Contains(".dll") || file.Contains(".exe") || file.Contains(".wav") || file.Contains(".json") || file.Contains(".pdb")) 26 | { 27 | if(!file.Contains("DSX")) 28 | { 29 | File.Move(file, file + ".bak"); 30 | } 31 | } 32 | } 33 | ZipFile.ExtractToDirectory("update.zip", Directory.GetCurrentDirectory()); 34 | Environment.Exit(0); 35 | } 36 | } 37 | } 38 | 39 | public bool IsOutdated() 40 | { 41 | using (WebClient client = new WebClient()) 42 | { 43 | try 44 | { 45 | double RemoteVersion = Convert.ToDouble(client.DownloadString("https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/master/version"), CultureInfo.InvariantCulture); 46 | if (RemoteVersion > CurrentVersion) 47 | return true; 48 | else 49 | return false; 50 | } 51 | catch (Exception) 52 | { 53 | return false; 54 | } 55 | } 56 | } 57 | 58 | public void RemoveOldFiles() 59 | { 60 | foreach (string file in Directory.GetFiles(Directory.GetCurrentDirectory())) 61 | { 62 | if (file.Contains("update.zip")) 63 | File.Delete(file); 64 | else if (file.Contains(".bak")) 65 | File.Delete(file); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /DualsenseY/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 62 | 63 | 64 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /DualsenseY/dualsenseyicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/dualsenseyicon.ico -------------------------------------------------------------------------------- /DualsenseY/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/6787d099f752b43c24a74cda2e8a881f40311c8a/DualsenseY/icon.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/WujekFoliarz/DualSenseY/total) 2 | 3 | ## 4 | ### THIS VERSION IS NO LONGER SUPPORTED. 5 | ### NEW VERSION → https://github.com/WujekFoliarz/DualSenseY-v2 6 | 7 | ## Notes 8 | - Bluetooth connection is recommended only for controller emulation and UDP protocol, use USB if possible. 9 | - Please report bugs 10 | - If your DualSense controller is invisible after unexpected shutdown, launch the application, connect to controller and close the app. 11 | 12 | ### If you need any help, add me on discord - wujek_foliarz 13 | 14 | ## My mod says DSX is not running! 15 | This can happen because there is no DSX.exe running in the background, to fix this download [this](https://raw.githubusercontent.com/WujekFoliarz/DualSenseY/refs/heads/master/DSX/DSX.exe) and place it right next to DualSenseY.exe 16 | 17 | I had to separate this file from main release ZIP because windows defender is being pissy about it. 18 | 19 | ## Features 20 | 21 | - Works with UDP protocol of another application with similar name 22 | - Emulate Dualshock 4 or Xbox 360 controller via ViGEMBus Driver 23 | - Control adaptive triggers 24 | - Control LED 25 | - Test vibrations 26 | - Test the speaker and haptic feedback 27 | - Test touchpad 28 | - Use touchpad as mouse 29 | - Use system audio as haptic feedback 30 | - Display audio volume on your controller (LED) 31 | - Bind keyboard keys to the mic button 32 | - Bind screenshot to the mic button 33 | 34 | 35 | ![{F1BB9B13-4546-4C2F-B267-DE6D1CB84BB7}](https://github.com/user-attachments/assets/79b770cd-65ee-42ea-a493-984c9363e575) 36 | 37 | ![{8A11242C-5635-4C79-8961-372BAB742B9E}](https://github.com/user-attachments/assets/93aaea5b-1dfd-4276-91c7-ab14df3f2455) 38 | 39 | ![{BC304887-EAB2-4AE7-8316-BA6F01E49AD4}](https://github.com/user-attachments/assets/e1f56fdd-71ae-4c9d-b9ee-3689cfab5123) 40 | 41 | ![{6FBF441D-8D02-4DE9-9BEE-23F6DCE74A85}](https://github.com/user-attachments/assets/0de75993-b78d-462c-bf5c-fcd5cb697df6) 42 | 43 | ![{6DA1B3BD-5888-4098-8F5C-EC7FABF05EA0}](https://github.com/user-attachments/assets/8f745832-6d37-45fc-8efc-17c00d795a75) 44 | 45 | ![{D70AEB80-B88A-43F2-94E4-A9EC373B5F79}](https://github.com/user-attachments/assets/38831a6d-6933-4abe-bf51-321103e1806e) 46 | 47 | ![{A00ACE89-CD49-45B9-B8DE-D789CCE44A9F}](https://github.com/user-attachments/assets/01c129e3-d6ff-4718-b424-45d4a96c45fb) 48 | 49 | ![{2AFBA212-02F3-4040-A2D7-D97D6F39F063}](https://github.com/user-attachments/assets/dba35baa-264e-4df6-a102-b5c052bfadf4) 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /version: -------------------------------------------------------------------------------- 1 | 6.2 2 | --------------------------------------------------------------------------------