Skip to content

Commit 7fb30b9

Browse files
authored
Macro Press Fix (#962)
* Single line fix for macro press. This was a fix for hold-repeat that messed up the press macro option. * Set the input held duration on EVERY frame instead of just the first
1 parent 9efe004 commit 7fb30b9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/addons/input_macro.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void InputMacro::runCurrentMacro() {
163163
Macro& macro = inputMacroOptions->macroList[macroPosition];
164164

165165
// Stop Macro if released (ON PRESS & ON HOLD REPEAT)
166-
if (inputMacroOptions->macroList[macroPosition].macroType != ON_TOGGLE &&
166+
if (inputMacroOptions->macroList[macroPosition].macroType == ON_HOLD_REPEAT &&
167167
!isMacroTriggerHeld && macro.interruptible) {
168168
reset();
169169
return;
@@ -226,12 +226,15 @@ void InputMacro::runCurrentMacro() {
226226
reset(); // On repeat, reset but keep the button held
227227
} else {
228228
macroInputPosition = 0; // On Hold-Repeat or On Toggle = start macro again
229-
macroStartTime = currentMicros;
230229
MacroInput& newMacroInput = macro.macroInputs[macroInputPosition];
231230
uint32_t newMacroInputDuration = newMacroInput.duration + newMacroInput.waitDuration;
232231
macroInputHoldTime = newMacroInputDuration <= 0 ? INPUT_HOLD_US : newMacroInputDuration;
233232
}
234233
}
234+
} else {
235+
MacroInput& newMacroInput = macro.macroInputs[macroInputPosition];
236+
uint32_t newMacroInputDuration = newMacroInput.duration + newMacroInput.waitDuration;
237+
macroInputHoldTime = newMacroInputDuration <= 0 ? INPUT_HOLD_US : newMacroInputDuration;
235238
}
236239
}
237240
}

0 commit comments

Comments
 (0)