mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Ally M1/M2 bindings
This commit is contained in:
@@ -25,6 +25,143 @@ namespace GHelper.Ally
|
|||||||
|
|
||||||
static int fpsLimit = -1;
|
static int fpsLimit = -1;
|
||||||
|
|
||||||
|
const int CodeM1 = 0x028f;
|
||||||
|
const int CodeM2 = 0x028e;
|
||||||
|
|
||||||
|
public static Dictionary<int, string> BindingCodes = new Dictionary<int, string>
|
||||||
|
{
|
||||||
|
{ 0x028f, "M1" },
|
||||||
|
{ 0x028e, "M2" },
|
||||||
|
{ 0x0000, "-------" },
|
||||||
|
{ 0x0101, "A" },
|
||||||
|
{ 0x0102, "B" },
|
||||||
|
{ 0x0103, "X" },
|
||||||
|
{ 0x0104, "Y" },
|
||||||
|
{ 0x0105, "left bumper" },
|
||||||
|
{ 0x0106, "right bumper" },
|
||||||
|
{ 0x0107, "left stick click" },
|
||||||
|
{ 0x0108, "right stick click" },
|
||||||
|
{ 0x0109, "dpad up" },
|
||||||
|
{ 0x010A, "dpad down" },
|
||||||
|
{ 0x010B, "dpad left" },
|
||||||
|
{ 0x010C, "dpad right" },
|
||||||
|
{ 0x0111, "view button" },
|
||||||
|
{ 0x0112, "menu button" },
|
||||||
|
{ 0x0113, "XBox/Steam" },
|
||||||
|
{ 0x0276, "Esc" },
|
||||||
|
{ 0x0250, "F1" },
|
||||||
|
{ 0x0260, "F2" },
|
||||||
|
{ 0x0240, "F3" },
|
||||||
|
{ 0x020C, "F4" },
|
||||||
|
{ 0x0203, "F5" },
|
||||||
|
{ 0x020b, "F6" },
|
||||||
|
{ 0x0280, "F7" },
|
||||||
|
{ 0x020a, "F8" },
|
||||||
|
{ 0x0201, "F9" },
|
||||||
|
{ 0x0209, "F10" },
|
||||||
|
{ 0x0278, "F11" },
|
||||||
|
{ 0x0207, "F12" },
|
||||||
|
{ 0x020E, "`" },
|
||||||
|
{ 0x0216, "1" },
|
||||||
|
{ 0x021E, "2" },
|
||||||
|
{ 0x0226, "3" },
|
||||||
|
{ 0x0225, "4" },
|
||||||
|
{ 0x022E, "5" },
|
||||||
|
{ 0x0236, "6" },
|
||||||
|
{ 0x023D, "7" },
|
||||||
|
{ 0x023E, "8" },
|
||||||
|
{ 0x0246, "9" },
|
||||||
|
{ 0x0245, "0" },
|
||||||
|
{ 0x024E, "-" },
|
||||||
|
{ 0x0255, "=" },
|
||||||
|
{ 0x0266, "Backspace" },
|
||||||
|
{ 0x020D, "Tab" },
|
||||||
|
{ 0x0215, "Q" },
|
||||||
|
{ 0x021D, "W" },
|
||||||
|
{ 0x0224, "E" },
|
||||||
|
{ 0x022D, "R" },
|
||||||
|
{ 0x022C, "T" },
|
||||||
|
{ 0x0235, "Y" },
|
||||||
|
{ 0x023C, "U" },
|
||||||
|
{ 0x0244, "O" },
|
||||||
|
{ 0x024D, "P" },
|
||||||
|
{ 0x0254, "[" },
|
||||||
|
{ 0x025B, "]" },
|
||||||
|
{ 0x025D, "|" },
|
||||||
|
{ 0x0258, "Caps" },
|
||||||
|
{ 0x021C, "A" },
|
||||||
|
{ 0x021B, "S" },
|
||||||
|
{ 0x0223, "D" },
|
||||||
|
{ 0x022B, "F" },
|
||||||
|
{ 0x0234, "G" },
|
||||||
|
{ 0x0233, "H" },
|
||||||
|
{ 0x023B, "J" },
|
||||||
|
{ 0x0242, "k" },
|
||||||
|
{ 0x024b, "l" },
|
||||||
|
{ 0x024c, ";" },
|
||||||
|
{ 0x0252, "'" },
|
||||||
|
{ 0x025A, "Enter" },
|
||||||
|
{ 0x0288, "LShift" },
|
||||||
|
{ 0x0222, "X" },
|
||||||
|
{ 0x021A, "Z" },
|
||||||
|
{ 0x0221, "C" },
|
||||||
|
{ 0x022A, "V" },
|
||||||
|
{ 0x0232, "B" },
|
||||||
|
{ 0x0231, "N" },
|
||||||
|
{ 0x023A, "M" },
|
||||||
|
{ 0x0241, "," },
|
||||||
|
{ 0x0249, "." },
|
||||||
|
{ 0x0289, "RShift" },
|
||||||
|
{ 0x028C, "LCtl" },
|
||||||
|
{ 0x0282, "Meta" },
|
||||||
|
{ 0x028A, "LAlt" },
|
||||||
|
{ 0x0229, "Space" },
|
||||||
|
{ 0x028B, "RAlt" },
|
||||||
|
{ 0x0284, "App menu" },
|
||||||
|
{ 0x028D, "RCtl" },
|
||||||
|
{ 0x02C3, "PrntScn" },
|
||||||
|
{ 0x027E, "ScrLk" },
|
||||||
|
{ 0x02C2, "Insert" },
|
||||||
|
{ 0x0294, "Home" },
|
||||||
|
{ 0x0296, "PgUp" },
|
||||||
|
{ 0x02C0, "Delete" },
|
||||||
|
{ 0x0295, "End" },
|
||||||
|
{ 0x0297, "PgDwn" },
|
||||||
|
{ 0x0298, "UpArrow" },
|
||||||
|
{ 0x0299, "DownArrow" },
|
||||||
|
{ 0x0291, "LeftArrow" },
|
||||||
|
{ 0x029B, "RightArrow" },
|
||||||
|
{ 0x0277, "NumLock" },
|
||||||
|
{ 0x0290, "NumSlash" },
|
||||||
|
{ 0x027C, "NumStar" },
|
||||||
|
{ 0x027B, "NumHyphen" },
|
||||||
|
{ 0x0270, "Num0" },
|
||||||
|
{ 0x0269, "Num1" },
|
||||||
|
{ 0x0272, "Num2" },
|
||||||
|
{ 0x027A, "Num3" },
|
||||||
|
{ 0x026B, "Num4" },
|
||||||
|
{ 0x0273, "Num5" },
|
||||||
|
{ 0x0274, "Num6" },
|
||||||
|
{ 0x026C, "Num7" },
|
||||||
|
{ 0x0275, "Num8" },
|
||||||
|
{ 0x027D, "Num9" },
|
||||||
|
{ 0x0279, "NumPlus" },
|
||||||
|
{ 0x0281, "NumEnter" },
|
||||||
|
{ 0x0271, "NumPeriod" },
|
||||||
|
{ 0x0301, "Mouse left click" },
|
||||||
|
{ 0x0302, "Mouse right click" },
|
||||||
|
{ 0x0303, "Mouse middle click" },
|
||||||
|
{ 0x0304, "Mouse scroll up" },
|
||||||
|
{ 0x0305, "Mouse scroll down" },
|
||||||
|
{ 0x0516, "Screenshot" },
|
||||||
|
{ 0x0519, "Show keyboard" },
|
||||||
|
{ 0x051c, "Show desktop" },
|
||||||
|
{ 0x051e, "Begin recording" },
|
||||||
|
{ 0x0501, "Mic off" },
|
||||||
|
{ 0x0502, "Vol Down" },
|
||||||
|
{ 0x0503, "Vol Up" }
|
||||||
|
};
|
||||||
|
|
||||||
public AllyControl(SettingsForm settingsForm)
|
public AllyControl(SettingsForm settingsForm)
|
||||||
{
|
{
|
||||||
if (!AppConfig.IsAlly()) return;
|
if (!AppConfig.IsAlly()) return;
|
||||||
@@ -49,7 +186,7 @@ namespace GHelper.Ally
|
|||||||
{
|
{
|
||||||
_autoMode = _newMode;
|
_autoMode = _newMode;
|
||||||
_autoCount = 0;
|
_autoCount = 0;
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 1, 1, (byte)_autoMode }, "ControllerAuto " + _autoMode);
|
ApplyMode(_autoMode, "ControllerAuto");
|
||||||
Logger.WriteLine(fps.ToString());
|
Logger.WriteLine(fps.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,9 +197,9 @@ namespace GHelper.Ally
|
|||||||
if (AppConfig.IsAlly()) settings.VisualiseAlly(true);
|
if (AppConfig.IsAlly()) settings.VisualiseAlly(true);
|
||||||
else return;
|
else return;
|
||||||
|
|
||||||
Deadzones();
|
SetDeadzones();
|
||||||
SetMode((ControllerMode)AppConfig.Get("controller_mode", (int)ControllerMode.Auto));
|
SetMode((ControllerMode)AppConfig.Get("controller_mode", (int)ControllerMode.Auto));
|
||||||
|
|
||||||
settings.VisualiseBacklight(InputDispatcher.GetBacklight());
|
settings.VisualiseBacklight(InputDispatcher.GetBacklight());
|
||||||
|
|
||||||
fpsLimit = amdControl.GetFPSLimit();
|
fpsLimit = amdControl.GetFPSLimit();
|
||||||
@@ -103,29 +240,78 @@ namespace GHelper.Ally
|
|||||||
settings.VisualiseBacklight(InputDispatcher.GetBacklight());
|
settings.VisualiseBacklight(InputDispatcher.GetBacklight());
|
||||||
}
|
}
|
||||||
|
|
||||||
static public void Deadzones()
|
static private byte[] DecodeBinding(int binding)
|
||||||
{
|
{
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4,
|
byte command = (byte)(binding & 0xFF);
|
||||||
(byte)AppConfig.Get("ls_min", 0),
|
byte device = (byte)((binding >> 8) & 0xFF);
|
||||||
(byte)AppConfig.Get("ls_max", 100),
|
|
||||||
(byte)AppConfig.Get("rs_min", 0),
|
byte[] code = new byte[10];
|
||||||
(byte)AppConfig.Get("rs_max", 100) },
|
code[0] = device;
|
||||||
"StickDeadzone");
|
switch (device)
|
||||||
|
{
|
||||||
|
case 0x02:
|
||||||
|
code[2] = command;
|
||||||
|
break;
|
||||||
|
case 0x03:
|
||||||
|
code[4] = command;
|
||||||
|
break;
|
||||||
|
case 0x05:
|
||||||
|
code[3] = command;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
code[1] = command;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public void SetBindings()
|
||||||
|
{
|
||||||
|
int M1 = AppConfig.Get("bind_m1", CodeM1);
|
||||||
|
int M2 = AppConfig.Get("bind_m2", CodeM2);
|
||||||
|
|
||||||
|
byte[] bindings = new byte[50];
|
||||||
|
byte[] init = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x02, 0x08, 0x2c };
|
||||||
|
|
||||||
|
init.CopyTo(bindings, 0);
|
||||||
|
DecodeBinding(M2).CopyTo(bindings, 5);
|
||||||
|
if (M2 == CodeM2) DecodeBinding(M2).CopyTo(bindings, 16);
|
||||||
|
DecodeBinding(M1).CopyTo(bindings, 27);
|
||||||
|
if (M1 == CodeM1) DecodeBinding(M2).CopyTo(bindings, 16);
|
||||||
|
|
||||||
|
AsusHid.WriteInput(bindings, "Bind");
|
||||||
|
}
|
||||||
|
|
||||||
|
static public void SetDeadzones()
|
||||||
|
{
|
||||||
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4,
|
||||||
|
(byte)AppConfig.Get("ls_min", 0),
|
||||||
|
(byte)AppConfig.Get("ls_max", 100),
|
||||||
|
(byte)AppConfig.Get("rs_min", 0),
|
||||||
|
(byte)AppConfig.Get("rs_max", 100)
|
||||||
|
}, "StickDeadzone");
|
||||||
|
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 5, 4,
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 5, 4,
|
||||||
(byte)AppConfig.Get("lt_min", 0),
|
(byte)AppConfig.Get("lt_min", 0),
|
||||||
(byte)AppConfig.Get("lt_max", 100),
|
(byte)AppConfig.Get("lt_max", 100),
|
||||||
(byte)AppConfig.Get("rt_min", 0),
|
(byte)AppConfig.Get("rt_min", 0),
|
||||||
(byte)AppConfig.Get("rt_max", 100) },
|
(byte)AppConfig.Get("rt_max", 100)
|
||||||
"TriggerDeadzone");
|
}, "TriggerDeadzone");
|
||||||
|
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 6, 2,
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 6, 2,
|
||||||
(byte)AppConfig.Get("vibra", 100),
|
(byte)AppConfig.Get("vibra", 100),
|
||||||
(byte)AppConfig.Get("vibra", 100) },
|
(byte)AppConfig.Get("vibra", 100)
|
||||||
"Vibration");
|
}, "Vibration");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ApplyMode(ControllerMode applyMode, string log = "ControllerMode")
|
||||||
|
{
|
||||||
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 1, 1, (byte)applyMode }, log);
|
||||||
|
SetBindings();
|
||||||
|
}
|
||||||
|
|
||||||
private void SetMode(ControllerMode mode)
|
private void SetMode(ControllerMode mode)
|
||||||
{
|
{
|
||||||
if (mode == ControllerMode.Auto)
|
if (mode == ControllerMode.Auto)
|
||||||
@@ -138,8 +324,7 @@ namespace GHelper.Ally
|
|||||||
{
|
{
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
amdControl.StopFPS();
|
amdControl.StopFPS();
|
||||||
|
ApplyMode(mode);
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 1, 1, (byte)mode }, "ControllerMode");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppConfig.Set("controller_mode", (int)mode);
|
AppConfig.Set("controller_mode", (int)mode);
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ namespace Starlight.AnimeMatrix
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetBitmapDiagonal(bmp, (width - textWidth), height);
|
SetBitmapDiagonal(bmp, 5 , height);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
129
app/Handheld.Designer.cs
generated
129
app/Handheld.Designer.cs
generated
@@ -63,6 +63,14 @@
|
|||||||
panelSDeadzone = new Panel();
|
panelSDeadzone = new Panel();
|
||||||
pictureSDeadzone = new PictureBox();
|
pictureSDeadzone = new PictureBox();
|
||||||
labelSDeadzone = new Label();
|
labelSDeadzone = new Label();
|
||||||
|
panelBindings = new Panel();
|
||||||
|
labelM2 = new Label();
|
||||||
|
comboM2 = new UI.RComboBox();
|
||||||
|
labelM1 = new Label();
|
||||||
|
comboM1 = new UI.RComboBox();
|
||||||
|
panel1 = new Panel();
|
||||||
|
pictureBindings = new PictureBox();
|
||||||
|
labelBindings = new Label();
|
||||||
panelController.SuspendLayout();
|
panelController.SuspendLayout();
|
||||||
panelVibra.SuspendLayout();
|
panelVibra.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackVibra).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackVibra).BeginInit();
|
||||||
@@ -84,6 +92,9 @@
|
|||||||
((System.ComponentModel.ISupportInitialize)trackLSMin).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackLSMin).BeginInit();
|
||||||
panelSDeadzone.SuspendLayout();
|
panelSDeadzone.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureSDeadzone).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureSDeadzone).BeginInit();
|
||||||
|
panelBindings.SuspendLayout();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBindings).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// panelController
|
// panelController
|
||||||
@@ -104,7 +115,7 @@
|
|||||||
panelController.MinimumSize = new Size(560, 800);
|
panelController.MinimumSize = new Size(560, 800);
|
||||||
panelController.Name = "panelController";
|
panelController.Name = "panelController";
|
||||||
panelController.Padding = new Padding(0, 0, 0, 18);
|
panelController.Padding = new Padding(0, 0, 0, 18);
|
||||||
panelController.Size = new Size(560, 920);
|
panelController.Size = new Size(560, 912);
|
||||||
panelController.TabIndex = 45;
|
panelController.TabIndex = 45;
|
||||||
//
|
//
|
||||||
// buttonReset
|
// buttonReset
|
||||||
@@ -115,11 +126,11 @@
|
|||||||
buttonReset.BorderColor = Color.Transparent;
|
buttonReset.BorderColor = Color.Transparent;
|
||||||
buttonReset.BorderRadius = 2;
|
buttonReset.BorderRadius = 2;
|
||||||
buttonReset.FlatStyle = FlatStyle.Flat;
|
buttonReset.FlatStyle = FlatStyle.Flat;
|
||||||
buttonReset.Location = new Point(20, 850);
|
buttonReset.Location = new Point(20, 842);
|
||||||
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonReset.Name = "buttonReset";
|
buttonReset.Name = "buttonReset";
|
||||||
buttonReset.Secondary = true;
|
buttonReset.Secondary = true;
|
||||||
buttonReset.Size = new Size(224, 50);
|
buttonReset.Size = new Size(239, 50);
|
||||||
buttonReset.TabIndex = 54;
|
buttonReset.TabIndex = 54;
|
||||||
buttonReset.Text = "Reset";
|
buttonReset.Text = "Reset";
|
||||||
buttonReset.UseVisualStyleBackColor = false;
|
buttonReset.UseVisualStyleBackColor = false;
|
||||||
@@ -543,11 +554,108 @@
|
|||||||
labelSDeadzone.TabIndex = 40;
|
labelSDeadzone.TabIndex = 40;
|
||||||
labelSDeadzone.Text = "Stick Deadzones";
|
labelSDeadzone.Text = "Stick Deadzones";
|
||||||
//
|
//
|
||||||
|
// panelBindings
|
||||||
|
//
|
||||||
|
panelBindings.Controls.Add(labelM2);
|
||||||
|
panelBindings.Controls.Add(comboM2);
|
||||||
|
panelBindings.Controls.Add(labelM1);
|
||||||
|
panelBindings.Controls.Add(comboM1);
|
||||||
|
panelBindings.Controls.Add(panel1);
|
||||||
|
panelBindings.Dock = DockStyle.Left;
|
||||||
|
panelBindings.Location = new Point(570, 10);
|
||||||
|
panelBindings.MinimumSize = new Size(500, 0);
|
||||||
|
panelBindings.Name = "panelBindings";
|
||||||
|
panelBindings.Size = new Size(500, 912);
|
||||||
|
panelBindings.TabIndex = 46;
|
||||||
|
//
|
||||||
|
// labelM2
|
||||||
|
//
|
||||||
|
labelM2.AutoSize = true;
|
||||||
|
labelM2.Location = new Point(19, 146);
|
||||||
|
labelM2.Margin = new Padding(4, 0, 4, 0);
|
||||||
|
labelM2.Name = "labelM2";
|
||||||
|
labelM2.Size = new Size(49, 32);
|
||||||
|
labelM2.TabIndex = 48;
|
||||||
|
labelM2.Text = "M2";
|
||||||
|
//
|
||||||
|
// comboM2
|
||||||
|
//
|
||||||
|
comboM2.BorderColor = Color.White;
|
||||||
|
comboM2.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
|
comboM2.FormattingEnabled = true;
|
||||||
|
comboM2.Items.AddRange(new object[] { Properties.Strings.Default, Properties.Strings.VolumeMute, Properties.Strings.PlayPause, Properties.Strings.PrintScreen, Properties.Strings.ToggleAura, Properties.Strings.Custom });
|
||||||
|
comboM2.Location = new Point(82, 144);
|
||||||
|
comboM2.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
comboM2.Name = "comboM2";
|
||||||
|
comboM2.Size = new Size(374, 40);
|
||||||
|
comboM2.TabIndex = 47;
|
||||||
|
//
|
||||||
|
// labelM1
|
||||||
|
//
|
||||||
|
labelM1.AutoSize = true;
|
||||||
|
labelM1.Location = new Point(19, 87);
|
||||||
|
labelM1.Margin = new Padding(4, 0, 4, 0);
|
||||||
|
labelM1.Name = "labelM1";
|
||||||
|
labelM1.Size = new Size(49, 32);
|
||||||
|
labelM1.TabIndex = 46;
|
||||||
|
labelM1.Text = "M1";
|
||||||
|
//
|
||||||
|
// comboM1
|
||||||
|
//
|
||||||
|
comboM1.BorderColor = Color.White;
|
||||||
|
comboM1.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
|
comboM1.FormattingEnabled = true;
|
||||||
|
comboM1.Items.AddRange(new object[] { Properties.Strings.Default, Properties.Strings.VolumeMute, Properties.Strings.PlayPause, Properties.Strings.PrintScreen, Properties.Strings.ToggleAura, Properties.Strings.Custom });
|
||||||
|
comboM1.Location = new Point(82, 85);
|
||||||
|
comboM1.Margin = new Padding(4, 3, 4, 3);
|
||||||
|
comboM1.Name = "comboM1";
|
||||||
|
comboM1.Size = new Size(374, 40);
|
||||||
|
comboM1.TabIndex = 45;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.AutoSize = true;
|
||||||
|
panel1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
|
panel1.Controls.Add(pictureBindings);
|
||||||
|
panel1.Controls.Add(labelBindings);
|
||||||
|
panel1.Dock = DockStyle.Top;
|
||||||
|
panel1.Location = new Point(0, 0);
|
||||||
|
panel1.Margin = new Padding(4);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(500, 60);
|
||||||
|
panel1.TabIndex = 44;
|
||||||
|
//
|
||||||
|
// pictureBindings
|
||||||
|
//
|
||||||
|
pictureBindings.BackgroundImage = Properties.Resources.icons8_next_32;
|
||||||
|
pictureBindings.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
pictureBindings.ErrorImage = null;
|
||||||
|
pictureBindings.InitialImage = null;
|
||||||
|
pictureBindings.Location = new Point(10, 18);
|
||||||
|
pictureBindings.Margin = new Padding(4, 2, 4, 10);
|
||||||
|
pictureBindings.Name = "pictureBindings";
|
||||||
|
pictureBindings.Size = new Size(32, 32);
|
||||||
|
pictureBindings.TabIndex = 41;
|
||||||
|
pictureBindings.TabStop = false;
|
||||||
|
//
|
||||||
|
// labelBindings
|
||||||
|
//
|
||||||
|
labelBindings.AutoSize = true;
|
||||||
|
labelBindings.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
|
labelBindings.Location = new Point(45, 17);
|
||||||
|
labelBindings.Margin = new Padding(4, 0, 4, 0);
|
||||||
|
labelBindings.Name = "labelBindings";
|
||||||
|
labelBindings.Size = new Size(114, 32);
|
||||||
|
labelBindings.TabIndex = 40;
|
||||||
|
labelBindings.Text = "Bindings";
|
||||||
|
//
|
||||||
// Handheld
|
// Handheld
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(13F, 32F);
|
AutoScaleDimensions = new SizeF(13F, 32F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(1293, 940);
|
AutoSize = true;
|
||||||
|
ClientSize = new Size(1082, 932);
|
||||||
|
Controls.Add(panelBindings);
|
||||||
Controls.Add(panelController);
|
Controls.Add(panelController);
|
||||||
MaximizeBox = false;
|
MaximizeBox = false;
|
||||||
MinimizeBox = false;
|
MinimizeBox = false;
|
||||||
@@ -586,6 +694,11 @@
|
|||||||
panelSDeadzone.ResumeLayout(false);
|
panelSDeadzone.ResumeLayout(false);
|
||||||
panelSDeadzone.PerformLayout();
|
panelSDeadzone.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureSDeadzone).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureSDeadzone).EndInit();
|
||||||
|
panelBindings.ResumeLayout(false);
|
||||||
|
panelBindings.PerformLayout();
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
panel1.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBindings).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@@ -627,5 +740,13 @@
|
|||||||
private PictureBox pictureVibration;
|
private PictureBox pictureVibration;
|
||||||
private Label labelVibraHeader;
|
private Label labelVibraHeader;
|
||||||
private UI.RButton buttonReset;
|
private UI.RButton buttonReset;
|
||||||
|
private Panel panelBindings;
|
||||||
|
private Panel panel1;
|
||||||
|
private PictureBox pictureBindings;
|
||||||
|
private Label labelBindings;
|
||||||
|
private Label labelM2;
|
||||||
|
private UI.RComboBox comboM2;
|
||||||
|
private Label labelM1;
|
||||||
|
private UI.RComboBox comboM1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,12 @@ using GHelper.Ally;
|
|||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
public partial class Handheld : RForm
|
public partial class Handheld : Form
|
||||||
{
|
{
|
||||||
public Handheld()
|
public Handheld()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
InitTheme(true);
|
//InitTheme(true);
|
||||||
|
|
||||||
Shown += Handheld_Shown;
|
Shown += Handheld_Shown;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ namespace GHelper
|
|||||||
|
|
||||||
buttonReset.Click += ButtonReset_Click;
|
buttonReset.Click += ButtonReset_Click;
|
||||||
|
|
||||||
trackLSMin.ValueChanged += Controller_Complete; ;
|
trackLSMin.ValueChanged += Controller_Complete;
|
||||||
trackLSMax.ValueChanged += Controller_Complete;
|
trackLSMax.ValueChanged += Controller_Complete;
|
||||||
trackRSMin.ValueChanged += Controller_Complete;
|
trackRSMin.ValueChanged += Controller_Complete;
|
||||||
trackRSMax.ValueChanged += Controller_Complete;
|
trackRSMax.ValueChanged += Controller_Complete;
|
||||||
@@ -40,11 +40,34 @@ namespace GHelper
|
|||||||
|
|
||||||
trackVibra.ValueChanged += Controller_Complete;
|
trackVibra.ValueChanged += Controller_Complete;
|
||||||
|
|
||||||
|
comboM1.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboM1.DataSource = new BindingSource(AllyControl.BindingCodes, null);
|
||||||
|
comboM1.DisplayMember = "Value";
|
||||||
|
comboM1.ValueMember = "Key";
|
||||||
|
|
||||||
|
comboM2.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboM2.DataSource = new BindingSource(AllyControl.BindingCodes, null);
|
||||||
|
comboM2.DisplayMember = "Value";
|
||||||
|
comboM2.ValueMember = "Key";
|
||||||
|
|
||||||
|
comboM1.SelectedValue = AppConfig.Get("bind_m1", 0x028f);
|
||||||
|
comboM2.SelectedValue = AppConfig.Get("bind_m2", 0x028e);
|
||||||
|
|
||||||
|
comboM1.SelectedValueChanged += Binding_SelectedValueChanged;
|
||||||
|
comboM2.SelectedValueChanged += Binding_SelectedValueChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Binding_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.Set("bind_m1", (int)comboM1.SelectedValue);
|
||||||
|
AppConfig.Set("bind_m2", (int)comboM2.SelectedValue);
|
||||||
|
AllyControl.SetBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Controller_Complete(object? sender, EventArgs e)
|
private void Controller_Complete(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AllyControl.Deadzones();
|
AllyControl.SetDeadzones();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonReset_Click(object? sender, EventArgs e)
|
private void ButtonReset_Click(object? sender, EventArgs e)
|
||||||
|
|||||||
10
app/Properties/Resources.Designer.cs
generated
10
app/Properties/Resources.Designer.cs
generated
@@ -440,6 +440,16 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap icons8_next_32 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("icons8-next-32", resourceCulture);
|
||||||
|
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>
|
||||||
|
|||||||
@@ -118,9 +118,6 @@
|
|||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="icons8_charging_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -154,8 +151,8 @@
|
|||||||
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-controller-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="dot_standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-controller-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-charging-battery-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-charging-battery-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-charging-battery-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-charging-battery-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
@@ -175,6 +172,9 @@
|
|||||||
<data name="icons8-help-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-help-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-help-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-help-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="icons8-settings-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-settings-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
<data name="icons8-software-32-white" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-software-32-white" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-software-32-white.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-software-32-white.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -208,8 +208,8 @@
|
|||||||
<data name="icons8_batterie_voll_geladen_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8_batterie_voll_geladen_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-batterie-voll-geladen-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-batterie-voll-geladen-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="dot_standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8_charging_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
@@ -241,8 +241,8 @@
|
|||||||
<data name="icons8-log-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-log-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-log-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-log-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8_function" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-controller-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-controller-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-keyboard-32 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-keyboard-32 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-keyboard-32 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-keyboard-32 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
@@ -274,6 +274,9 @@
|
|||||||
<data name="icons8-gauge-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-gauge-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-gauge-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-gauge-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="icons8-soonvibes-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\icons8-soonvibes-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
<data name="icons8-leaf-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-leaf-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -286,8 +289,8 @@
|
|||||||
<data name="backlight" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="backlight" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\backlight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\backlight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-settings-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8_function" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-settings-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="dot_eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="dot_eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\dot-eco.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\dot-eco.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
@@ -304,7 +307,7 @@
|
|||||||
<data name="icons8_rocket_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8_rocket_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-rocket-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-rocket-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="icons8-soonvibes-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="icons8-next-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\icons8-soonvibes-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\icons8-next-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
BIN
app/Resources/icons8-next-32.png
Normal file
BIN
app/Resources/icons8-next-32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 248 B |
@@ -68,7 +68,7 @@ public static class AsusHid
|
|||||||
var payload = new byte[device.GetMaxFeatureReportLength()];
|
var payload = new byte[device.GetMaxFeatureReportLength()];
|
||||||
Array.Copy(data, payload, data.Length);
|
Array.Copy(data, payload, data.Length);
|
||||||
stream.SetFeature(payload);
|
stream.SetFeature(payload);
|
||||||
Logger.WriteLine($"{log} Feature {device.ProductID.ToString("X")}|{device.GetMaxFeatureReportLength()}: {BitConverter.ToString(data)}");
|
Logger.WriteLine($"{log} {device.ProductID.ToString("X")}|{device.GetMaxFeatureReportLength()}: {BitConverter.ToString(data)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user