- 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
# All files
[*]
indent_style = tab
indent_size = 4
indent_style = space
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

@ -29,7 +29,7 @@ namespace BetterJoyForCemu {
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);
GetPrettyName(c);
@ -58,7 +58,7 @@ namespace BetterJoyForCemu {
curAssignment = c;
break;
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);
break;
case MouseButtons.Right:

File diff suppressed because it is too large Load diff