add delay

This commit is contained in:
Siyuan Miao 2025-09-10 17:21:44 +02:00
parent 024cbb8fb1
commit d7c8abbb11
2 changed files with 2 additions and 3 deletions

View File

@ -1115,7 +1115,6 @@ func rpcKeyboardReportMulti(ctx context.Context, macro []hidrpc.KeyboardMacro) (
}
delay := time.Duration(step.Delay) * time.Millisecond
logger.Info().Int("step", i).Uint16("delay", step.Delay).Msg("Keyboard report multi delay")
last, err = rpcKeyboardReport(step.Modifier, step.Keys)
if err != nil {

View File

@ -111,8 +111,8 @@ export default function useKeyboard() {
// If the step has keys and/or modifiers, press them and hold for the delay
if (keyValues.length > 0 || modifierMask > 0) {
macro.push({ keys: keyValues, modifier: modifierMask, delay: 50 });
macro.push({ ...MACRO_RESET_KEYBOARD_STATE, delay: 200 });
macro.push({ keys: keyValues, modifier: modifierMask, delay: 20 });
macro.push({ ...MACRO_RESET_KEYBOARD_STATE, delay: 100 });
}
}