├── .gitattributes ├── .gitignore ├── BetterJoyForDolphin.sln ├── BetterJoyForDolphin ├── 3rdPartyControllers.Designer.cs ├── 3rdPartyControllers.cs ├── 3rdPartyControllers.resx ├── App.config ├── BetterJoyForDolphin.csproj ├── Class1.cs ├── Config.cs ├── DolphinConfig.Designer.cs ├── DolphinConfig.cs ├── DolphinConfig.resx ├── DolphinJoyConfig.cs ├── Donate.Designer.cs ├── Donate.cs ├── Donate.resx ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── GenericControllerManager.cs ├── HIDapi.cs ├── Icons │ ├── betterjoyforcemu_icon.ico │ ├── betterjoyfordolphin_icon.ico │ ├── cross.png │ ├── jc_left.png │ ├── jc_left_s.png │ ├── jc_right.png │ ├── jc_right_s.png │ └── pro.png ├── JoyUPDPack.cs ├── Joycon.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ └── app.manifest ├── Resources │ └── dolphinNotifyIcon.bmp ├── UpdServer.cs ├── betterjoyfordolphin_icon.ico ├── hidapi.dll └── packages.config ├── Examples ├── 3rdRight.PNG └── Dolphinports.PNG ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | /BetterJoyForCemu/FodyWeavers.xml 263 | /BetterJoyForCemu/FodyWeavers.xsd 264 | -------------------------------------------------------------------------------- /BetterJoyForDolphin.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2002 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterJoyForDolphin", "BetterJoyForDolphin\BetterJoyForDolphin.csproj", "{1BF709E9-C133-41DF-933A-C9FF3F664C7B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Debug|x64.ActiveCfg = Debug|x64 21 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Debug|x64.Build.0 = Debug|x64 22 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Debug|x86.ActiveCfg = Debug|x86 23 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Debug|x86.Build.0 = Debug|x86 24 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Release|x64.ActiveCfg = Release|x64 27 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Release|x64.Build.0 = Release|x64 28 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Release|x86.ActiveCfg = Release|x86 29 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {F928F866-3D27-4531-970D-25ADE4DDD979} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/3rdPartyControllers.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BetterJoyForDolphin { 2 | partial class _3rdPartyControllers { 3 | /// 4 | /// Required designer variable. 5 | /// 6 | private System.ComponentModel.IContainer components = null; 7 | 8 | /// 9 | /// Clean up any resources being used. 10 | /// 11 | /// true if managed resources should be disposed; otherwise, false. 12 | protected override void Dispose(bool disposing) { 13 | if (disposing && (components != null)) { 14 | components.Dispose(); 15 | } 16 | base.Dispose(disposing); 17 | } 18 | 19 | #region Windows Form Designer generated code 20 | 21 | /// 22 | /// Required method for Designer support - do not modify 23 | /// the contents of this method with the code editor. 24 | /// 25 | private void InitializeComponent() { 26 | this.components = new System.ComponentModel.Container(); 27 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(_3rdPartyControllers)); 28 | this.list_allControllers = new System.Windows.Forms.ListBox(); 29 | this.list_customControllers = new System.Windows.Forms.ListBox(); 30 | this.btn_add = new System.Windows.Forms.Button(); 31 | this.btn_remove = new System.Windows.Forms.Button(); 32 | this.group_props = new System.Windows.Forms.GroupBox(); 33 | this.chk_isLeft = new System.Windows.Forms.CheckBox(); 34 | this.chk_isPro = new System.Windows.Forms.CheckBox(); 35 | this.btn_applyAndClose = new System.Windows.Forms.Button(); 36 | this.btn_apply = new System.Windows.Forms.Button(); 37 | this.lbl_all = new System.Windows.Forms.Label(); 38 | this.label1 = new System.Windows.Forms.Label(); 39 | this.tip_device = new System.Windows.Forms.ToolTip(this.components); 40 | this.btn_refresh = new System.Windows.Forms.Button(); 41 | this.group_props.SuspendLayout(); 42 | this.SuspendLayout(); 43 | // 44 | // list_allControllers 45 | // 46 | this.list_allControllers.FormattingEnabled = true; 47 | this.list_allControllers.Location = new System.Drawing.Point(12, 27); 48 | this.list_allControllers.Name = "list_allControllers"; 49 | this.list_allControllers.Size = new System.Drawing.Size(103, 225); 50 | this.list_allControllers.TabIndex = 0; 51 | this.list_allControllers.SelectedValueChanged += new System.EventHandler(this.list_allControllers_SelectedValueChanged); 52 | this.list_allControllers.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_allControllers_MouseDown); 53 | // 54 | // list_customControllers 55 | // 56 | this.list_customControllers.FormattingEnabled = true; 57 | this.list_customControllers.Location = new System.Drawing.Point(169, 27); 58 | this.list_customControllers.Name = "list_customControllers"; 59 | this.list_customControllers.Size = new System.Drawing.Size(103, 108); 60 | this.list_customControllers.TabIndex = 1; 61 | this.list_customControllers.SelectedValueChanged += new System.EventHandler(this.list_customControllers_SelectedValueChanged); 62 | this.list_customControllers.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_customControllers_MouseDown); 63 | // 64 | // btn_add 65 | // 66 | this.btn_add.Location = new System.Drawing.Point(121, 27); 67 | this.btn_add.Name = "btn_add"; 68 | this.btn_add.Size = new System.Drawing.Size(42, 23); 69 | this.btn_add.TabIndex = 2; 70 | this.btn_add.Text = "->"; 71 | this.btn_add.UseVisualStyleBackColor = true; 72 | this.btn_add.Click += new System.EventHandler(this.btn_add_Click); 73 | // 74 | // btn_remove 75 | // 76 | this.btn_remove.Location = new System.Drawing.Point(121, 112); 77 | this.btn_remove.Name = "btn_remove"; 78 | this.btn_remove.Size = new System.Drawing.Size(42, 23); 79 | this.btn_remove.TabIndex = 3; 80 | this.btn_remove.Text = "<-"; 81 | this.btn_remove.UseVisualStyleBackColor = true; 82 | this.btn_remove.Click += new System.EventHandler(this.btn_remove_Click); 83 | // 84 | // group_props 85 | // 86 | this.group_props.Controls.Add(this.chk_isLeft); 87 | this.group_props.Controls.Add(this.chk_isPro); 88 | this.group_props.Location = new System.Drawing.Point(122, 142); 89 | this.group_props.Name = "group_props"; 90 | this.group_props.Size = new System.Drawing.Size(150, 81); 91 | this.group_props.TabIndex = 4; 92 | this.group_props.TabStop = false; 93 | this.group_props.Text = "Settings"; 94 | // 95 | // chk_isLeft 96 | // 97 | this.chk_isLeft.AutoSize = true; 98 | this.chk_isLeft.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 99 | this.chk_isLeft.Location = new System.Drawing.Point(6, 42); 100 | this.chk_isLeft.Name = "chk_isLeft"; 101 | this.chk_isLeft.Size = new System.Drawing.Size(96, 17); 102 | this.chk_isLeft.TabIndex = 1; 103 | this.chk_isLeft.Text = "Left Joycon? "; 104 | this.chk_isLeft.UseVisualStyleBackColor = true; 105 | this.chk_isLeft.CheckedChanged += new System.EventHandler(this.chk_isLeft_CheckedChanged); 106 | // 107 | // chk_isPro 108 | // 109 | this.chk_isPro.AutoSize = true; 110 | this.chk_isPro.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; 111 | this.chk_isPro.Location = new System.Drawing.Point(6, 19); 112 | this.chk_isPro.Name = "chk_isPro"; 113 | this.chk_isPro.Size = new System.Drawing.Size(95, 17); 114 | this.chk_isPro.TabIndex = 0; 115 | this.chk_isPro.Text = "Pro Controller?"; 116 | this.chk_isPro.UseVisualStyleBackColor = true; 117 | this.chk_isPro.CheckedChanged += new System.EventHandler(this.chk_isPro_CheckedChanged); 118 | // 119 | // btn_applyAndClose 120 | // 121 | this.btn_applyAndClose.Location = new System.Drawing.Point(203, 229); 122 | this.btn_applyAndClose.Name = "btn_applyAndClose"; 123 | this.btn_applyAndClose.Size = new System.Drawing.Size(69, 23); 124 | this.btn_applyAndClose.TabIndex = 5; 125 | this.btn_applyAndClose.Text = "Close"; 126 | this.btn_applyAndClose.UseVisualStyleBackColor = true; 127 | this.btn_applyAndClose.Click += new System.EventHandler(this.btn_applyAndClose_Click); 128 | // 129 | // btn_apply 130 | // 131 | this.btn_apply.Location = new System.Drawing.Point(121, 229); 132 | this.btn_apply.Name = "btn_apply"; 133 | this.btn_apply.Size = new System.Drawing.Size(69, 23); 134 | this.btn_apply.TabIndex = 6; 135 | this.btn_apply.Text = "Apply"; 136 | this.btn_apply.UseVisualStyleBackColor = true; 137 | this.btn_apply.Click += new System.EventHandler(this.btn_apply_Click); 138 | // 139 | // lbl_all 140 | // 141 | this.lbl_all.AutoSize = true; 142 | this.lbl_all.Location = new System.Drawing.Point(12, 11); 143 | this.lbl_all.Name = "lbl_all"; 144 | this.lbl_all.Size = new System.Drawing.Size(60, 13); 145 | this.lbl_all.TabIndex = 7; 146 | this.lbl_all.Text = "All Devices"; 147 | // 148 | // label1 149 | // 150 | this.label1.AutoSize = true; 151 | this.label1.Location = new System.Drawing.Point(166, 11); 152 | this.label1.Name = "label1"; 153 | this.label1.Size = new System.Drawing.Size(91, 13); 154 | this.label1.TabIndex = 8; 155 | this.label1.Text = "Switch Controllers"; 156 | // 157 | // btn_refresh 158 | // 159 | this.btn_refresh.Location = new System.Drawing.Point(121, 56); 160 | this.btn_refresh.Name = "btn_refresh"; 161 | this.btn_refresh.Size = new System.Drawing.Size(42, 50); 162 | this.btn_refresh.TabIndex = 9; 163 | this.btn_refresh.Text = "Re-\r\nfresh"; 164 | this.btn_refresh.UseVisualStyleBackColor = true; 165 | this.btn_refresh.Click += new System.EventHandler(this.btn_refresh_Click); 166 | // 167 | // _3rdPartyControllers 168 | // 169 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 170 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 171 | this.ClientSize = new System.Drawing.Size(284, 261); 172 | this.Controls.Add(this.btn_refresh); 173 | this.Controls.Add(this.label1); 174 | this.Controls.Add(this.lbl_all); 175 | this.Controls.Add(this.btn_apply); 176 | this.Controls.Add(this.btn_applyAndClose); 177 | this.Controls.Add(this.group_props); 178 | this.Controls.Add(this.btn_remove); 179 | this.Controls.Add(this.btn_add); 180 | this.Controls.Add(this.list_customControllers); 181 | this.Controls.Add(this.list_allControllers); 182 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 183 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 184 | this.MaximizeBox = false; 185 | this.MinimizeBox = false; 186 | this.Name = "_3rdPartyControllers"; 187 | this.Text = "Add 3rd-Party Controllers"; 188 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this._3rdPartyControllers_FormClosing); 189 | this.group_props.ResumeLayout(false); 190 | this.group_props.PerformLayout(); 191 | this.ResumeLayout(false); 192 | this.PerformLayout(); 193 | 194 | } 195 | 196 | #endregion 197 | 198 | private System.Windows.Forms.ListBox list_allControllers; 199 | private System.Windows.Forms.ListBox list_customControllers; 200 | private System.Windows.Forms.Button btn_add; 201 | private System.Windows.Forms.Button btn_remove; 202 | private System.Windows.Forms.GroupBox group_props; 203 | private System.Windows.Forms.Button btn_applyAndClose; 204 | private System.Windows.Forms.Button btn_apply; 205 | private System.Windows.Forms.Label lbl_all; 206 | private System.Windows.Forms.CheckBox chk_isPro; 207 | private System.Windows.Forms.Label label1; 208 | private System.Windows.Forms.CheckBox chk_isLeft; 209 | private System.Windows.Forms.ToolTip tip_device; 210 | private System.Windows.Forms.Button btn_refresh; 211 | } 212 | } -------------------------------------------------------------------------------- /BetterJoyForDolphin/3rdPartyControllers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | using static BetterJoyForDolphin.HIDapi; 13 | 14 | namespace BetterJoyForDolphin { 15 | public partial class _3rdPartyControllers : Form { 16 | public _3rdPartyControllers() { 17 | InitializeComponent(); 18 | list_allControllers.DisplayMember = "Text"; 19 | list_allControllers.ValueMember = "Value"; 20 | list_customControllers.DisplayMember = "Text"; 21 | list_customControllers.ValueMember = "Value"; 22 | 23 | RefreshControllerList(); 24 | 25 | group_props.Controls.Add(chk_isLeft); 26 | group_props.Controls.Add(chk_isPro); 27 | group_props.Enabled = false; 28 | } 29 | 30 | private bool ContainsText(ListBox a, String manu) { 31 | foreach (var v in a.Items) 32 | { 33 | dynamic d = v as dynamic; 34 | if (d.Text == null) 35 | continue; 36 | if (d.Text.Equals(manu)) 37 | return true; 38 | } 39 | return false; 40 | } 41 | 42 | private void RefreshControllerList() { 43 | list_allControllers.Items.Clear(); 44 | IntPtr ptr = HIDapi.hid_enumerate(0x0, 0x0); 45 | IntPtr top_ptr = ptr; 46 | 47 | hid_device_info enumerate; // Add device to list 48 | while (ptr != IntPtr.Zero) { 49 | enumerate = (hid_device_info)Marshal.PtrToStructure(ptr, typeof(hid_device_info)); 50 | 51 | if (!ContainsText(list_customControllers, enumerate.product_string) && !ContainsText(list_allControllers, enumerate.product_string)) 52 | list_allControllers.Items.Add(new { Text = enumerate.product_string, Value = enumerate }); 53 | 54 | ptr = enumerate.next; 55 | } 56 | } 57 | 58 | private void btn_add_Click(object sender, EventArgs e) { 59 | if (list_allControllers.SelectedItem != null) { 60 | list_customControllers.Items.Add(list_allControllers.SelectedItem); 61 | list_allControllers.Items.Remove(list_allControllers.SelectedItem); 62 | list_allControllers.ClearSelected(); 63 | } 64 | } 65 | 66 | private void btn_remove_Click(object sender, EventArgs e) { 67 | if (list_customControllers.SelectedItem != null) { 68 | list_allControllers.Items.Add(list_customControllers.SelectedItem); 69 | list_customControllers.Items.Remove(list_customControllers.SelectedItem); 70 | list_customControllers.ClearSelected(); 71 | } 72 | } 73 | 74 | private void chk_isPro_CheckedChanged(object sender, EventArgs e) { 75 | 76 | } 77 | 78 | private void chk_isLeft_CheckedChanged(object sender, EventArgs e) { 79 | 80 | } 81 | 82 | private void btn_apply_Click(object sender, EventArgs e) { 83 | 84 | } 85 | 86 | private void btn_applyAndClose_Click(object sender, EventArgs e) { 87 | btn_apply_Click(sender, e); 88 | Close(); 89 | } 90 | 91 | private void _3rdPartyControllers_FormClosing(object sender, FormClosingEventArgs e) { 92 | btn_apply_Click(sender, e); 93 | } 94 | 95 | private void btn_refresh_Click(object sender, EventArgs e) { 96 | RefreshControllerList(); 97 | } 98 | 99 | private void list_allControllers_SelectedValueChanged(object sender, EventArgs e) { 100 | if (list_allControllers.SelectedItem != null) 101 | tip_device.Show((list_allControllers.SelectedItem as dynamic).Text, list_allControllers); 102 | } 103 | 104 | private void list_customControllers_SelectedValueChanged(object sender, EventArgs e) { 105 | if (list_customControllers.SelectedItem != null) { 106 | tip_device.Show((list_customControllers.SelectedItem as dynamic).Text, list_customControllers); 107 | group_props.Enabled = true; 108 | } else 109 | group_props.Enabled = false; 110 | } 111 | 112 | private void list_customControllers_MouseDown(object sender, MouseEventArgs e) { 113 | if (e.Y > list_customControllers.ItemHeight * list_customControllers.Items.Count) 114 | list_customControllers.SelectedItems.Clear(); 115 | } 116 | 117 | private void list_allControllers_MouseDown(object sender, MouseEventArgs e) { 118 | if (e.Y > list_allControllers.ItemHeight * list_allControllers.Items.Count) 119 | list_allControllers.SelectedItems.Clear(); 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 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 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/BetterJoyForDolphin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Debug 8 | AnyCPU 9 | {1BF709E9-C133-41DF-933A-C9FF3F664C7B} 10 | WinExe 11 | BetterJoyForDolphin 12 | BetterJoyForDolphin 13 | v4.6.1 14 | 512 15 | true 16 | 17 | 18 | false 19 | publish\X64\ 20 | true 21 | Disk 22 | false 23 | Foreground 24 | 7 25 | Days 26 | false 27 | false 28 | true 29 | 2 30 | 6.1.0.%2a 31 | false 32 | true 33 | true 34 | 35 | 36 | AnyCPU 37 | true 38 | full 39 | false 40 | bin\Debug\ 41 | DEBUG;TRACE 42 | prompt 43 | 4 44 | 45 | 46 | AnyCPU 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | 54 | 55 | true 56 | bin\x86\Debug\ 57 | DEBUG;TRACE 58 | full 59 | x86 60 | prompt 61 | MinimumRecommendedRules.ruleset 62 | true 63 | 64 | 65 | bin\x86\Release\ 66 | TRACE 67 | true 68 | pdbonly 69 | x86 70 | prompt 71 | MinimumRecommendedRules.ruleset 72 | true 73 | 74 | 75 | true 76 | bin\x64\Debug\ 77 | DEBUG;TRACE 78 | full 79 | x64 80 | prompt 81 | MinimumRecommendedRules.ruleset 82 | true 83 | 84 | 85 | bin\x64\Release\ 86 | TRACE 87 | true 88 | pdbonly 89 | x64 90 | prompt 91 | MinimumRecommendedRules.ruleset 92 | true 93 | 94 | 95 | 96 | 97 | 98 | 99 | betterjoyfordolphin_icon.ico 100 | 101 | 102 | 4851FF155DC95EE211DC1C3DC4D481AF39F383BB 103 | 104 | 105 | BetterJoyForCemu_TemporaryKey.pfx 106 | 107 | 108 | false 109 | 110 | 111 | LocalIntranet 112 | 113 | 114 | Properties\app.manifest 115 | 116 | 117 | false 118 | 119 | 120 | 121 | ..\packages\Costura.Fody.3.3.1\lib\net40\Costura.dll 122 | 123 | 124 | ..\packages\Crc32.NET.1.2.0\lib\net20\Crc32.NET.dll 125 | 126 | 127 | ..\packages\Fielder.Fody.1.2.3\lib\net452\Fielder.dll 128 | 129 | 130 | ..\packages\Nefarius.ViGEmClient.1.15.16\lib\net452\Nefarius.ViGEmClient.dll 131 | 132 | 133 | ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | Form 153 | 154 | 155 | 3rdPartyControllers.cs 156 | 157 | 158 | 159 | Form 160 | 161 | 162 | DolphinConfig.cs 163 | 164 | 165 | 166 | Form 167 | 168 | 169 | Donate.cs 170 | 171 | 172 | 173 | 174 | 175 | 176 | Form 177 | 178 | 179 | MainForm.cs 180 | 181 | 182 | 183 | 184 | True 185 | True 186 | Resources.resx 187 | 188 | 189 | 190 | 191 | 192 | Designer 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | PreserveNewest 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 3rdPartyControllers.cs 216 | 217 | 218 | DolphinConfig.cs 219 | 220 | 221 | Donate.cs 222 | 223 | 224 | MainForm.cs 225 | Designer 226 | 227 | 228 | ResXFileCodeGenerator 229 | Resources.Designer.cs 230 | Designer 231 | 232 | 233 | 234 | 235 | False 236 | Microsoft .NET Framework 4.6.1 %28x86 and x64%29 237 | true 238 | 239 | 240 | False 241 | .NET Framework 3.5 SP1 242 | false 243 | 244 | 245 | 246 | 247 | 248 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 249 | 250 | 251 | 252 | 253 | 254 | 255 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/Class1.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 BetterJoyForCemu 8 | { 9 | class Class1 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace BetterJoyForDolphin { 9 | public static class Config { // stores dynamic configuration, including 10 | const string PATH = "settings"; 11 | static Dictionary variables = new Dictionary(); 12 | 13 | const int settingsNum = 2; // currently - ProgressiveScan, StartInTray 14 | 15 | public static void Init(List> caliData) { 16 | variables["ProgressiveScan"] = true; 17 | variables["StartInTray"] = false; 18 | 19 | if (File.Exists(PATH)) { 20 | using (StreamReader file = new StreamReader(PATH)) { 21 | string line = String.Empty; 22 | int lineNO = 0; 23 | while ((line = file.ReadLine()) != null) { 24 | string[] vs = line.Split(); 25 | try { 26 | if (lineNO < settingsNum) { // load in basic settings 27 | variables[vs[0]] = Boolean.Parse(vs[1]); 28 | } else { // load in calibration presets 29 | caliData.Clear(); 30 | for (int i = 0; i < vs.Length; i++) { 31 | string[] caliArr = vs[i].Split(','); 32 | float[] newArr = new float[6]; 33 | for (int j = 1; j < caliArr.Length; j++) { 34 | newArr[j - 1] = float.Parse(caliArr[j]); 35 | } 36 | caliData.Add(new KeyValuePair( 37 | caliArr[0], 38 | newArr 39 | )); 40 | } 41 | } 42 | } catch { } 43 | lineNO++; 44 | } 45 | } 46 | } else { 47 | using (StreamWriter file = new StreamWriter(PATH)) { 48 | foreach (string k in variables.Keys) 49 | file.WriteLine(String.Format("{0} {1}", k, variables[k])); 50 | string caliStr = ""; 51 | for (int i = 0; i < caliData.Count; i++) { 52 | string space = " "; 53 | if (i == 0) space = ""; 54 | caliStr += space + caliData[i].Key + "," + String.Join(",", caliData[i].Value); 55 | } 56 | file.WriteLine(caliStr); 57 | } 58 | } 59 | } 60 | 61 | public static bool Value(string key) { 62 | if (!variables.ContainsKey("ProgressiveScan") && !variables.ContainsKey("StartInTray")) { 63 | return false; 64 | } 65 | return variables[key]; 66 | } 67 | 68 | public static void SaveCaliData(List> caliData) { 69 | string[] txt = File.ReadAllLines(PATH); 70 | if (txt.Length < settingsNum + 1) // no custom calibrations yet 71 | Array.Resize(ref txt, txt.Length + 1); 72 | 73 | string caliStr = ""; 74 | for (int i = 0; i < caliData.Count; i++) { 75 | string space = " "; 76 | if (i == 0) space = ""; 77 | caliStr += space + caliData[i].Key + "," + String.Join(",", caliData[i].Value); 78 | } 79 | txt[2] = caliStr; 80 | File.WriteAllLines(PATH, txt); 81 | } 82 | 83 | public static void Save(string key, bool value) { 84 | variables[key] = value; 85 | string[] txt = File.ReadAllLines(PATH); 86 | int NO = 0; 87 | foreach (string k in variables.Keys) { 88 | txt[NO] = String.Format("{0} {1}", k, variables[k]); 89 | NO++; 90 | } 91 | File.WriteAllLines(PATH, txt); 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /BetterJoyForDolphin/DolphinConfig.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BetterJoyForDolphin 2 | { 3 | partial class DolphinConfig 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DolphinConfig)); 32 | this.sensibilityBar = new System.Windows.Forms.TrackBar(); 33 | this.applyBtn = new System.Windows.Forms.Button(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | this.defaultBtn = new System.Windows.Forms.Button(); 36 | this.checkBoxX = new System.Windows.Forms.CheckBox(); 37 | this.label3 = new System.Windows.Forms.Label(); 38 | this.checkBoxY = new System.Windows.Forms.CheckBox(); 39 | this.checkBoxZ = new System.Windows.Forms.CheckBox(); 40 | this.label4 = new System.Windows.Forms.Label(); 41 | this.con1 = new System.Windows.Forms.Button(); 42 | this.ProRadio = new System.Windows.Forms.RadioButton(); 43 | this.LeftRadio = new System.Windows.Forms.RadioButton(); 44 | this.RightRadio = new System.Windows.Forms.RadioButton(); 45 | this.serialNumberLabel = new System.Windows.Forms.Label(); 46 | ((System.ComponentModel.ISupportInitialize)(this.sensibilityBar)).BeginInit(); 47 | this.SuspendLayout(); 48 | // 49 | // sensibilityBar 50 | // 51 | this.sensibilityBar.Location = new System.Drawing.Point(12, 133); 52 | this.sensibilityBar.Maximum = 15; 53 | this.sensibilityBar.Minimum = 1; 54 | this.sensibilityBar.Name = "sensibilityBar"; 55 | this.sensibilityBar.Size = new System.Drawing.Size(260, 45); 56 | this.sensibilityBar.TabIndex = 0; 57 | this.sensibilityBar.Value = 5; 58 | // 59 | // applyBtn 60 | // 61 | this.applyBtn.Location = new System.Drawing.Point(197, 229); 62 | this.applyBtn.Name = "applyBtn"; 63 | this.applyBtn.Size = new System.Drawing.Size(75, 23); 64 | this.applyBtn.TabIndex = 2; 65 | this.applyBtn.Text = "Apply"; 66 | this.applyBtn.UseVisualStyleBackColor = true; 67 | this.applyBtn.Click += new System.EventHandler(this.button1_Click); 68 | // 69 | // label2 70 | // 71 | this.label2.AutoSize = true; 72 | this.label2.Location = new System.Drawing.Point(13, 104); 73 | this.label2.Name = "label2"; 74 | this.label2.Size = new System.Drawing.Size(53, 13); 75 | this.label2.TabIndex = 3; 76 | this.label2.Text = "Sensibility"; 77 | // 78 | // defaultBtn 79 | // 80 | this.defaultBtn.Location = new System.Drawing.Point(12, 229); 81 | this.defaultBtn.Name = "defaultBtn"; 82 | this.defaultBtn.Size = new System.Drawing.Size(75, 23); 83 | this.defaultBtn.TabIndex = 4; 84 | this.defaultBtn.Text = "Set default"; 85 | this.defaultBtn.UseVisualStyleBackColor = true; 86 | this.defaultBtn.Click += new System.EventHandler(this.button2_Click); 87 | // 88 | // checkBoxX 89 | // 90 | this.checkBoxX.AutoSize = true; 91 | this.checkBoxX.Location = new System.Drawing.Point(16, 202); 92 | this.checkBoxX.Name = "checkBoxX"; 93 | this.checkBoxX.Size = new System.Drawing.Size(84, 17); 94 | this.checkBoxX.TabIndex = 5; 95 | this.checkBoxX.Text = "Invert X axis"; 96 | this.checkBoxX.UseVisualStyleBackColor = true; 97 | // 98 | // label3 99 | // 100 | this.label3.AutoSize = true; 101 | this.label3.Location = new System.Drawing.Point(13, 181); 102 | this.label3.Name = "label3"; 103 | this.label3.Size = new System.Drawing.Size(58, 13); 104 | this.label3.TabIndex = 6; 105 | this.label3.Text = "Axis config"; 106 | // 107 | // checkBoxY 108 | // 109 | this.checkBoxY.AutoSize = true; 110 | this.checkBoxY.Location = new System.Drawing.Point(100, 203); 111 | this.checkBoxY.Name = "checkBoxY"; 112 | this.checkBoxY.Size = new System.Drawing.Size(84, 17); 113 | this.checkBoxY.TabIndex = 7; 114 | this.checkBoxY.Text = "Invert Y axis"; 115 | this.checkBoxY.UseVisualStyleBackColor = true; 116 | // 117 | // checkBoxZ 118 | // 119 | this.checkBoxZ.AutoSize = true; 120 | this.checkBoxZ.Location = new System.Drawing.Point(188, 203); 121 | this.checkBoxZ.Name = "checkBoxZ"; 122 | this.checkBoxZ.Size = new System.Drawing.Size(84, 17); 123 | this.checkBoxZ.TabIndex = 8; 124 | this.checkBoxZ.Text = "Invert Z axis"; 125 | this.checkBoxZ.UseVisualStyleBackColor = true; 126 | // 127 | // label4 128 | // 129 | this.label4.AutoSize = true; 130 | this.label4.Location = new System.Drawing.Point(12, 9); 131 | this.label4.Name = "label4"; 132 | this.label4.Size = new System.Drawing.Size(74, 13); 133 | this.label4.TabIndex = 9; 134 | this.label4.Text = "Controller type"; 135 | // 136 | // con1 137 | // 138 | this.con1.BackgroundImage = global::BetterJoyForDolphin.Properties.Resources.pro; 139 | this.con1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 140 | this.con1.Enabled = false; 141 | this.con1.Location = new System.Drawing.Point(49, 31); 142 | this.con1.Name = "con1"; 143 | this.con1.Size = new System.Drawing.Size(58, 59); 144 | this.con1.TabIndex = 10; 145 | this.con1.TabStop = false; 146 | this.con1.UseVisualStyleBackColor = true; 147 | // 148 | // ProRadio 149 | // 150 | this.ProRadio.AutoSize = true; 151 | this.ProRadio.Location = new System.Drawing.Point(150, 31); 152 | this.ProRadio.Name = "ProRadio"; 153 | this.ProRadio.Size = new System.Drawing.Size(88, 17); 154 | this.ProRadio.TabIndex = 11; 155 | this.ProRadio.Text = "Pro Controller"; 156 | this.ProRadio.UseVisualStyleBackColor = true; 157 | this.ProRadio.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged); 158 | // 159 | // LeftRadio 160 | // 161 | this.LeftRadio.AutoSize = true; 162 | this.LeftRadio.Location = new System.Drawing.Point(150, 55); 163 | this.LeftRadio.Name = "LeftRadio"; 164 | this.LeftRadio.Size = new System.Drawing.Size(80, 17); 165 | this.LeftRadio.TabIndex = 12; 166 | this.LeftRadio.Text = "Left Joycon"; 167 | this.LeftRadio.UseVisualStyleBackColor = true; 168 | this.LeftRadio.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged); 169 | // 170 | // RightRadio 171 | // 172 | this.RightRadio.AutoSize = true; 173 | this.RightRadio.Location = new System.Drawing.Point(150, 79); 174 | this.RightRadio.Name = "RightRadio"; 175 | this.RightRadio.Size = new System.Drawing.Size(87, 17); 176 | this.RightRadio.TabIndex = 13; 177 | this.RightRadio.Text = "Right Joycon"; 178 | this.RightRadio.UseVisualStyleBackColor = true; 179 | this.RightRadio.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged); 180 | // 181 | // serialNumberLabel 182 | // 183 | this.serialNumberLabel.AutoSize = true; 184 | this.serialNumberLabel.Location = new System.Drawing.Point(185, 9); 185 | this.serialNumberLabel.Name = "serialNumberLabel"; 186 | this.serialNumberLabel.Size = new System.Drawing.Size(94, 13); 187 | this.serialNumberLabel.TabIndex = 14; 188 | this.serialNumberLabel.Text = "serialNumberLabel"; 189 | // 190 | // DolphinConfig 191 | // 192 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 193 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 194 | this.ClientSize = new System.Drawing.Size(284, 261); 195 | this.Controls.Add(this.serialNumberLabel); 196 | this.Controls.Add(this.RightRadio); 197 | this.Controls.Add(this.LeftRadio); 198 | this.Controls.Add(this.ProRadio); 199 | this.Controls.Add(this.con1); 200 | this.Controls.Add(this.label4); 201 | this.Controls.Add(this.checkBoxZ); 202 | this.Controls.Add(this.checkBoxY); 203 | this.Controls.Add(this.label3); 204 | this.Controls.Add(this.checkBoxX); 205 | this.Controls.Add(this.defaultBtn); 206 | this.Controls.Add(this.label2); 207 | this.Controls.Add(this.applyBtn); 208 | this.Controls.Add(this.sensibilityBar); 209 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 210 | this.Name = "DolphinConfig"; 211 | this.Text = "DolphinConfig"; 212 | this.Load += new System.EventHandler(this.DolphinConfig_Load); 213 | ((System.ComponentModel.ISupportInitialize)(this.sensibilityBar)).EndInit(); 214 | this.ResumeLayout(false); 215 | this.PerformLayout(); 216 | 217 | } 218 | 219 | #endregion 220 | 221 | private System.Windows.Forms.TrackBar sensibilityBar; 222 | private System.Windows.Forms.Label label1; 223 | private System.Windows.Forms.Button applyBtn; 224 | private System.Windows.Forms.Label label2; 225 | private System.Windows.Forms.Button defaultBtn; 226 | private System.Windows.Forms.CheckBox checkBoxX; 227 | private System.Windows.Forms.Label label3; 228 | private System.Windows.Forms.CheckBox checkBoxY; 229 | private System.Windows.Forms.CheckBox checkBoxZ; 230 | private System.Windows.Forms.Label label4; 231 | private System.Windows.Forms.Button con1; 232 | private System.Windows.Forms.RadioButton ProRadio; 233 | private System.Windows.Forms.RadioButton LeftRadio; 234 | private System.Windows.Forms.RadioButton RightRadio; 235 | private System.Windows.Forms.Label serialNumberLabel; 236 | } 237 | } -------------------------------------------------------------------------------- /BetterJoyForDolphin/DolphinConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace BetterJoyForDolphin 12 | { 13 | public partial class DolphinConfig : Form 14 | { 15 | private Joycon joy; 16 | private ushort id = 0x2009; 17 | int typeChanged; 18 | 19 | public DolphinConfig(Joycon joy = null) 20 | { 21 | typeChanged = 0; 22 | this.joy = joy; 23 | InitializeComponent(); 24 | sensibilityBar.Value = joy.GetPack().GetForce(); 25 | 26 | if (!joy.isPro && joy.isLeft) 27 | { 28 | LeftRadio.Checked = true; 29 | } 30 | else if (!joy.isPro && !joy.isLeft) 31 | { 32 | RightRadio.Checked = true; 33 | } 34 | else { 35 | ProRadio.Checked = true; 36 | } 37 | 38 | int[] inverted = joy.GetPack().GetInverted(); 39 | 40 | checkBoxX.Checked = inverted[0] < 1 ? true : false; 41 | checkBoxY.Checked = inverted[1] < 1 ? true : false; 42 | checkBoxZ.Checked = inverted[2] < 1 ? true : false; 43 | 44 | serialNumberLabel.Text = joy.serial_number; 45 | } 46 | 47 | // Apply btn is clicked 48 | private void button1_Click(object sender, EventArgs e) 49 | { 50 | int x = 1; 51 | int y = 1; 52 | int z = 1; 53 | 54 | if (checkBoxX.Checked) { 55 | x = -1; 56 | } 57 | 58 | if (checkBoxY.Checked) 59 | { 60 | y = -1; 61 | } 62 | 63 | if (checkBoxZ.Checked) 64 | { 65 | z = -1; 66 | } 67 | 68 | joy.GetPack().SetForce(sensibilityBar.Value); 69 | joy.GetPack().SetInverted(x, y, z); 70 | Program.generic_manager.AddSerial(joy.serial_number, id, force: sensibilityBar.Value,x:x,y:y,z:z); 71 | Program.generic_manager.SaveSerials(); 72 | this.Close(); 73 | if (typeChanged > 1) 74 | { 75 | Application.Restart(); 76 | Environment.Exit(0); 77 | } 78 | } 79 | 80 | // Default Btn is clicked 81 | private void button2_Click(object sender, EventArgs e) 82 | { 83 | sensibilityBar.Value = 10; 84 | checkBoxX.Checked = false; 85 | checkBoxY.Checked = false; 86 | checkBoxZ.Checked = false; 87 | //ProRadio.Checked = true; 88 | 89 | } 90 | 91 | 92 | private void radioButton1_CheckedChanged(object sender, EventArgs e) 93 | { 94 | if (ProRadio.Checked) { 95 | con1.BackgroundImage = Properties.Resources.pro; 96 | id = 0x2009; 97 | typeChanged++; 98 | } 99 | } 100 | 101 | private void radioButton2_CheckedChanged(object sender, EventArgs e) 102 | { 103 | if (LeftRadio.Checked) 104 | { 105 | con1.BackgroundImage = Properties.Resources.jc_left; 106 | id = 0x2006; 107 | typeChanged++; 108 | } 109 | } 110 | 111 | private void radioButton3_CheckedChanged(object sender, EventArgs e) 112 | { 113 | if (RightRadio.Checked) 114 | { 115 | con1.BackgroundImage = Properties.Resources.jc_right; 116 | id = 0x2007; 117 | typeChanged++; 118 | } 119 | } 120 | 121 | private void DolphinConfig_Load(object sender, EventArgs e) 122 | { 123 | 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/DolphinJoyConfig.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 BetterJoyForDolphin 8 | { 9 | struct DolphinJoyConfig 10 | { 11 | public string serial_number; 12 | public int force; 13 | public int[] inverse; 14 | public ushort product_id; 15 | 16 | public void LoadConfig(string input) { 17 | 18 | string[] config = input.Split('|'); 19 | 20 | SetConfig(config[0], ushort.Parse(config[1]), int.Parse(config[2]), int.Parse(config[3]), int.Parse(config[4]), int.Parse(config[5])); 21 | 22 | } 23 | 24 | public void SetConfig(string serial, ushort id, int force = 10, int x = 1, int y = 1, int z = 1) { 25 | 26 | serial_number = serial; 27 | product_id = id; 28 | this.force = force; 29 | inverse = new int[]{x,y,z}; 30 | 31 | } 32 | 33 | public string GetConfig() { 34 | 35 | return serial_number + "|" + product_id + "|" + force + "|" + inverse[0] + "|" + inverse[1] + "|" + inverse[2]; 36 | 37 | } 38 | 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/Donate.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BetterJoyForDolphin 2 | { 3 | partial class DonatePanel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DonatePanel)); 32 | this.linkLabel1 = new System.Windows.Forms.LinkLabel(); 33 | this.linkLabel2 = new System.Windows.Forms.LinkLabel(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.SuspendLayout(); 37 | // 38 | // linkLabel1 39 | // 40 | this.linkLabel1.AutoSize = true; 41 | this.linkLabel1.Location = new System.Drawing.Point(13, 25); 42 | this.linkLabel1.Name = "linkLabel1"; 43 | this.linkLabel1.Size = new System.Drawing.Size(106, 13); 44 | this.linkLabel1.TabIndex = 0; 45 | this.linkLabel1.TabStop = true; 46 | this.linkLabel1.Text = "Donate to Davidobot"; 47 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 48 | // 49 | // linkLabel2 50 | // 51 | this.linkLabel2.AutoSize = true; 52 | this.linkLabel2.Location = new System.Drawing.Point(13, 69); 53 | this.linkLabel2.Name = "linkLabel2"; 54 | this.linkLabel2.Size = new System.Drawing.Size(88, 13); 55 | this.linkLabel2.TabIndex = 1; 56 | this.linkLabel2.TabStop = true; 57 | this.linkLabel2.Text = "Donate to Yuk27"; 58 | this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); 59 | // 60 | // label1 61 | // 62 | this.label1.AutoSize = true; 63 | this.label1.Location = new System.Drawing.Point(13, 9); 64 | this.label1.Name = "label1"; 65 | this.label1.Size = new System.Drawing.Size(240, 13); 66 | this.label1.TabIndex = 2; 67 | this.label1.Text = "Donate to the development of BetterJoyForCemu:"; 68 | // 69 | // label2 70 | // 71 | this.label2.AutoSize = true; 72 | this.label2.Location = new System.Drawing.Point(13, 54); 73 | this.label2.Name = "label2"; 74 | this.label2.Size = new System.Drawing.Size(249, 13); 75 | this.label2.TabIndex = 3; 76 | this.label2.Text = "Donate to the development of BetterJoyForDolphin:"; 77 | // 78 | // DonatePanel 79 | // 80 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 81 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 82 | this.ClientSize = new System.Drawing.Size(267, 92); 83 | this.Controls.Add(this.label2); 84 | this.Controls.Add(this.label1); 85 | this.Controls.Add(this.linkLabel2); 86 | this.Controls.Add(this.linkLabel1); 87 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 88 | this.Name = "DonatePanel"; 89 | this.Text = "Donate"; 90 | this.ResumeLayout(false); 91 | this.PerformLayout(); 92 | 93 | } 94 | 95 | #endregion 96 | 97 | private System.Windows.Forms.LinkLabel linkLabel1; 98 | private System.Windows.Forms.LinkLabel linkLabel2; 99 | private System.Windows.Forms.Label label1; 100 | private System.Windows.Forms.Label label2; 101 | } 102 | } -------------------------------------------------------------------------------- /BetterJoyForDolphin/Donate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace BetterJoyForDolphin 12 | { 13 | public partial class DonatePanel : Form 14 | { 15 | public DonatePanel() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 21 | { 22 | linkLabel1.LinkVisited = true; 23 | System.Diagnostics.Process.Start("http://paypal.me/DavidKhachaturov/5"); 24 | } 25 | 26 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 27 | { 28 | linkLabel2.LinkVisited = true; 29 | System.Diagnostics.Process.Start("https://www.paypal.me/yuk27/3"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks 14 | 15 | 16 | 17 | 18 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. 19 | 20 | 21 | 22 | 23 | A list of unmanaged 32 bit assembly names to include, delimited with line breaks. 24 | 25 | 26 | 27 | 28 | A list of unmanaged 64 bit assembly names to include, delimited with line breaks. 29 | 30 | 31 | 32 | 33 | The order of preloaded assemblies, delimited with line breaks. 34 | 35 | 36 | 37 | 38 | 39 | This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. 40 | 41 | 42 | 43 | 44 | Controls if .pdbs for reference assemblies are also embedded. 45 | 46 | 47 | 48 | 49 | Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. 50 | 51 | 52 | 53 | 54 | As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. 55 | 56 | 57 | 58 | 59 | Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. 60 | 61 | 62 | 63 | 64 | Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. 65 | 66 | 67 | 68 | 69 | A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | 70 | 71 | 72 | 73 | 74 | A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. 75 | 76 | 77 | 78 | 79 | A list of unmanaged 32 bit assembly names to include, delimited with |. 80 | 81 | 82 | 83 | 84 | A list of unmanaged 64 bit assembly names to include, delimited with |. 85 | 86 | 87 | 88 | 89 | The order of preloaded assemblies, delimited with |. 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 98 | 99 | 100 | 101 | 102 | A comma-separated list of error codes that can be safely ignored in assembly verification. 103 | 104 | 105 | 106 | 107 | 'false' to turn off automatic generation of the XML Schema file. 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/GenericControllerManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace BetterJoyForDolphin 9 | { 10 | class GenericControllerManager 11 | { 12 | List joysConfig; 13 | 14 | private const ushort product_l = 0x2006; 15 | private const ushort product_r = 0x2007; 16 | private const ushort product_pro = 0x2009; 17 | 18 | //private string leftFile = "LeftSerials.dat"; 19 | //private string rightFile = "rightSerials.dat"; 20 | 21 | private string file = "Serials.dat"; 22 | 23 | public GenericControllerManager() { 24 | 25 | LoadSerials(); 26 | 27 | } 28 | 29 | public void SaveSerials() { 30 | string[] stringConfig = new string[joysConfig.Count]; 31 | 32 | for (int i = 0; i < joysConfig.Count; i++) { 33 | stringConfig[i] = joysConfig[i].GetConfig(); 34 | } 35 | 36 | SaveJoy(stringConfig, file); 37 | } 38 | 39 | public void LoadSerials() { 40 | joysConfig = GetSerials(file); 41 | } 42 | 43 | public DolphinJoyConfig Contains(string serial) { 44 | 45 | foreach (DolphinJoyConfig config in joysConfig) 46 | { 47 | if (config.serial_number == serial) 48 | { 49 | return config; 50 | } 51 | } 52 | 53 | DolphinJoyConfig instance = new DolphinJoyConfig(); 54 | instance.SetConfig("-1", 0x2009); 55 | return instance; 56 | } 57 | 58 | public void AddSerial(string serial, ushort id, int force = 10, int x = 1, int y = 1, int z = 1) { 59 | 60 | bool found = false; 61 | 62 | for (int i = 0; i < joysConfig.Count; i++) { 63 | if (joysConfig[i].serial_number == serial) { 64 | DolphinJoyConfig config = joysConfig[i]; 65 | config.SetConfig(serial, id, force, x, y, z); 66 | joysConfig[i] = config; 67 | found = true; 68 | break; 69 | } 70 | } 71 | 72 | if (!found) { 73 | DolphinJoyConfig instance = new DolphinJoyConfig(); 74 | instance.SetConfig(serial,id, force, x,y,z); 75 | joysConfig.Add(instance); 76 | } 77 | 78 | } 79 | 80 | public List GetSerials(string filename) { 81 | 82 | List serials = new List(); 83 | 84 | if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory + filename)) 85 | { 86 | string[] configs = System.IO.File.ReadAllLines(filename); 87 | 88 | foreach (string config in configs) 89 | { 90 | DolphinJoyConfig instance = new DolphinJoyConfig(); 91 | instance.LoadConfig(config); 92 | serials.Add(instance); 93 | } 94 | 95 | } 96 | else { 97 | System.IO.File.Create(AppDomain.CurrentDomain.BaseDirectory + filename); 98 | } 99 | 100 | return serials; 101 | } 102 | 103 | public void SaveJoy(string[] serialsStrings, string filename) { 104 | string path = AppDomain.CurrentDomain.BaseDirectory + filename; 105 | System.IO.File.WriteAllLines(path, serialsStrings); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/HIDapi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace BetterJoyForDolphin { 5 | public class HIDapi { 6 | #if LINUX 7 | const string dll = "libhidapi.so"; 8 | #else 9 | const string dll = "hidapi.dll"; 10 | #endif 11 | 12 | public struct hid_device_info { 13 | [MarshalAs(UnmanagedType.LPStr)] 14 | public string path; 15 | public ushort vendor_id; 16 | public ushort product_id; 17 | [MarshalAs(UnmanagedType.LPWStr)] 18 | public string serial_number; 19 | public ushort release_number; 20 | [MarshalAs(UnmanagedType.LPWStr)] 21 | public string manufacturer_string; 22 | [MarshalAs(UnmanagedType.LPWStr)] 23 | public string product_string; 24 | public ushort usage_page; 25 | public ushort usage; 26 | public int interface_number; 27 | public IntPtr next; 28 | }; 29 | 30 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 31 | public static extern int hid_init(); 32 | 33 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 34 | public static extern int hid_exit(); 35 | 36 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 37 | public static extern IntPtr hid_enumerate(ushort vendor_id, ushort product_id); 38 | 39 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 40 | public static extern void hid_free_enumeration(IntPtr phid_device_info); 41 | 42 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 43 | public static extern IntPtr hid_open(ushort vendor_id, ushort product_id, [MarshalAs(UnmanagedType.LPWStr)]string serial_number); 44 | 45 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 46 | public static extern IntPtr hid_open_path([MarshalAs(UnmanagedType.LPStr)]string path); 47 | 48 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 49 | public static extern int hid_write(IntPtr device, byte[] data, UIntPtr length); 50 | 51 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 52 | public static extern int hid_read_timeout(IntPtr dev, byte[] data, UIntPtr length, int milliseconds); 53 | 54 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 55 | public static extern int hid_read(IntPtr device, byte[] data, UIntPtr length); 56 | 57 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 58 | public static extern int hid_set_nonblocking(IntPtr device, int nonblock); 59 | 60 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 61 | public static extern int hid_send_feature_report(IntPtr device, byte[] data, UIntPtr length); 62 | 63 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 64 | public static extern int hid_get_feature_report(IntPtr device, byte[] data, UIntPtr length); 65 | 66 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 67 | public static extern void hid_close(IntPtr device); 68 | 69 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 70 | public static extern int hid_get_manufacturer_string(IntPtr device, [MarshalAs(UnmanagedType.LPWStr)]string string_, UIntPtr maxlen); 71 | 72 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 73 | public static extern int hid_get_product_string(IntPtr device, [MarshalAs(UnmanagedType.LPWStr)]string string_, UIntPtr maxlen); 74 | 75 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 76 | public static extern int hid_get_serial_number_string(IntPtr device, [MarshalAs(UnmanagedType.LPWStr)]string string_, UIntPtr maxlen); 77 | 78 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 79 | public static extern int hid_get_indexed_string(IntPtr device, int string_index, [MarshalAs(UnmanagedType.LPWStr)]string string_, UIntPtr maxlen); 80 | 81 | [DllImport(dll, CallingConvention = CallingConvention.Cdecl)] 82 | [return: MarshalAs(UnmanagedType.LPWStr)] 83 | public static extern string hid_error(IntPtr device); 84 | 85 | static void PrintEnumeration(IntPtr phid_device_info) { 86 | if (!phid_device_info.Equals(IntPtr.Zero)) { 87 | hid_device_info hdev = (hid_device_info)Marshal.PtrToStructure(phid_device_info, typeof(hid_device_info)); 88 | 89 | Console.WriteLine(string.Format("path: {0}", hdev.path)); 90 | Console.WriteLine(string.Format("vendor id: {0:X}", hdev.vendor_id)); 91 | Console.WriteLine(string.Format("product id: {0:X}", hdev.product_id)); 92 | Console.WriteLine(string.Format("usage page: {0:X}", hdev.usage_page)); 93 | Console.WriteLine(string.Format("usage: {0:X}", hdev.usage)); 94 | Console.WriteLine(""); 95 | 96 | PrintEnumeration(hdev.next); 97 | } 98 | } 99 | 100 | static string _getDevicePath(IntPtr phid_device_info, ushort usagePage, ushort usage) { 101 | if (!phid_device_info.Equals(IntPtr.Zero)) { 102 | hid_device_info hdev = (hid_device_info)Marshal.PtrToStructure(phid_device_info, typeof(hid_device_info)); 103 | if (usagePage == hdev.usage_page && usage == hdev.usage) 104 | return hdev.path; 105 | else 106 | return _getDevicePath(hdev.next, usagePage, usage); 107 | } 108 | return null; 109 | } 110 | 111 | public static string GetDevicePath(ushort vendorId, ushort productId, ushort usagePage, ushort usage) { 112 | return _getDevicePath(hid_enumerate(vendorId, productId), usagePage, usage); 113 | } 114 | } 115 | } -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/betterjoyforcemu_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/betterjoyforcemu_icon.ico -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/betterjoyfordolphin_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/betterjoyfordolphin_icon.ico -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/cross.png -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/jc_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/jc_left.png -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/jc_left_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/jc_left_s.png -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/jc_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/jc_right.png -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/jc_right_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/jc_right_s.png -------------------------------------------------------------------------------- /BetterJoyForDolphin/Icons/pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuk27/BetterJoyForDolphin/8b0125828de84d565ef969992fafedf9f7a12bb9/BetterJoyForDolphin/Icons/pro.png -------------------------------------------------------------------------------- /BetterJoyForDolphin/JoyUPDPack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Numerics; 6 | using System.Threading.Tasks; 7 | using System.Threading; 8 | using System.Net; 9 | using System.Net.NetworkInformation; 10 | using System.Net.Sockets; 11 | using System.Configuration; 12 | 13 | namespace BetterJoyForDolphin 14 | { 15 | public class JoyUPDPack 16 | { 17 | private String serverIP; 18 | private IPAddress ip; 19 | private int serverPort; 20 | private byte[] sendBuffer; 21 | private int[] invertArray; 22 | private bool active; 23 | private Socket udpSock; 24 | private IPEndPoint clientEP; 25 | private int sleepTime = 3; //3; 26 | private int force = 10; 27 | private Thread PollThreadObj; 28 | private Joycon parent; 29 | string csv_file; 30 | float[] manual_fit = new float[] {0,0,0}; 31 | 32 | 33 | public JoyUPDPack(Joycon parent, int port, String ip = "127.0.0.1", bool active = true, int force = 10, int[] invertArray = null) { 34 | 35 | this.parent = parent; 36 | if (SetPort(port)) { 37 | //SetActive(active); 38 | SetActive(true); 39 | SetIP(ip); 40 | sendBuffer = new byte[27]; 41 | StartSock(); 42 | 43 | this.force = force; 44 | 45 | if (invertArray == null) 46 | { 47 | this.invertArray = new int[] { 1, 1, 1 }; 48 | } 49 | else 50 | { 51 | this.invertArray = invertArray; 52 | } 53 | } 54 | } 55 | 56 | public void SetForce(int f) { 57 | force = f; 58 | Console.WriteLine("New force: " + f); 59 | } 60 | 61 | public int GetForce() 62 | { 63 | return force; 64 | } 65 | 66 | public void SetInverted(int x, int y, int z) { 67 | invertArray[0] = x; 68 | invertArray[1] = y; 69 | invertArray[2] = z; 70 | } 71 | 72 | public int[] GetInverted() { 73 | return invertArray; 74 | } 75 | 76 | public void CloseSock() { 77 | 78 | udpSock.Close(); 79 | udpSock = null; 80 | } 81 | 82 | public void SwitchPort(int np) { 83 | bool state = GetActive(); 84 | CloseSock(); 85 | SetPort(np); 86 | StartSock(); 87 | SetActive(state); 88 | } 89 | 90 | public void StartSock() { 91 | if (udpSock != null) 92 | { 93 | CloseSock(); 94 | } 95 | 96 | udpSock = new Socket(AddressFamily.InterNetwork, 97 | SocketType.Dgram, 98 | ProtocolType.Udp); 99 | 100 | ip = IPAddress.Parse(serverIP); 101 | try { 102 | Console.WriteLine("Started point: " + serverIP + ":" + serverPort); 103 | 104 | if (PollThreadObj == null) 105 | { 106 | PollThreadObj = new Thread(new ThreadStart(SendThreadPack)); 107 | PollThreadObj.IsBackground = true; 108 | PollThreadObj.Start(); 109 | } 110 | } 111 | 112 | catch (SocketException ex) 113 | { 114 | Console.WriteLine("Error making connection to socket"); 115 | CloseSock(); 116 | } 117 | 118 | } 119 | 120 | public void SendPack() { 121 | try 122 | { 123 | IPEndPoint clientEP = new IPEndPoint(ip, serverPort); 124 | udpSock.SendTo(sendBuffer, clientEP); 125 | //Console.WriteLine("Successfully send to: " + clientEP.ToString()); 126 | } 127 | catch (Exception e) 128 | { 129 | Console.WriteLine("My error:" + e.Message); 130 | } 131 | } 132 | 133 | 134 | public void SendThreadPack() 135 | { 136 | while (active) { 137 | GetPack(parent.GetAccel()); 138 | SendPack(); 139 | Thread.Sleep(sleepTime); 140 | } 141 | } 142 | 143 | public void SetActive(bool active) 144 | { 145 | this.active = active; 146 | } 147 | 148 | public bool GetActive() 149 | { 150 | return active; 151 | } 152 | 153 | public void SetIP(String ip) { 154 | serverIP = ip; 155 | } 156 | 157 | public String GetIP() 158 | { 159 | return serverIP; 160 | } 161 | 162 | public bool SetPort(int port) { 163 | 164 | bool success = false; 165 | 166 | if (port > -1) 167 | { 168 | serverPort = port; 169 | success = true; 170 | } 171 | 172 | return success; 173 | } 174 | 175 | public int GetPort() 176 | { 177 | return serverPort; 178 | } 179 | 180 | public void CleanBuffer() 181 | { 182 | Array.Clear(sendBuffer, 0, sendBuffer.Length); 183 | } 184 | 185 | public float[] VectorToFloat(Vector3 input, bool flipped = false) 186 | { 187 | 188 | float[] array = new float[3]; 189 | 190 | if (invertArray.Count() == 3) { 191 | 192 | int offset = 0; 193 | if (flipped) offset = 1; 194 | 195 | array[(0 + offset) % 2] = input.X * invertArray[0] + manual_fit[0] + (parent.isLeft ? 0 : manual_fit[0]); 196 | array[(1 + offset) % 2] = input.Y * invertArray[0] + manual_fit[1] + (parent.isLeft ? 0 : manual_fit[1]); //parent.isLeft ? input.Y : input.Y * -1; 197 | array[2] = input.Z * invertArray[2] + (parent.isLeft ? 0 : manual_fit[2]); 198 | 199 | } 200 | return array; 201 | } 202 | 203 | public byte[] GetPack(Vector3 rawAccel) 204 | { 205 | if (!active) { 206 | CleanBuffer(); 207 | return null; 208 | } 209 | 210 | //Console.WriteLine("The raw info is: " + rawAccel.ToString()); 211 | 212 | bool flip = parent.other == null ? true : false; 213 | float[] Accel = VectorToFloat(rawAccel, false); 214 | int offset = 3; 215 | 216 | sendBuffer[0] = (byte)0xde; // Pack initilization 217 | sendBuffer[2] = (byte)0x7; 218 | 219 | // For each axis 220 | for (int i = 0; i < 3; i++) 221 | { 222 | 223 | // Calculate the Acceleremoter axis value affected by gravity 224 | int b = (int)((Accel[i] / 9.80665f) * 1024.0f * 1024.0f) * force; 225 | 226 | sendBuffer[offset + 3] = (byte)(b & 0xff); 227 | sendBuffer[offset + 2] = (byte)((b >> 8) & 0xff); 228 | sendBuffer[offset + 1] = (byte)((b >> 16) & 0xff); 229 | sendBuffer[offset] = (byte)((b >> 24) & 0xff); 230 | 231 | offset += 4; 232 | } 233 | return sendBuffer; 234 | } 235 | 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /BetterJoyForDolphin/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace BetterJoyForDolphin { 2 | partial class MainForm { 3 | /// 4 | /// Required designer variable. 5 | /// 6 | private System.ComponentModel.IContainer components = null; 7 | 8 | /// 9 | /// Clean up any resources being used. 10 | /// 11 | /// true if managed resources should be disposed; otherwise, false. 12 | protected override void Dispose(bool disposing) { 13 | if (disposing && (components != null)) { 14 | components.Dispose(); 15 | } 16 | base.Dispose(disposing); 17 | } 18 | 19 | #region Windows Form Designer generated code 20 | 21 | /// 22 | /// Required method for Designer support - do not modify 23 | /// the contents of this method with the code editor. 24 | /// 25 | private void InitializeComponent() { 26 | this.components = new System.ComponentModel.Container(); 27 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 28 | this.console = new System.Windows.Forms.TextBox(); 29 | this.label1 = new System.Windows.Forms.Label(); 30 | this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); 31 | this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 32 | this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 33 | this.version_lbl = new System.Windows.Forms.Label(); 34 | this.passiveScanBox = new System.Windows.Forms.CheckBox(); 35 | this.linkLabel1 = new System.Windows.Forms.LinkLabel(); 36 | this.conCntrls = new System.Windows.Forms.GroupBox(); 37 | this.config4 = new System.Windows.Forms.Button(); 38 | this.config3 = new System.Windows.Forms.Button(); 39 | this.config2 = new System.Windows.Forms.Button(); 40 | this.config1 = new System.Windows.Forms.Button(); 41 | this.loc4 = new System.Windows.Forms.Button(); 42 | this.loc3 = new System.Windows.Forms.Button(); 43 | this.loc2 = new System.Windows.Forms.Button(); 44 | this.loc1 = new System.Windows.Forms.Button(); 45 | this.con4 = new System.Windows.Forms.Button(); 46 | this.con3 = new System.Windows.Forms.Button(); 47 | this.con2 = new System.Windows.Forms.Button(); 48 | this.con1 = new System.Windows.Forms.Button(); 49 | this.btnTip = new System.Windows.Forms.ToolTip(this.components); 50 | this.foldLbl = new System.Windows.Forms.Label(); 51 | this.startInTrayBox = new System.Windows.Forms.CheckBox(); 52 | this.btn_open3rdP = new System.Windows.Forms.Button(); 53 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 54 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 55 | this.rightPanel = new System.Windows.Forms.Panel(); 56 | this.button1 = new System.Windows.Forms.Button(); 57 | this.AutoCalibrate = new System.Windows.Forms.Button(); 58 | this.contextMenu.SuspendLayout(); 59 | this.conCntrls.SuspendLayout(); 60 | this.groupBox1.SuspendLayout(); 61 | this.rightPanel.SuspendLayout(); 62 | this.SuspendLayout(); 63 | // 64 | // console 65 | // 66 | this.console.Location = new System.Drawing.Point(12, 173); 67 | this.console.Multiline = true; 68 | this.console.Name = "console"; 69 | this.console.ReadOnly = true; 70 | this.console.Size = new System.Drawing.Size(262, 100); 71 | this.console.TabIndex = 2; 72 | // 73 | // label1 74 | // 75 | this.label1.AutoSize = true; 76 | this.label1.Location = new System.Drawing.Point(9, 157); 77 | this.label1.Name = "label1"; 78 | this.label1.Size = new System.Drawing.Size(80, 13); 79 | this.label1.TabIndex = 1; 80 | this.label1.Text = "Console Output"; 81 | this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter; 82 | // 83 | // notifyIcon 84 | // 85 | this.notifyIcon.BalloonTipText = "Double click the tray icon to maximise"; 86 | this.notifyIcon.BalloonTipTitle = "BetterJoyForDolphin"; 87 | this.notifyIcon.ContextMenuStrip = this.contextMenu; 88 | this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon"))); 89 | this.notifyIcon.Text = "BetterJoyForDolphin"; 90 | this.notifyIcon.Visible = true; 91 | this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick); 92 | // 93 | // contextMenu 94 | // 95 | this.contextMenu.ImageScalingSize = new System.Drawing.Size(24, 24); 96 | this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 97 | this.exitToolStripMenuItem}); 98 | this.contextMenu.Name = "contextMenu"; 99 | this.contextMenu.Size = new System.Drawing.Size(93, 26); 100 | // 101 | // exitToolStripMenuItem 102 | // 103 | this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; 104 | this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); 105 | this.exitToolStripMenuItem.Text = "Exit"; 106 | this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); 107 | // 108 | // version_lbl 109 | // 110 | this.version_lbl.AutoSize = true; 111 | this.version_lbl.Location = new System.Drawing.Point(246, 280); 112 | this.version_lbl.Name = "version_lbl"; 113 | this.version_lbl.Size = new System.Drawing.Size(28, 13); 114 | this.version_lbl.TabIndex = 2; 115 | this.version_lbl.Text = "v0.1"; 116 | // 117 | // passiveScanBox 118 | // 119 | this.passiveScanBox.AutoSize = true; 120 | this.passiveScanBox.Checked = true; 121 | this.passiveScanBox.CheckState = System.Windows.Forms.CheckState.Checked; 122 | this.passiveScanBox.Location = new System.Drawing.Point(12, 279); 123 | this.passiveScanBox.Name = "passiveScanBox"; 124 | this.passiveScanBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; 125 | this.passiveScanBox.Size = new System.Drawing.Size(91, 17); 126 | this.passiveScanBox.TabIndex = 4; 127 | this.passiveScanBox.Text = "Passive Scan"; 128 | this.passiveScanBox.UseVisualStyleBackColor = true; 129 | this.passiveScanBox.CheckedChanged += new System.EventHandler(this.passiveScanBox_CheckedChanged); 130 | // 131 | // linkLabel1 132 | // 133 | this.linkLabel1.AutoSize = true; 134 | this.linkLabel1.Location = new System.Drawing.Point(196, 280); 135 | this.linkLabel1.Name = "linkLabel1"; 136 | this.linkLabel1.Size = new System.Drawing.Size(42, 13); 137 | this.linkLabel1.TabIndex = 5; 138 | this.linkLabel1.TabStop = true; 139 | this.linkLabel1.Text = "Donate"; 140 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 141 | // 142 | // conCntrls 143 | // 144 | this.conCntrls.Controls.Add(this.config4); 145 | this.conCntrls.Controls.Add(this.config3); 146 | this.conCntrls.Controls.Add(this.config2); 147 | this.conCntrls.Controls.Add(this.config1); 148 | this.conCntrls.Controls.Add(this.loc4); 149 | this.conCntrls.Controls.Add(this.loc3); 150 | this.conCntrls.Controls.Add(this.loc2); 151 | this.conCntrls.Controls.Add(this.loc1); 152 | this.conCntrls.Controls.Add(this.con4); 153 | this.conCntrls.Controls.Add(this.con3); 154 | this.conCntrls.Controls.Add(this.con2); 155 | this.conCntrls.Controls.Add(this.con1); 156 | this.conCntrls.Location = new System.Drawing.Point(12, 12); 157 | this.conCntrls.Name = "conCntrls"; 158 | this.conCntrls.Size = new System.Drawing.Size(262, 142); 159 | this.conCntrls.TabIndex = 0; 160 | this.conCntrls.TabStop = false; 161 | this.conCntrls.Text = "Connected Controllers"; 162 | // 163 | // config4 164 | // 165 | this.config4.Location = new System.Drawing.Point(198, 83); 166 | this.config4.Name = "config4"; 167 | this.config4.Size = new System.Drawing.Size(58, 20); 168 | this.config4.TabIndex = 11; 169 | this.config4.Text = "Config"; 170 | this.config4.UseVisualStyleBackColor = true; 171 | // 172 | // config3 173 | // 174 | this.config3.Location = new System.Drawing.Point(134, 83); 175 | this.config3.Name = "config3"; 176 | this.config3.Size = new System.Drawing.Size(58, 20); 177 | this.config3.TabIndex = 10; 178 | this.config3.Text = "Config"; 179 | this.config3.UseVisualStyleBackColor = true; 180 | // 181 | // config2 182 | // 183 | this.config2.Location = new System.Drawing.Point(70, 83); 184 | this.config2.Name = "config2"; 185 | this.config2.Size = new System.Drawing.Size(58, 20); 186 | this.config2.TabIndex = 9; 187 | this.config2.Text = "Config"; 188 | this.config2.UseVisualStyleBackColor = true; 189 | // 190 | // config1 191 | // 192 | this.config1.Location = new System.Drawing.Point(6, 83); 193 | this.config1.Name = "config1"; 194 | this.config1.Size = new System.Drawing.Size(58, 20); 195 | this.config1.TabIndex = 8; 196 | this.config1.Text = "Config"; 197 | this.config1.UseVisualStyleBackColor = true; 198 | // 199 | // loc4 200 | // 201 | this.loc4.Location = new System.Drawing.Point(198, 109); 202 | this.loc4.Name = "loc4"; 203 | this.loc4.Size = new System.Drawing.Size(58, 20); 204 | this.loc4.TabIndex = 7; 205 | this.loc4.Text = "Locate"; 206 | this.loc4.UseVisualStyleBackColor = true; 207 | // 208 | // loc3 209 | // 210 | this.loc3.Location = new System.Drawing.Point(134, 109); 211 | this.loc3.Name = "loc3"; 212 | this.loc3.Size = new System.Drawing.Size(58, 20); 213 | this.loc3.TabIndex = 6; 214 | this.loc3.Text = "Locate"; 215 | this.loc3.UseVisualStyleBackColor = true; 216 | // 217 | // loc2 218 | // 219 | this.loc2.Location = new System.Drawing.Point(70, 109); 220 | this.loc2.Name = "loc2"; 221 | this.loc2.Size = new System.Drawing.Size(58, 20); 222 | this.loc2.TabIndex = 5; 223 | this.loc2.Text = "Locate"; 224 | this.loc2.UseVisualStyleBackColor = true; 225 | // 226 | // loc1 227 | // 228 | this.loc1.Location = new System.Drawing.Point(6, 109); 229 | this.loc1.Name = "loc1"; 230 | this.loc1.Size = new System.Drawing.Size(58, 20); 231 | this.loc1.TabIndex = 4; 232 | this.loc1.Text = "Locate"; 233 | this.loc1.UseVisualStyleBackColor = true; 234 | // 235 | // con4 236 | // 237 | this.con4.BackgroundImage = global::BetterJoyForDolphin.Properties.Resources.cross; 238 | this.con4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 239 | this.con4.Enabled = false; 240 | this.con4.Location = new System.Drawing.Point(198, 20); 241 | this.con4.Name = "con4"; 242 | this.con4.Size = new System.Drawing.Size(58, 59); 243 | this.con4.TabIndex = 3; 244 | this.con4.TabStop = false; 245 | this.con4.UseVisualStyleBackColor = true; 246 | // 247 | // con3 248 | // 249 | this.con3.BackgroundImage = global::BetterJoyForDolphin.Properties.Resources.cross; 250 | this.con3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 251 | this.con3.Enabled = false; 252 | this.con3.Location = new System.Drawing.Point(134, 20); 253 | this.con3.Name = "con3"; 254 | this.con3.Size = new System.Drawing.Size(58, 59); 255 | this.con3.TabIndex = 2; 256 | this.con3.TabStop = false; 257 | this.con3.UseVisualStyleBackColor = true; 258 | // 259 | // con2 260 | // 261 | this.con2.BackgroundImage = global::BetterJoyForDolphin.Properties.Resources.cross; 262 | this.con2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 263 | this.con2.Enabled = false; 264 | this.con2.Location = new System.Drawing.Point(70, 20); 265 | this.con2.Name = "con2"; 266 | this.con2.Size = new System.Drawing.Size(58, 59); 267 | this.con2.TabIndex = 1; 268 | this.con2.TabStop = false; 269 | this.con2.UseVisualStyleBackColor = true; 270 | // 271 | // con1 272 | // 273 | this.con1.BackgroundImage = global::BetterJoyForDolphin.Properties.Resources.cross; 274 | this.con1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; 275 | this.con1.Enabled = false; 276 | this.con1.Location = new System.Drawing.Point(6, 20); 277 | this.con1.Name = "con1"; 278 | this.con1.Size = new System.Drawing.Size(58, 59); 279 | this.con1.TabIndex = 0; 280 | this.con1.TabStop = false; 281 | this.btnTip.SetToolTip(this.con1, "Click on Joycons to join/split them"); 282 | this.con1.UseVisualStyleBackColor = true; 283 | // 284 | // foldLbl 285 | // 286 | this.foldLbl.Location = new System.Drawing.Point(274, 20); 287 | this.foldLbl.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); 288 | this.foldLbl.Name = "foldLbl"; 289 | this.foldLbl.Size = new System.Drawing.Size(13, 231); 290 | this.foldLbl.TabIndex = 12; 291 | this.foldLbl.Text = ">"; 292 | this.foldLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 293 | this.btnTip.SetToolTip(this.foldLbl, "Config"); 294 | this.foldLbl.Click += new System.EventHandler(this.label2_Click); 295 | // 296 | // startInTrayBox 297 | // 298 | this.startInTrayBox.AutoSize = true; 299 | this.startInTrayBox.Location = new System.Drawing.Point(107, 279); 300 | this.startInTrayBox.Name = "startInTrayBox"; 301 | this.startInTrayBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; 302 | this.startInTrayBox.Size = new System.Drawing.Size(83, 17); 303 | this.startInTrayBox.TabIndex = 6; 304 | this.startInTrayBox.Text = "Start in Tray"; 305 | this.startInTrayBox.UseVisualStyleBackColor = true; 306 | this.startInTrayBox.CheckedChanged += new System.EventHandler(this.startInTrayBox_CheckedChanged); 307 | // 308 | // btn_open3rdP 309 | // 310 | this.btn_open3rdP.Location = new System.Drawing.Point(188, 153); 311 | this.btn_open3rdP.Name = "btn_open3rdP"; 312 | this.btn_open3rdP.Size = new System.Drawing.Size(86, 20); 313 | this.btn_open3rdP.TabIndex = 7; 314 | this.btn_open3rdP.Text = "Add Controllers"; 315 | this.btn_open3rdP.UseVisualStyleBackColor = true; 316 | this.btn_open3rdP.Click += new System.EventHandler(this.btn_open3rdP_Click); 317 | // 318 | // groupBox1 319 | // 320 | this.groupBox1.Controls.Add(this.tableLayoutPanel1); 321 | this.groupBox1.Location = new System.Drawing.Point(3, 11); 322 | this.groupBox1.Margin = new System.Windows.Forms.Padding(2); 323 | this.groupBox1.Name = "groupBox1"; 324 | this.groupBox1.Padding = new System.Windows.Forms.Padding(2); 325 | this.groupBox1.Size = new System.Drawing.Size(227, 261); 326 | this.groupBox1.TabIndex = 9; 327 | this.groupBox1.TabStop = false; 328 | this.groupBox1.Text = "Config"; 329 | // 330 | // tableLayoutPanel1 331 | // 332 | this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 333 | | System.Windows.Forms.AnchorStyles.Right))); 334 | this.tableLayoutPanel1.AutoScroll = true; 335 | this.tableLayoutPanel1.ColumnCount = 2; 336 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 58.90411F)); 337 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 41.09589F)); 338 | this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 17); 339 | this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); 340 | this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 341 | this.tableLayoutPanel1.RowCount = 1; 342 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); 343 | this.tableLayoutPanel1.Size = new System.Drawing.Size(219, 240); 344 | this.tableLayoutPanel1.TabIndex = 1; 345 | // 346 | // rightPanel 347 | // 348 | this.rightPanel.Controls.Add(this.button1); 349 | this.rightPanel.Controls.Add(this.groupBox1); 350 | this.rightPanel.Location = new System.Drawing.Point(289, 1); 351 | this.rightPanel.Margin = new System.Windows.Forms.Padding(2, 2, 12, 2); 352 | this.rightPanel.Name = "rightPanel"; 353 | this.rightPanel.Size = new System.Drawing.Size(231, 295); 354 | this.rightPanel.TabIndex = 11; 355 | this.rightPanel.Visible = false; 356 | // 357 | // button1 358 | // 359 | this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 360 | this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 361 | this.button1.Location = new System.Drawing.Point(165, 274); 362 | this.button1.Margin = new System.Windows.Forms.Padding(2); 363 | this.button1.Name = "button1"; 364 | this.button1.Size = new System.Drawing.Size(61, 21); 365 | this.button1.TabIndex = 10; 366 | this.button1.Text = "Apply"; 367 | this.button1.UseVisualStyleBackColor = true; 368 | this.button1.Click += new System.EventHandler(this.button1_Click); 369 | // 370 | // AutoCalibrate 371 | // 372 | this.AutoCalibrate.Location = new System.Drawing.Point(111, 153); 373 | this.AutoCalibrate.Name = "AutoCalibrate"; 374 | this.AutoCalibrate.Size = new System.Drawing.Size(71, 20); 375 | this.AutoCalibrate.TabIndex = 8; 376 | this.AutoCalibrate.Text = "Calibrate"; 377 | this.AutoCalibrate.UseVisualStyleBackColor = true; 378 | this.AutoCalibrate.Click += new System.EventHandler(this.StartCalibrate); 379 | // 380 | // MainForm 381 | // 382 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 383 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 384 | this.AutoSize = true; 385 | this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 386 | this.ClientSize = new System.Drawing.Size(525, 299); 387 | this.Controls.Add(this.foldLbl); 388 | this.Controls.Add(this.rightPanel); 389 | this.Controls.Add(this.AutoCalibrate); 390 | this.Controls.Add(this.btn_open3rdP); 391 | this.Controls.Add(this.startInTrayBox); 392 | this.Controls.Add(this.conCntrls); 393 | this.Controls.Add(this.linkLabel1); 394 | this.Controls.Add(this.passiveScanBox); 395 | this.Controls.Add(this.version_lbl); 396 | this.Controls.Add(this.label1); 397 | this.Controls.Add(this.console); 398 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 399 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 400 | this.MaximizeBox = false; 401 | this.Name = "MainForm"; 402 | this.Text = "BetterJoyForDolphin"; 403 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); 404 | this.Load += new System.EventHandler(this.MainForm_Load); 405 | this.Resize += new System.EventHandler(this.MainForm_Resize); 406 | this.contextMenu.ResumeLayout(false); 407 | this.conCntrls.ResumeLayout(false); 408 | this.groupBox1.ResumeLayout(false); 409 | this.rightPanel.ResumeLayout(false); 410 | this.ResumeLayout(false); 411 | this.PerformLayout(); 412 | 413 | } 414 | 415 | #endregion 416 | 417 | public System.Windows.Forms.TextBox console; 418 | private System.Windows.Forms.Label label1; 419 | private System.Windows.Forms.NotifyIcon notifyIcon; 420 | private System.Windows.Forms.Label version_lbl; 421 | private System.Windows.Forms.ContextMenuStrip contextMenu; 422 | private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; 423 | private System.Windows.Forms.CheckBox passiveScanBox; 424 | private System.Windows.Forms.LinkLabel linkLabel1; 425 | private System.Windows.Forms.GroupBox conCntrls; 426 | private System.Windows.Forms.Button con1; 427 | private System.Windows.Forms.Button con4; 428 | private System.Windows.Forms.Button con3; 429 | private System.Windows.Forms.Button con2; 430 | private System.Windows.Forms.Button loc4; 431 | private System.Windows.Forms.Button loc3; 432 | private System.Windows.Forms.Button loc2; 433 | private System.Windows.Forms.Button loc1; 434 | private System.Windows.Forms.ToolTip btnTip; 435 | private System.Windows.Forms.CheckBox startInTrayBox; 436 | private System.Windows.Forms.Button btn_open3rdP; 437 | private System.Windows.Forms.GroupBox groupBox1; 438 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 439 | private System.Windows.Forms.Panel rightPanel; 440 | private System.Windows.Forms.Button button1; 441 | private System.Windows.Forms.Label foldLbl; 442 | private System.Windows.Forms.Button AutoCalibrate; 443 | private System.Windows.Forms.Button config4; 444 | private System.Windows.Forms.Button config3; 445 | private System.Windows.Forms.Button config2; 446 | private System.Windows.Forms.Button config1; 447 | } 448 | } -------------------------------------------------------------------------------- /BetterJoyForDolphin/MainForm.cs: -------------------------------------------------------------------------------- 1 | using Nefarius.ViGEm.Client.Targets; 2 | using Nefarius.ViGEm.Client.Targets.Xbox360; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Configuration; 7 | using System.Data; 8 | using System.Diagnostics; 9 | using System.Drawing; 10 | using System.Linq; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | using System.Windows.Forms; 14 | using System.Xml.Linq; 15 | 16 | namespace BetterJoyForDolphin { 17 | public partial class MainForm : Form { 18 | public bool nonOriginal = Boolean.Parse(ConfigurationManager.AppSettings["NonOriginalController"]); 19 | public List