Ally bindings

This commit is contained in:
Serge
2024-01-16 23:49:28 +01:00
parent 31e52dbf00
commit adcbe33fbb
2 changed files with 89 additions and 46 deletions

View File

@@ -40,8 +40,32 @@ namespace GHelper.Ally
static int fpsLimit = -1; static int fpsLimit = -1;
public const int CodeM1 = 0x028f; public const int MappingA = 0x0101;
public const int CodeM2 = 0x028e; public const int MappingB = 0x0102;
public const int MappingX = 0x0103;
public const int MappingY = 0x0104;
public const int MappingLB = 0x0105;
public const int MappingRB = 0x0106;
public const int MappingLS = 0x0107;
public const int MappingRS = 0x0108;
public const int MappingDU = 0x0109;
public const int MappingDD = 0x010A;
public const int MappingDL = 0x010B;
public const int MappingDR = 0x010C;
public const int MappingVB = 0x0111;
public const int MappingMB = 0x0112;
public const int MappingM1 = 0x028f;
public const int MappingM2 = 0x028e;
public const int MappingLT = 0x010d;
public const int MappingRT = 0x010e;
static byte[] MappingReady = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0a, 0x01 }; static byte[] MappingReady = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0a, 0x01 };
static byte[] MappingSave = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0f, 0x20 }; static byte[] MappingSave = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0f, 0x20 };
@@ -50,23 +74,33 @@ namespace GHelper.Ally
{ {
{ -1, "--------" }, { -1, "--------" },
{ 0x0000, "[ Disabled ]" }, { 0x0000, "[ Disabled ]" },
{ 0x028f, "M1" },
{ 0x028e, "M2" }, { MappingM1, "M1" },
{ 0x0101, "A" }, { MappingM2, "M2" },
{ 0x0102, "B" },
{ 0x0103, "X" }, { MappingA, "A" },
{ 0x0104, "Y" }, { MappingB, "B" },
{ 0x0105, "Left Bumper" },
{ 0x0106, "Right Bumper" }, { MappingX, "X" },
{ 0x0107, "Left Stick Click" }, { MappingY, "Y" },
{ 0x0108, "Right Stick Click" },
{ 0x0109, "DPad Up" }, { MappingLB, "Left Bumper" },
{ 0x010A, "DPad Down" }, { MappingRB, "Right Bumper" },
{ 0x010B, "DPad Left" },
{ 0x010C, "DPad Right" }, { MappingLS, "Left Stick Click" },
{ 0x0111, "View Button" }, { MappingRS, "Right Stick Click" },
{ 0x0112, "Menu Button" },
{ MappingDU, "DPad Up" },
{ MappingDD, "DPad Down" },
{ MappingDL, "DPad Left" },
{ MappingDR, "DPad Right" },
{ MappingVB, "View Button" },
{ MappingMB, "Menu Button" },
{ 0x0113, "XBox/Steam" }, { 0x0113, "XBox/Steam" },
{ 0x0276, "Esc" }, { 0x0276, "Esc" },
{ 0x0250, "F1" }, { 0x0250, "F1" },
{ 0x0260, "F2" }, { 0x0260, "F2" },
@@ -167,11 +201,13 @@ namespace GHelper.Ally
{ 0x0279, "NumPlus" }, { 0x0279, "NumPlus" },
{ 0x0281, "NumEnter" }, { 0x0281, "NumEnter" },
{ 0x0271, "NumPeriod" }, { 0x0271, "NumPeriod" },
{ 0x0301, "Mouse left click" }, { 0x0301, "Mouse left click" },
{ 0x0302, "Mouse right click" }, { 0x0302, "Mouse right click" },
{ 0x0303, "Mouse middle click" }, { 0x0303, "Mouse middle click" },
{ 0x0304, "Mouse scroll up" }, { 0x0304, "Mouse scroll up" },
{ 0x0305, "Mouse scroll down" }, { 0x0305, "Mouse scroll down" },
{ 0x0516, "Screenshot" }, { 0x0516, "Screenshot" },
{ 0x0519, "Show keyboard" }, { 0x0519, "Show keyboard" },
{ 0x051c, "Show desktop" }, { 0x051c, "Show desktop" },
@@ -295,40 +331,40 @@ namespace GHelper.Ally
switch (zone) switch (zone)
{ {
case BindingZone.DPadUpDown: case BindingZone.DPadUpDown:
Key1 = AppConfig.Get("bind_dpu"); Key1 = AppConfig.Get("bind_du", MappingDU);
Key2 = AppConfig.Get("bind_dpd"); Key2 = AppConfig.Get("bind_dd", MappingDD);
break; break;
case BindingZone.DPadLeftRight: case BindingZone.DPadLeftRight:
Key1 = AppConfig.Get("bind_dpl"); Key1 = AppConfig.Get("bind_dl", MappingDL);
Key2 = AppConfig.Get("bind_dpr"); Key2 = AppConfig.Get("bind_dr", MappingDR);
break; break;
case BindingZone.StickClick: case BindingZone.StickClick:
Key1 = AppConfig.Get("bind_stl"); Key1 = AppConfig.Get("bind_ls", MappingLS);
Key2 = AppConfig.Get("bind_str"); Key2 = AppConfig.Get("bind_rs", MappingRS);
break; break;
case BindingZone.Bumper: case BindingZone.Bumper:
Key1 = AppConfig.Get("bind_bul"); Key1 = AppConfig.Get("bind_lb", MappingLB);
Key2 = AppConfig.Get("bind_bur"); Key2 = AppConfig.Get("bind_rb", MappingRB);
break; break;
case BindingZone.AB: case BindingZone.AB:
Key1 = AppConfig.Get("bind_a"); Key1 = AppConfig.Get("bind_a", MappingA);
Key2 = AppConfig.Get("bind_b"); Key2 = AppConfig.Get("bind_b", MappingB);
break; break;
case BindingZone.XY: case BindingZone.XY:
Key1 = AppConfig.Get("bind_x"); Key1 = AppConfig.Get("bind_x", MappingX);
Key2 = AppConfig.Get("bind_y"); Key2 = AppConfig.Get("bind_y", MappingY);
break; break;
case BindingZone.ViewMenu: case BindingZone.ViewMenu:
Key1 = AppConfig.Get("bind_menu"); Key1 = AppConfig.Get("bind_vb", MappingVB);
Key2 = AppConfig.Get("bind_select"); Key2 = AppConfig.Get("bind_mv", MappingMB);
break; break;
case BindingZone.M1M2: case BindingZone.M1M2:
Key1 = AppConfig.Get("bind_m2"); Key1 = AppConfig.Get("bind_m2", MappingM2);
Key2 = AppConfig.Get("bind_m1"); Key2 = AppConfig.Get("bind_m1", MappingM1);
break; break;
default: default:
Key1 = AppConfig.Get("bind_trl"); Key1 = AppConfig.Get("bind_trl", MappingLT);
Key2 = AppConfig.Get("bind_trr"); Key2 = AppConfig.Get("bind_trr", MappingRT);
break; break;
} }

View File

@@ -41,18 +41,25 @@ namespace GHelper
trackVibra.ValueChanged += Controller_Complete; trackVibra.ValueChanged += Controller_Complete;
FillBinding("m1", "M1", AllyControl.CodeM1); FillBinding("m1", "M1", AllyControl.MappingM1);
FillBinding("m2", "M2", AllyControl.CodeM2); FillBinding("m2", "M2", AllyControl.MappingM2);
FillBinding("a", "A"); FillBinding("a", "A", AllyControl.MappingA);
FillBinding("b", "B"); FillBinding("b", "B", AllyControl.MappingB);
FillBinding("x", "X"); FillBinding("x", "X", AllyControl.MappingX);
FillBinding("y", "Y"); FillBinding("y", "Y", AllyControl.MappingY);
FillBinding("dpu", "DPad Up"); FillBinding("du", "DPad Up", AllyControl.MappingDU);
FillBinding("dpd", "DPad Down"); FillBinding("dd", "DPad Down", AllyControl.MappingDD);
FillBinding("dpl", "DPad Left");
FillBinding("dpr", "DPad Right"); FillBinding("dl", "DPad Left", AllyControl.MappingDL);
FillBinding("dr", "DPad Right", AllyControl.MappingDR);
FillBinding("rb", "Right Bumper", AllyControl.MappingRB);
FillBinding("lb", "Left Bumper", AllyControl.MappingLB);
FillBinding("rs", "Right Stick", AllyControl.MappingRS);
FillBinding("ll", "Left Stick", AllyControl.MappingLS);
} }