This commit is contained in:
mika-n 2020-01-04 21:13:36 +02:00
commit 2476a3482d

View File

@ -308,22 +308,21 @@ namespace DS4WinWPF.DS4Forms.ViewModels
continue; continue;
} }
keysdownMap.TryGetValue((int)dc, out bool isdown); int macroValue = Global.macroDS4Values[dc];
keysdownMap.TryGetValue(macroValue, out bool isdown);
if (!isdown && Mapping.getBoolMapping(0, dc, cState, null, null)) if (!isdown && Mapping.getBoolMapping(0, dc, cState, null, null))
{ {
int macroValue = Global.macroDS4Values[dc];
MacroStep step = new MacroStep(macroValue, MacroParser.macroInputNames[macroValue], MacroStep step = new MacroStep(macroValue, MacroParser.macroInputNames[macroValue],
MacroStep.StepType.ActDown, MacroStep.StepOutput.Button); MacroStep.StepType.ActDown, MacroStep.StepOutput.Button);
AddMacroStep(step); AddMacroStep(step);
keysdownMap.Add((int)dc, true); keysdownMap.Add(macroValue, true);
} }
else if (isdown && !Mapping.getBoolMapping(0, dc, cState, null, null)) else if (isdown && !Mapping.getBoolMapping(0, dc, cState, null, null))
{ {
int macroValue = Global.macroDS4Values[dc];
MacroStep step = new MacroStep(macroValue, MacroParser.macroInputNames[macroValue], MacroStep step = new MacroStep(macroValue, MacroParser.macroInputNames[macroValue],
MacroStep.StepType.ActUp, MacroStep.StepOutput.Button); MacroStep.StepType.ActUp, MacroStep.StepOutput.Button);
AddMacroStep(step); AddMacroStep(step);
keysdownMap.Remove((int)dc); keysdownMap.Remove(macroValue);
} }
} }
} }