- changed tabs to spaces

- formatted all files in accordance to the new spec
This commit is contained in:
David Khachaturov 2020-05-21 15:27:28 +01:00
parent 5290a152da
commit d539425b7b
10 changed files with 2827 additions and 2827 deletions

View file

@ -5,7 +5,8 @@
root = true root = true
# All files # All files
[*] [*]
indent_style = tab indent_size = 4
indent_style = space
# Code files # Code files
[*.{cs,csx,vb,vbx}] [*.{cs,csx,vb,vbx}]
indent_size = 4 indent_size = 4

View file

@ -1,212 +1,212 @@
namespace BetterJoyForCemu { namespace BetterJoyForCemu {
partial class _3rdPartyControllers { partial class _3rdPartyControllers {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) { protected override void Dispose(bool disposing) {
if (disposing && (components != null)) { if (disposing && (components != null)) {
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(_3rdPartyControllers)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(_3rdPartyControllers));
this.list_allControllers = new System.Windows.Forms.ListBox(); this.list_allControllers = new System.Windows.Forms.ListBox();
this.list_customControllers = new System.Windows.Forms.ListBox(); this.list_customControllers = new System.Windows.Forms.ListBox();
this.btn_add = new System.Windows.Forms.Button(); this.btn_add = new System.Windows.Forms.Button();
this.btn_remove = new System.Windows.Forms.Button(); this.btn_remove = new System.Windows.Forms.Button();
this.group_props = new System.Windows.Forms.GroupBox(); this.group_props = new System.Windows.Forms.GroupBox();
this.chk_isLeft = new System.Windows.Forms.CheckBox(); this.chk_isLeft = new System.Windows.Forms.CheckBox();
this.chk_isPro = new System.Windows.Forms.CheckBox(); this.chk_isPro = new System.Windows.Forms.CheckBox();
this.btn_applyAndClose = new System.Windows.Forms.Button(); this.btn_applyAndClose = new System.Windows.Forms.Button();
this.btn_apply = new System.Windows.Forms.Button(); this.btn_apply = new System.Windows.Forms.Button();
this.lbl_all = new System.Windows.Forms.Label(); this.lbl_all = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.tip_device = new System.Windows.Forms.ToolTip(this.components); this.tip_device = new System.Windows.Forms.ToolTip(this.components);
this.btn_refresh = new System.Windows.Forms.Button(); this.btn_refresh = new System.Windows.Forms.Button();
this.group_props.SuspendLayout(); this.group_props.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// list_allControllers // list_allControllers
// //
this.list_allControllers.FormattingEnabled = true; this.list_allControllers.FormattingEnabled = true;
this.list_allControllers.Location = new System.Drawing.Point(12, 27); this.list_allControllers.Location = new System.Drawing.Point(12, 27);
this.list_allControllers.Name = "list_allControllers"; this.list_allControllers.Name = "list_allControllers";
this.list_allControllers.Size = new System.Drawing.Size(103, 225); this.list_allControllers.Size = new System.Drawing.Size(103, 225);
this.list_allControllers.TabIndex = 0; this.list_allControllers.TabIndex = 0;
this.list_allControllers.SelectedValueChanged += new System.EventHandler(this.list_allControllers_SelectedValueChanged); this.list_allControllers.SelectedValueChanged += new System.EventHandler(this.list_allControllers_SelectedValueChanged);
this.list_allControllers.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_allControllers_MouseDown); this.list_allControllers.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_allControllers_MouseDown);
// //
// list_customControllers // list_customControllers
// //
this.list_customControllers.FormattingEnabled = true; this.list_customControllers.FormattingEnabled = true;
this.list_customControllers.Location = new System.Drawing.Point(169, 27); this.list_customControllers.Location = new System.Drawing.Point(169, 27);
this.list_customControllers.Name = "list_customControllers"; this.list_customControllers.Name = "list_customControllers";
this.list_customControllers.Size = new System.Drawing.Size(103, 108); this.list_customControllers.Size = new System.Drawing.Size(103, 108);
this.list_customControllers.TabIndex = 1; this.list_customControllers.TabIndex = 1;
this.list_customControllers.SelectedValueChanged += new System.EventHandler(this.list_customControllers_SelectedValueChanged); this.list_customControllers.SelectedValueChanged += new System.EventHandler(this.list_customControllers_SelectedValueChanged);
this.list_customControllers.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_customControllers_MouseDown); this.list_customControllers.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_customControllers_MouseDown);
// //
// btn_add // btn_add
// //
this.btn_add.Location = new System.Drawing.Point(121, 27); this.btn_add.Location = new System.Drawing.Point(121, 27);
this.btn_add.Name = "btn_add"; this.btn_add.Name = "btn_add";
this.btn_add.Size = new System.Drawing.Size(42, 23); this.btn_add.Size = new System.Drawing.Size(42, 23);
this.btn_add.TabIndex = 2; this.btn_add.TabIndex = 2;
this.btn_add.Text = "->"; this.btn_add.Text = "->";
this.btn_add.UseVisualStyleBackColor = true; this.btn_add.UseVisualStyleBackColor = true;
this.btn_add.Click += new System.EventHandler(this.btn_add_Click); this.btn_add.Click += new System.EventHandler(this.btn_add_Click);
// //
// btn_remove // btn_remove
// //
this.btn_remove.Location = new System.Drawing.Point(121, 112); this.btn_remove.Location = new System.Drawing.Point(121, 112);
this.btn_remove.Name = "btn_remove"; this.btn_remove.Name = "btn_remove";
this.btn_remove.Size = new System.Drawing.Size(42, 23); this.btn_remove.Size = new System.Drawing.Size(42, 23);
this.btn_remove.TabIndex = 3; this.btn_remove.TabIndex = 3;
this.btn_remove.Text = "<-"; this.btn_remove.Text = "<-";
this.btn_remove.UseVisualStyleBackColor = true; this.btn_remove.UseVisualStyleBackColor = true;
this.btn_remove.Click += new System.EventHandler(this.btn_remove_Click); this.btn_remove.Click += new System.EventHandler(this.btn_remove_Click);
// //
// group_props // group_props
// //
this.group_props.Controls.Add(this.chk_isLeft); this.group_props.Controls.Add(this.chk_isLeft);
this.group_props.Controls.Add(this.chk_isPro); this.group_props.Controls.Add(this.chk_isPro);
this.group_props.Location = new System.Drawing.Point(122, 142); this.group_props.Location = new System.Drawing.Point(122, 142);
this.group_props.Name = "group_props"; this.group_props.Name = "group_props";
this.group_props.Size = new System.Drawing.Size(150, 81); this.group_props.Size = new System.Drawing.Size(150, 81);
this.group_props.TabIndex = 4; this.group_props.TabIndex = 4;
this.group_props.TabStop = false; this.group_props.TabStop = false;
this.group_props.Text = "Settings"; this.group_props.Text = "Settings";
// //
// chk_isLeft // chk_isLeft
// //
this.chk_isLeft.AutoSize = true; this.chk_isLeft.AutoSize = true;
this.chk_isLeft.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.chk_isLeft.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chk_isLeft.Location = new System.Drawing.Point(6, 42); this.chk_isLeft.Location = new System.Drawing.Point(6, 42);
this.chk_isLeft.Name = "chk_isLeft"; this.chk_isLeft.Name = "chk_isLeft";
this.chk_isLeft.Size = new System.Drawing.Size(96, 17); this.chk_isLeft.Size = new System.Drawing.Size(96, 17);
this.chk_isLeft.TabIndex = 1; this.chk_isLeft.TabIndex = 1;
this.chk_isLeft.Text = "Left Joycon? "; this.chk_isLeft.Text = "Left Joycon? ";
this.chk_isLeft.UseVisualStyleBackColor = true; this.chk_isLeft.UseVisualStyleBackColor = true;
this.chk_isLeft.CheckedChanged += new System.EventHandler(this.chk_isLeft_CheckedChanged); this.chk_isLeft.CheckedChanged += new System.EventHandler(this.chk_isLeft_CheckedChanged);
// //
// chk_isPro // chk_isPro
// //
this.chk_isPro.AutoSize = true; this.chk_isPro.AutoSize = true;
this.chk_isPro.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; this.chk_isPro.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chk_isPro.Location = new System.Drawing.Point(6, 19); this.chk_isPro.Location = new System.Drawing.Point(6, 19);
this.chk_isPro.Name = "chk_isPro"; this.chk_isPro.Name = "chk_isPro";
this.chk_isPro.Size = new System.Drawing.Size(95, 17); this.chk_isPro.Size = new System.Drawing.Size(95, 17);
this.chk_isPro.TabIndex = 0; this.chk_isPro.TabIndex = 0;
this.chk_isPro.Text = "Pro Controller?"; this.chk_isPro.Text = "Pro Controller?";
this.chk_isPro.UseVisualStyleBackColor = true; this.chk_isPro.UseVisualStyleBackColor = true;
this.chk_isPro.CheckedChanged += new System.EventHandler(this.chk_isPro_CheckedChanged); this.chk_isPro.CheckedChanged += new System.EventHandler(this.chk_isPro_CheckedChanged);
// //
// btn_applyAndClose // btn_applyAndClose
// //
this.btn_applyAndClose.Location = new System.Drawing.Point(203, 229); this.btn_applyAndClose.Location = new System.Drawing.Point(203, 229);
this.btn_applyAndClose.Name = "btn_applyAndClose"; this.btn_applyAndClose.Name = "btn_applyAndClose";
this.btn_applyAndClose.Size = new System.Drawing.Size(69, 23); this.btn_applyAndClose.Size = new System.Drawing.Size(69, 23);
this.btn_applyAndClose.TabIndex = 5; this.btn_applyAndClose.TabIndex = 5;
this.btn_applyAndClose.Text = "Close"; this.btn_applyAndClose.Text = "Close";
this.btn_applyAndClose.UseVisualStyleBackColor = true; this.btn_applyAndClose.UseVisualStyleBackColor = true;
this.btn_applyAndClose.Click += new System.EventHandler(this.btn_applyAndClose_Click); this.btn_applyAndClose.Click += new System.EventHandler(this.btn_applyAndClose_Click);
// //
// btn_apply // btn_apply
// //
this.btn_apply.Location = new System.Drawing.Point(121, 229); this.btn_apply.Location = new System.Drawing.Point(121, 229);
this.btn_apply.Name = "btn_apply"; this.btn_apply.Name = "btn_apply";
this.btn_apply.Size = new System.Drawing.Size(69, 23); this.btn_apply.Size = new System.Drawing.Size(69, 23);
this.btn_apply.TabIndex = 6; this.btn_apply.TabIndex = 6;
this.btn_apply.Text = "Apply"; this.btn_apply.Text = "Apply";
this.btn_apply.UseVisualStyleBackColor = true; this.btn_apply.UseVisualStyleBackColor = true;
this.btn_apply.Click += new System.EventHandler(this.btn_apply_Click); this.btn_apply.Click += new System.EventHandler(this.btn_apply_Click);
// //
// lbl_all // lbl_all
// //
this.lbl_all.AutoSize = true; this.lbl_all.AutoSize = true;
this.lbl_all.Location = new System.Drawing.Point(12, 11); this.lbl_all.Location = new System.Drawing.Point(12, 11);
this.lbl_all.Name = "lbl_all"; this.lbl_all.Name = "lbl_all";
this.lbl_all.Size = new System.Drawing.Size(60, 13); this.lbl_all.Size = new System.Drawing.Size(60, 13);
this.lbl_all.TabIndex = 7; this.lbl_all.TabIndex = 7;
this.lbl_all.Text = "All Devices"; this.lbl_all.Text = "All Devices";
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(166, 11); this.label1.Location = new System.Drawing.Point(166, 11);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(91, 13); this.label1.Size = new System.Drawing.Size(91, 13);
this.label1.TabIndex = 8; this.label1.TabIndex = 8;
this.label1.Text = "Switch Controllers"; this.label1.Text = "Switch Controllers";
// //
// btn_refresh // btn_refresh
// //
this.btn_refresh.Location = new System.Drawing.Point(121, 56); this.btn_refresh.Location = new System.Drawing.Point(121, 56);
this.btn_refresh.Name = "btn_refresh"; this.btn_refresh.Name = "btn_refresh";
this.btn_refresh.Size = new System.Drawing.Size(42, 50); this.btn_refresh.Size = new System.Drawing.Size(42, 50);
this.btn_refresh.TabIndex = 9; this.btn_refresh.TabIndex = 9;
this.btn_refresh.Text = "Re-\r\nfresh"; this.btn_refresh.Text = "Re-\r\nfresh";
this.btn_refresh.UseVisualStyleBackColor = true; this.btn_refresh.UseVisualStyleBackColor = true;
this.btn_refresh.Click += new System.EventHandler(this.btn_refresh_Click); this.btn_refresh.Click += new System.EventHandler(this.btn_refresh_Click);
// //
// _3rdPartyControllers // _3rdPartyControllers
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261); this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.btn_refresh); this.Controls.Add(this.btn_refresh);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.lbl_all); this.Controls.Add(this.lbl_all);
this.Controls.Add(this.btn_apply); this.Controls.Add(this.btn_apply);
this.Controls.Add(this.btn_applyAndClose); this.Controls.Add(this.btn_applyAndClose);
this.Controls.Add(this.group_props); this.Controls.Add(this.group_props);
this.Controls.Add(this.btn_remove); this.Controls.Add(this.btn_remove);
this.Controls.Add(this.btn_add); this.Controls.Add(this.btn_add);
this.Controls.Add(this.list_customControllers); this.Controls.Add(this.list_customControllers);
this.Controls.Add(this.list_allControllers); this.Controls.Add(this.list_allControllers);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "_3rdPartyControllers"; this.Name = "_3rdPartyControllers";
this.Text = "Add 3rd-Party Controllers"; this.Text = "Add 3rd-Party Controllers";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this._3rdPartyControllers_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this._3rdPartyControllers_FormClosing);
this.group_props.ResumeLayout(false); this.group_props.ResumeLayout(false);
this.group_props.PerformLayout(); this.group_props.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.ListBox list_allControllers; private System.Windows.Forms.ListBox list_allControllers;
private System.Windows.Forms.ListBox list_customControllers; private System.Windows.Forms.ListBox list_customControllers;
private System.Windows.Forms.Button btn_add; private System.Windows.Forms.Button btn_add;
private System.Windows.Forms.Button btn_remove; private System.Windows.Forms.Button btn_remove;
private System.Windows.Forms.GroupBox group_props; private System.Windows.Forms.GroupBox group_props;
private System.Windows.Forms.Button btn_applyAndClose; private System.Windows.Forms.Button btn_applyAndClose;
private System.Windows.Forms.Button btn_apply; private System.Windows.Forms.Button btn_apply;
private System.Windows.Forms.Label lbl_all; private System.Windows.Forms.Label lbl_all;
private System.Windows.Forms.CheckBox chk_isPro; private System.Windows.Forms.CheckBox chk_isPro;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox chk_isLeft; private System.Windows.Forms.CheckBox chk_isLeft;
private System.Windows.Forms.ToolTip tip_device; private System.Windows.Forms.ToolTip tip_device;
private System.Windows.Forms.Button btn_refresh; private System.Windows.Forms.Button btn_refresh;
} }
} }

View file

@ -12,111 +12,110 @@ using System.Windows.Forms;
using static BetterJoyForCemu.HIDapi; using static BetterJoyForCemu.HIDapi;
namespace BetterJoyForCemu { namespace BetterJoyForCemu {
public partial class _3rdPartyControllers : Form { public partial class _3rdPartyControllers : Form {
public _3rdPartyControllers() { public _3rdPartyControllers() {
InitializeComponent(); InitializeComponent();
list_allControllers.DisplayMember = "Text"; list_allControllers.DisplayMember = "Text";
list_allControllers.ValueMember = "Value"; list_allControllers.ValueMember = "Value";
list_customControllers.DisplayMember = "Text"; list_customControllers.DisplayMember = "Text";
list_customControllers.ValueMember = "Value"; list_customControllers.ValueMember = "Value";
RefreshControllerList(); RefreshControllerList();
group_props.Controls.Add(chk_isLeft); group_props.Controls.Add(chk_isLeft);
group_props.Controls.Add(chk_isPro); group_props.Controls.Add(chk_isPro);
group_props.Enabled = false; group_props.Enabled = false;
} }
private bool ContainsText(ListBox a, String manu) { private bool ContainsText(ListBox a, String manu) {
foreach (var v in a.Items) foreach (var v in a.Items) {
{ dynamic d = v as dynamic;
dynamic d = v as dynamic; if (d.Text == null)
if (d.Text == null) continue;
continue; if (d.Text.Equals(manu))
if (d.Text.Equals(manu)) return true;
return true; }
} return false;
return false; }
}
private void RefreshControllerList() { private void RefreshControllerList() {
list_allControllers.Items.Clear(); list_allControllers.Items.Clear();
IntPtr ptr = HIDapi.hid_enumerate(0x0, 0x0); IntPtr ptr = HIDapi.hid_enumerate(0x0, 0x0);
IntPtr top_ptr = ptr; IntPtr top_ptr = ptr;
hid_device_info enumerate; // Add device to list hid_device_info enumerate; // Add device to list
while (ptr != IntPtr.Zero) { while (ptr != IntPtr.Zero) {
enumerate = (hid_device_info)Marshal.PtrToStructure(ptr, typeof(hid_device_info)); enumerate = (hid_device_info)Marshal.PtrToStructure(ptr, typeof(hid_device_info));
if (!ContainsText(list_customControllers, enumerate.product_string) && !ContainsText(list_allControllers, enumerate.product_string)) if (!ContainsText(list_customControllers, enumerate.product_string) && !ContainsText(list_allControllers, enumerate.product_string))
list_allControllers.Items.Add(new { Text = enumerate.product_string, Value = enumerate }); list_allControllers.Items.Add(new { Text = enumerate.product_string, Value = enumerate });
ptr = enumerate.next; ptr = enumerate.next;
} }
} }
private void btn_add_Click(object sender, EventArgs e) { private void btn_add_Click(object sender, EventArgs e) {
if (list_allControllers.SelectedItem != null) { if (list_allControllers.SelectedItem != null) {
list_customControllers.Items.Add(list_allControllers.SelectedItem); list_customControllers.Items.Add(list_allControllers.SelectedItem);
list_allControllers.Items.Remove(list_allControllers.SelectedItem); list_allControllers.Items.Remove(list_allControllers.SelectedItem);
list_allControllers.ClearSelected(); list_allControllers.ClearSelected();
} }
} }
private void btn_remove_Click(object sender, EventArgs e) { private void btn_remove_Click(object sender, EventArgs e) {
if (list_customControllers.SelectedItem != null) { if (list_customControllers.SelectedItem != null) {
list_allControllers.Items.Add(list_customControllers.SelectedItem); list_allControllers.Items.Add(list_customControllers.SelectedItem);
list_customControllers.Items.Remove(list_customControllers.SelectedItem); list_customControllers.Items.Remove(list_customControllers.SelectedItem);
list_customControllers.ClearSelected(); list_customControllers.ClearSelected();
} }
} }
private void chk_isPro_CheckedChanged(object sender, EventArgs e) { private void chk_isPro_CheckedChanged(object sender, EventArgs e) {
} }
private void chk_isLeft_CheckedChanged(object sender, EventArgs e) { private void chk_isLeft_CheckedChanged(object sender, EventArgs e) {
} }
private void btn_apply_Click(object sender, EventArgs e) { private void btn_apply_Click(object sender, EventArgs e) {
} }
private void btn_applyAndClose_Click(object sender, EventArgs e) { private void btn_applyAndClose_Click(object sender, EventArgs e) {
btn_apply_Click(sender, e); btn_apply_Click(sender, e);
Close(); Close();
} }
private void _3rdPartyControllers_FormClosing(object sender, FormClosingEventArgs e) { private void _3rdPartyControllers_FormClosing(object sender, FormClosingEventArgs e) {
btn_apply_Click(sender, e); btn_apply_Click(sender, e);
} }
private void btn_refresh_Click(object sender, EventArgs e) { private void btn_refresh_Click(object sender, EventArgs e) {
RefreshControllerList(); RefreshControllerList();
} }
private void list_allControllers_SelectedValueChanged(object sender, EventArgs e) { private void list_allControllers_SelectedValueChanged(object sender, EventArgs e) {
if (list_allControllers.SelectedItem != null) if (list_allControllers.SelectedItem != null)
tip_device.Show((list_allControllers.SelectedItem as dynamic).Text, list_allControllers); tip_device.Show((list_allControllers.SelectedItem as dynamic).Text, list_allControllers);
} }
private void list_customControllers_SelectedValueChanged(object sender, EventArgs e) { private void list_customControllers_SelectedValueChanged(object sender, EventArgs e) {
if (list_customControllers.SelectedItem != null) { if (list_customControllers.SelectedItem != null) {
tip_device.Show((list_customControllers.SelectedItem as dynamic).Text, list_customControllers); tip_device.Show((list_customControllers.SelectedItem as dynamic).Text, list_customControllers);
group_props.Enabled = true; group_props.Enabled = true;
} else } else
group_props.Enabled = false; group_props.Enabled = false;
} }
private void list_customControllers_MouseDown(object sender, MouseEventArgs e) { private void list_customControllers_MouseDown(object sender, MouseEventArgs e) {
if (e.Y > list_customControllers.ItemHeight * list_customControllers.Items.Count) if (e.Y > list_customControllers.ItemHeight * list_customControllers.Items.Count)
list_customControllers.SelectedItems.Clear(); list_customControllers.SelectedItems.Clear();
} }
private void list_allControllers_MouseDown(object sender, MouseEventArgs e) { private void list_allControllers_MouseDown(object sender, MouseEventArgs e) {
if (e.Y > list_allControllers.ItemHeight * list_allControllers.Items.Count) if (e.Y > list_allControllers.ItemHeight * list_allControllers.Items.Count)
list_allControllers.SelectedItems.Clear(); list_allControllers.SelectedItems.Clear();
} }
} }
} }

View file

@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace BetterJoyForCemu { namespace BetterJoyForCemu {
public class HIDapi { public class HIDapi {
#if LINUX #if LINUX
const string dll = "libhidapi.so"; const string dll = "libhidapi.so";
#else #else
const string dll = "hidapi.dll"; const string dll = "hidapi.dll";
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -171,12 +171,12 @@ namespace BetterJoyForCemu {
v.other = jc; v.other = jc;
jc.other = v; jc.other = v;
//Set both Joycon LEDs to the one with the lowest ID //Set both Joycon LEDs to the one with the lowest ID
byte led = jc.LED <= v.LED ? jc.LED : v.LED; byte led = jc.LED <= v.LED ? jc.LED : v.LED;
jc.LED = led; jc.LED = led;
v.LED = led; v.LED = led;
jc.SetPlayerLED(led); jc.SetPlayerLED(led);
v.SetPlayerLED(led); v.SetPlayerLED(led);
if (v.out_xbox != null) { if (v.out_xbox != null) {
v.out_xbox.Disconnect(); v.out_xbox.Disconnect();

File diff suppressed because it is too large Load diff

View file

@ -9,135 +9,135 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace BetterJoyForCemu.Properties { namespace BetterJoyForCemu.Properties {
using System; using System;
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() { internal Resources() {
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// Returns the cached ResourceManager instance used by this class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BetterJoyForCemu.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BetterJoyForCemu.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
} }
} }
/// <summary> /// <summary>
/// Overrides the current thread's CurrentUICulture property for all /// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class. /// resource lookups using this strongly typed resource class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
get { get {
return resourceCulture; return resourceCulture;
} }
set { set {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary> /// </summary>
internal static System.Drawing.Icon betterjoyforcemu_icon { internal static System.Drawing.Icon betterjoyforcemu_icon {
get { get {
object obj = ResourceManager.GetObject("betterjoyforcemu_icon", resourceCulture); object obj = ResourceManager.GetObject("betterjoyforcemu_icon", resourceCulture);
return ((System.Drawing.Icon)(obj)); return ((System.Drawing.Icon)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap cross { internal static System.Drawing.Bitmap cross {
get { get {
object obj = ResourceManager.GetObject("cross", resourceCulture); object obj = ResourceManager.GetObject("cross", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap jc_left { internal static System.Drawing.Bitmap jc_left {
get { get {
object obj = ResourceManager.GetObject("jc_left", resourceCulture); object obj = ResourceManager.GetObject("jc_left", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap jc_left_s { internal static System.Drawing.Bitmap jc_left_s {
get { get {
object obj = ResourceManager.GetObject("jc_left_s", resourceCulture); object obj = ResourceManager.GetObject("jc_left_s", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap jc_right { internal static System.Drawing.Bitmap jc_right {
get { get {
object obj = ResourceManager.GetObject("jc_right", resourceCulture); object obj = ResourceManager.GetObject("jc_right", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap jc_right_s { internal static System.Drawing.Bitmap jc_right_s {
get { get {
object obj = ResourceManager.GetObject("jc_right_s", resourceCulture); object obj = ResourceManager.GetObject("jc_right_s", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap pro { internal static System.Drawing.Bitmap pro {
get { get {
object obj = ResourceManager.GetObject("pro", resourceCulture); object obj = ResourceManager.GetObject("pro", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap snes { internal static System.Drawing.Bitmap snes {
get { get {
object obj = ResourceManager.GetObject("snes", resourceCulture); object obj = ResourceManager.GetObject("snes", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
} }
} }

View file

@ -29,7 +29,7 @@ namespace BetterJoyForCemu {
menu_joy_buttons.ItemClicked += Menu_joy_buttons_ItemClicked; menu_joy_buttons.ItemClicked += Menu_joy_buttons_ItemClicked;
foreach (SplitButton c in new SplitButton[] { btn_capture, btn_home, btn_sl_l, btn_sl_r, btn_sr_l, btn_sr_r, btn_reset_mouse , btn_active_gyro}) { foreach (SplitButton c in new SplitButton[] { btn_capture, btn_home, btn_sl_l, btn_sl_r, btn_sr_l, btn_sr_r, btn_reset_mouse, btn_active_gyro }) {
c.Tag = c.Name.Substring(4); c.Tag = c.Name.Substring(4);
GetPrettyName(c); GetPrettyName(c);
@ -58,7 +58,7 @@ namespace BetterJoyForCemu {
curAssignment = c; curAssignment = c;
break; break;
case MouseButtons.Middle: case MouseButtons.Middle:
Config.SetValue((string) c.Tag, Config.GetDefaultValue((string) c.Tag)); Config.SetValue((string)c.Tag, Config.GetDefaultValue((string)c.Tag));
GetPrettyName(c); GetPrettyName(c);
break; break;
case MouseButtons.Right: case MouseButtons.Right:

File diff suppressed because it is too large Load diff