Fixed saving of "Repeat While Held" macro setting

Related to issue #1092
This commit is contained in:
Travis Nickles 2020-02-02 13:46:44 -06:00
parent 8203a0dfe1
commit c0788ab98d

View File

@ -78,6 +78,8 @@ namespace DS4WinWPF.DS4Forms.ViewModels
case DS4ControlSettings.ActionType.Macro:
currentOutBind.outputType = OutBinding.OutType.Macro;
currentOutBind.macro = (int[])setting.action;
currentOutBind.macroType = settings.keyType;
currentOutBind.hasScanCode = sc;
break;
}
}
@ -114,6 +116,8 @@ namespace DS4WinWPF.DS4Forms.ViewModels
case DS4ControlSettings.ActionType.Macro:
shiftOutBind.outputType = OutBinding.OutType.Macro;
shiftOutBind.macro = (int[])setting.shiftAction;
shiftOutBind.macroType = setting.shiftKeyType;
shiftOutBind.hasScanCode = sc;
break;
}
}
@ -204,6 +208,7 @@ namespace DS4WinWPF.DS4Forms.ViewModels
public OutType outputType;
public int outkey;
public int[] macro;
public DS4KeyType macroType;
public X360Controls control;
public bool shiftBind;
public int shiftTrigger;
@ -576,9 +581,21 @@ namespace DS4WinWPF.DS4Forms.ViewModels
{
settings.action = macro;
settings.actionType = DS4ControlSettings.ActionType.Macro;
if (macroType.HasFlag(DS4KeyType.HoldMacro))
{
settings.keyType |= DS4KeyType.HoldMacro;
}
else
{
settings.keyType |= DS4KeyType.Macro;
}
if (hasScanCode)
{
settings.keyType |= DS4KeyType.ScanCode;
}
}
if (IsUsingExtras())
{
settings.extras = CompileExtras();
@ -625,7 +642,20 @@ namespace DS4WinWPF.DS4Forms.ViewModels
{
settings.shiftAction = macro;
settings.shiftActionType = DS4ControlSettings.ActionType.Macro;
settings.shiftKeyType |= DS4KeyType.Macro;
if (macroType.HasFlag(DS4KeyType.HoldMacro))
{
settings.keyType |= DS4KeyType.HoldMacro;
}
else
{
settings.keyType |= DS4KeyType.Macro;
}
if (hasScanCode)
{
settings.shiftKeyType |= DS4KeyType.ScanCode;
}
}
if (IsUsingExtras())