File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2323
2424#define MAX_MACRO_LENGTH 24 // Maximum number of key reports in a macro
2525#define MACRO_SLOTS 5
26- #define MACRO_DELAY 10 // ms
26+ #define MACRO_DELAY 30 // ms between reports in macro playback
27+ #define MACRO_DELAY_RELESE 10 // ms between key press and release in macro playback
2728#define PERSISTENT_MACRO 1 // Save macros to EEPROM
2829
2930#if PERSISTENT_MACRO
@@ -500,7 +501,6 @@ void keyRelease(uint8_t keyCode)
500501 #if DEBUG_MODE
501502 printKeyReport ();
502503 #endif
503- record_last_report ();
504504}
505505
506506void keystroke (uint8_t keyCode, uint8_t modifiers)
@@ -553,7 +553,6 @@ void stopRecording()
553553 Serial.println (" Stop recording macro" );
554554 #endif
555555 noInterrupts (); // Disable interrupts to enter critical section
556- macros[currentMacroSlot].length = macroIndex;
557556 recording = false ;
558557 recordingSlot = false ;
559558 // Save macros to EEPROM
@@ -611,6 +610,9 @@ void playMacro()
611610 {
612611 noInterrupts (); // Disable interrupts to enter critical section
613612 HID ().SendReport (2 , ¯os[currentMacroSlot].keyReports [macroIndex], sizeof (KeyReport));
613+ // wait 10 ms an release all keys
614+ delay (MACRO_DELAY_RELESE);
615+ Keyboard.releaseAll ();
614616 macroIndex++;
615617 lastKeyPressTime = millis ();
616618 interrupts (); // Enable interrupts to exit critical section
You can’t perform that action at this time.
0 commit comments