mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Version Bump
This commit is contained in:
@@ -39,64 +39,64 @@ namespace GHelper.Ally
|
|||||||
|
|
||||||
static int fpsLimit = -1;
|
static int fpsLimit = -1;
|
||||||
|
|
||||||
public const int MappingA = 0x0101;
|
public const int BindA = 0x0101;
|
||||||
public const int MappingB = 0x0102;
|
public const int BindB = 0x0102;
|
||||||
|
|
||||||
public const int MappingX = 0x0103;
|
public const int BindX = 0x0103;
|
||||||
public const int MappingY = 0x0104;
|
public const int BindY = 0x0104;
|
||||||
|
|
||||||
public const int MappingLB = 0x0105;
|
public const int BindLB = 0x0105;
|
||||||
public const int MappingRB = 0x0106;
|
public const int BindRB = 0x0106;
|
||||||
|
|
||||||
public const int MappingLS = 0x0107;
|
public const int BindLS = 0x0107;
|
||||||
public const int MappingRS = 0x0108;
|
public const int BindRS = 0x0108;
|
||||||
|
|
||||||
public const int MappingDU = 0x0109;
|
public const int BindDU = 0x0109;
|
||||||
public const int MappingDD = 0x010A;
|
public const int BindDD = 0x010A;
|
||||||
|
|
||||||
public const int MappingDL = 0x010B;
|
public const int BindDL = 0x010B;
|
||||||
public const int MappingDR = 0x010C;
|
public const int BindDR = 0x010C;
|
||||||
|
|
||||||
public const int MappingVB = 0x0111;
|
public const int BindVB = 0x0111;
|
||||||
public const int MappingMB = 0x0112;
|
public const int BindMB = 0x0112;
|
||||||
|
|
||||||
public const int MappingM1 = 0x028f;
|
public const int BindM1 = 0x028f;
|
||||||
public const int MappingM2 = 0x028e;
|
public const int BindM2 = 0x028e;
|
||||||
|
|
||||||
public const int MappingLT = 0x010d;
|
public const int BindLT = 0x010d;
|
||||||
public const int MappingRT = 0x010e;
|
public const int BindRT = 0x010e;
|
||||||
|
|
||||||
static byte[] MappingReady = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0a, 0x01 };
|
static byte[] CommandReady = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0a, 0x01 };
|
||||||
static byte[] MappingSave = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0f, 0x20 };
|
static byte[] CommandSave = new byte[] { AsusHid.INPUT_ID, 0xd1, 0x0f, 0x20 };
|
||||||
|
|
||||||
public static Dictionary<int, string> BindingCodes = new Dictionary<int, string>
|
public static Dictionary<int, string> BindCodes = new Dictionary<int, string>
|
||||||
{
|
{
|
||||||
{ -1, "--------" },
|
{ -1, "--------" },
|
||||||
{ 0x0000, "[ Disabled ]" },
|
{ 0x0000, "[ Disabled ]" },
|
||||||
|
|
||||||
{ MappingM1, "M1" },
|
{ BindM1, "M1" },
|
||||||
{ MappingM2, "M2" },
|
{ BindM2, "M2" },
|
||||||
|
|
||||||
{ MappingA, "A" },
|
{ BindA, "A" },
|
||||||
{ MappingB, "B" },
|
{ BindB, "B" },
|
||||||
|
|
||||||
{ MappingX, "X" },
|
{ BindX, "X" },
|
||||||
{ MappingY, "Y" },
|
{ BindY, "Y" },
|
||||||
|
|
||||||
{ MappingLB, "Left Bumper" },
|
{ BindLB, "Left Bumper" },
|
||||||
{ MappingRB, "Right Bumper" },
|
{ BindRB, "Right Bumper" },
|
||||||
|
|
||||||
{ MappingLS, "Left Stick Click" },
|
{ BindLS, "Left Stick Click" },
|
||||||
{ MappingRS, "Right Stick Click" },
|
{ BindRS, "Right Stick Click" },
|
||||||
|
|
||||||
{ MappingDU, "DPad Up" },
|
{ BindDU, "DPad Up" },
|
||||||
{ MappingDD, "DPad Down" },
|
{ BindDD, "DPad Down" },
|
||||||
|
|
||||||
{ MappingDL, "DPad Left" },
|
{ BindDL, "DPad Left" },
|
||||||
{ MappingDR, "DPad Right" },
|
{ BindDR, "DPad Right" },
|
||||||
|
|
||||||
{ MappingVB, "View Button" },
|
{ BindVB, "View Button" },
|
||||||
{ MappingMB, "Menu Button" },
|
{ BindMB, "Menu Button" },
|
||||||
|
|
||||||
{ 0x0113, "XBox/Steam" },
|
{ 0x0113, "XBox/Steam" },
|
||||||
|
|
||||||
@@ -325,8 +325,7 @@ namespace GHelper.Ally
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static private void BindZone(BindingZone zone)
|
||||||
static private void MappingZone(BindingZone zone)
|
|
||||||
{
|
{
|
||||||
int KeyL1, KeyR1;
|
int KeyL1, KeyR1;
|
||||||
int KeyL2, KeyR2;
|
int KeyL2, KeyR2;
|
||||||
@@ -334,56 +333,56 @@ namespace GHelper.Ally
|
|||||||
switch (zone)
|
switch (zone)
|
||||||
{
|
{
|
||||||
case BindingZone.DPadUpDown:
|
case BindingZone.DPadUpDown:
|
||||||
KeyL1 = AppConfig.Get("bind_du", MappingDU);
|
KeyL1 = AppConfig.Get("bind_du", BindDU);
|
||||||
KeyR1 = AppConfig.Get("bind_dd", MappingDD);
|
KeyR1 = AppConfig.Get("bind_dd", BindDD);
|
||||||
KeyL2 = AppConfig.Get("bind2_du");
|
KeyL2 = AppConfig.Get("bind2_du");
|
||||||
KeyR2 = AppConfig.Get("bind2_dd");
|
KeyR2 = AppConfig.Get("bind2_dd");
|
||||||
break;
|
break;
|
||||||
case BindingZone.DPadLeftRight:
|
case BindingZone.DPadLeftRight:
|
||||||
KeyL1 = AppConfig.Get("bind_dl", MappingDL);
|
KeyL1 = AppConfig.Get("bind_dl", BindDL);
|
||||||
KeyR1 = AppConfig.Get("bind_dr", MappingDR);
|
KeyR1 = AppConfig.Get("bind_dr", BindDR);
|
||||||
KeyL2 = AppConfig.Get("bind2_dl");
|
KeyL2 = AppConfig.Get("bind2_dl");
|
||||||
KeyR2 = AppConfig.Get("bind2_dr");
|
KeyR2 = AppConfig.Get("bind2_dr");
|
||||||
break;
|
break;
|
||||||
case BindingZone.StickClick:
|
case BindingZone.StickClick:
|
||||||
KeyL1 = AppConfig.Get("bind_ls", MappingLS);
|
KeyL1 = AppConfig.Get("bind_ls", BindLS);
|
||||||
KeyR1 = AppConfig.Get("bind_rs", MappingRS);
|
KeyR1 = AppConfig.Get("bind_rs", BindRS);
|
||||||
KeyL2 = AppConfig.Get("bind2_ls");
|
KeyL2 = AppConfig.Get("bind2_ls");
|
||||||
KeyR2 = AppConfig.Get("bind2_rs");
|
KeyR2 = AppConfig.Get("bind2_rs");
|
||||||
break;
|
break;
|
||||||
case BindingZone.Bumper:
|
case BindingZone.Bumper:
|
||||||
KeyL1 = AppConfig.Get("bind_lb", MappingLB);
|
KeyL1 = AppConfig.Get("bind_lb", BindLB);
|
||||||
KeyR1 = AppConfig.Get("bind_rb", MappingRB);
|
KeyR1 = AppConfig.Get("bind_rb", BindRB);
|
||||||
KeyL2 = AppConfig.Get("bind2_lb");
|
KeyL2 = AppConfig.Get("bind2_lb");
|
||||||
KeyR2 = AppConfig.Get("bind2_rb");
|
KeyR2 = AppConfig.Get("bind2_rb");
|
||||||
break;
|
break;
|
||||||
case BindingZone.AB:
|
case BindingZone.AB:
|
||||||
KeyL1 = AppConfig.Get("bind_a", MappingA);
|
KeyL1 = AppConfig.Get("bind_a", BindA);
|
||||||
KeyR1 = AppConfig.Get("bind_b", MappingB);
|
KeyR1 = AppConfig.Get("bind_b", BindB);
|
||||||
KeyL2 = AppConfig.Get("bind2_a");
|
KeyL2 = AppConfig.Get("bind2_a");
|
||||||
KeyR2 = AppConfig.Get("bind2_b");
|
KeyR2 = AppConfig.Get("bind2_b");
|
||||||
break;
|
break;
|
||||||
case BindingZone.XY:
|
case BindingZone.XY:
|
||||||
KeyL1 = AppConfig.Get("bind_x", MappingX);
|
KeyL1 = AppConfig.Get("bind_x", BindX);
|
||||||
KeyR1 = AppConfig.Get("bind_y", MappingY);
|
KeyR1 = AppConfig.Get("bind_y", BindY);
|
||||||
KeyL2 = AppConfig.Get("bind2_x");
|
KeyL2 = AppConfig.Get("bind2_x");
|
||||||
KeyR2 = AppConfig.Get("bind2_y");
|
KeyR2 = AppConfig.Get("bind2_y");
|
||||||
break;
|
break;
|
||||||
case BindingZone.ViewMenu:
|
case BindingZone.ViewMenu:
|
||||||
KeyL1 = AppConfig.Get("bind_vb", MappingVB);
|
KeyL1 = AppConfig.Get("bind_vb", BindVB);
|
||||||
KeyR1 = AppConfig.Get("bind_mb", MappingMB);
|
KeyR1 = AppConfig.Get("bind_mb", BindMB);
|
||||||
KeyL2 = AppConfig.Get("bind2_vb");
|
KeyL2 = AppConfig.Get("bind2_vb");
|
||||||
KeyR2 = AppConfig.Get("bind2_mb");
|
KeyR2 = AppConfig.Get("bind2_mb");
|
||||||
break;
|
break;
|
||||||
case BindingZone.M1M2:
|
case BindingZone.M1M2:
|
||||||
KeyL1 = AppConfig.Get("bind_m2", MappingM2);
|
KeyL1 = AppConfig.Get("bind_m2", BindM2);
|
||||||
KeyR1 = AppConfig.Get("bind_m1", MappingM1);
|
KeyR1 = AppConfig.Get("bind_m1", BindM1);
|
||||||
KeyL2 = AppConfig.Get("bind2_m2", MappingM2);
|
KeyL2 = AppConfig.Get("bind2_m2", BindM2);
|
||||||
KeyR2 = AppConfig.Get("bind2_m1", MappingM1);
|
KeyR2 = AppConfig.Get("bind2_m1", BindM1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
KeyL1 = AppConfig.Get("bind_trl", MappingLT);
|
KeyL1 = AppConfig.Get("bind_trl", BindLT);
|
||||||
KeyR1 = AppConfig.Get("bind_trr", MappingRT);
|
KeyR1 = AppConfig.Get("bind_trr", BindRT);
|
||||||
KeyL2 = AppConfig.Get("bind2_trl");
|
KeyL2 = AppConfig.Get("bind2_trl");
|
||||||
KeyR2 = AppConfig.Get("bind2_trr");
|
KeyR2 = AppConfig.Get("bind2_trr");
|
||||||
break;
|
break;
|
||||||
@@ -402,7 +401,7 @@ namespace GHelper.Ally
|
|||||||
DecodeBinding(KeyR1).CopyTo(bindings, 27);
|
DecodeBinding(KeyR1).CopyTo(bindings, 27);
|
||||||
DecodeBinding(KeyR2).CopyTo(bindings, 38);
|
DecodeBinding(KeyR2).CopyTo(bindings, 38);
|
||||||
|
|
||||||
AsusHid.WriteInput(MappingReady, null);
|
AsusHid.WriteInput(CommandReady, null);
|
||||||
AsusHid.WriteInput(bindings, $"Bind{zone}");
|
AsusHid.WriteInput(bindings, $"Bind{zone}");
|
||||||
|
|
||||||
|
|
||||||
@@ -438,23 +437,23 @@ namespace GHelper.Ally
|
|||||||
if (applyMode is not null) _applyMode = (ControllerMode)applyMode;
|
if (applyMode is not null) _applyMode = (ControllerMode)applyMode;
|
||||||
|
|
||||||
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 0x01, 0x01, (byte)_applyMode }, "Controller");
|
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 0x01, 0x01, (byte)_applyMode }, "Controller");
|
||||||
AsusHid.WriteInput(MappingSave, null);
|
AsusHid.WriteInput(CommandSave, null);
|
||||||
|
|
||||||
MappingZone(BindingZone.M1M2);
|
BindZone(BindingZone.M1M2);
|
||||||
|
|
||||||
if (_applyMode == ControllerMode.Gamepad)
|
if (_applyMode == ControllerMode.Gamepad)
|
||||||
{
|
{
|
||||||
MappingZone(BindingZone.DPadUpDown);
|
BindZone(BindingZone.DPadUpDown);
|
||||||
MappingZone(BindingZone.DPadLeftRight);
|
BindZone(BindingZone.DPadLeftRight);
|
||||||
MappingZone(BindingZone.StickClick);
|
BindZone(BindingZone.StickClick);
|
||||||
MappingZone(BindingZone.Bumper);
|
BindZone(BindingZone.Bumper);
|
||||||
MappingZone(BindingZone.AB);
|
BindZone(BindingZone.AB);
|
||||||
MappingZone(BindingZone.XY);
|
BindZone(BindingZone.XY);
|
||||||
MappingZone(BindingZone.ViewMenu);
|
BindZone(BindingZone.ViewMenu);
|
||||||
MappingZone(BindingZone.Trigger);
|
BindZone(BindingZone.Trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
AsusHid.WriteInput(MappingSave, null);
|
AsusHid.WriteInput(CommandSave, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetMode(ControllerMode mode)
|
private void SetMode(ControllerMode mode)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.147</AssemblyVersion>
|
<AssemblyVersion>0.148</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ namespace GHelper
|
|||||||
|
|
||||||
trackVibra.ValueChanged += Controller_Complete;
|
trackVibra.ValueChanged += Controller_Complete;
|
||||||
|
|
||||||
FillBinding("m1", "M1", AllyControl.MappingM1);
|
FillBinding("m1", "M1", AllyControl.BindM1);
|
||||||
FillBinding("m2", "M2", AllyControl.MappingM2);
|
FillBinding("m2", "M2", AllyControl.BindM2);
|
||||||
|
|
||||||
FillBinding("a", "A");
|
FillBinding("a", "A");
|
||||||
FillBinding("b", "B");
|
FillBinding("b", "B");
|
||||||
@@ -77,7 +77,7 @@ namespace GHelper
|
|||||||
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
combo.DisplayMember = "Value";
|
combo.DisplayMember = "Value";
|
||||||
combo.ValueMember = "Key";
|
combo.ValueMember = "Key";
|
||||||
foreach (var item in AllyControl.BindingCodes)
|
foreach (var item in AllyControl.BindCodes)
|
||||||
{
|
{
|
||||||
combo.Items.Add(new KeyValuePair<int, string>(item.Key, item.Value));
|
combo.Items.Add(new KeyValuePair<int, string>(item.Key, item.Value));
|
||||||
if (item.Key == value) combo.SelectedItem = item;
|
if (item.Key == value) combo.SelectedItem = item;
|
||||||
|
|||||||
Reference in New Issue
Block a user