diff --git a/tests/issues/571/571.ino b/tests/issues/571/571.ino
new file mode 100644
index 00000000..b99310fb
--- /dev/null
+++ b/tests/issues/571/571.ino
@@ -0,0 +1,66 @@
+/* -*- mode: c++ -*-
+ * Copyright (C) 2021 Keyboard.io, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+
+#include
+#include
+
+// *INDENT-OFF*
+KEYMAPS(
+ [0] = KEYMAP_STACKED
+ (
+ TD(0), ___, ___, ___, ___, ___, ___,
+ Key_Tab, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___,
+ ___,
+
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___,
+ ___
+ ),
+)
+// *INDENT-ON*
+
+void tapDanceAction(uint8_t tap_dance_index,
+ KeyAddr key_addr,
+ uint8_t tap_count,
+ kaleidoscope::plugin::TapDance::ActionType tap_dance_action) {
+ switch (tap_dance_index) {
+ case 0:
+ return tapDanceActionKeys(tap_count, tap_dance_action,
+ Key_LeftControl, LGUI(Key_LeftBracket));
+ case 1:
+ return tapDanceActionKeys(tap_count, tap_dance_action,
+ Key_RightControl, LGUI(Key_RightBracket));
+ default:
+ break;
+ }
+}
+
+KALEIDOSCOPE_INIT_PLUGINS(TapDance);
+
+void setup() {
+ Kaleidoscope.setup();
+ TapDance.time_out = 25;
+}
+
+void loop() {
+ Kaleidoscope.loop();
+}
diff --git a/tests/issues/571/sketch.json b/tests/issues/571/sketch.json
new file mode 100644
index 00000000..43dc4c7e
--- /dev/null
+++ b/tests/issues/571/sketch.json
@@ -0,0 +1,6 @@
+{
+ "cpu": {
+ "fqbn": "keyboardio:virtual:model01",
+ "port": ""
+ }
+}
\ No newline at end of file
diff --git a/tests/issues/571/test.ktest b/tests/issues/571/test.ktest
new file mode 100644
index 00000000..2492dc2a
--- /dev/null
+++ b/tests/issues/571/test.ktest
@@ -0,0 +1,49 @@
+VERSION 1
+
+KEYSWITCH TD_0 0 0
+KEYSWITCH TAB 1 0
+
+# ==============================================================================
+NAME Issue 571
+
+RUN 4 ms
+PRESS TD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS TAB
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl # report: e0
+EXPECT keyboard-report Key_LeftControl Key_Tab # report: e0, 2b
+
+RUN 19 ms
+RELEASE TAB
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl # report: e0
+
+RUN 4 ms
+RELEASE TD_0
+RUN 1 cycle
+EXPECT keyboard-report empty # report: -
+
+RUN 10 ms
+
+RUN 4 ms
+PRESS TD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS TAB
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl # report: e0
+EXPECT keyboard-report Key_LeftControl Key_Tab # report: e0, 2b
+
+RUN 19 ms
+RELEASE TAB
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl # report: e0
+
+RUN 4 ms
+RELEASE TD_0
+RUN 1 cycle
+EXPECT keyboard-report empty # report: -
diff --git a/tests/issues/673/673.ino b/tests/issues/673/673.ino
new file mode 100644
index 00000000..9b0943fe
--- /dev/null
+++ b/tests/issues/673/673.ino
@@ -0,0 +1,52 @@
+/* -*- mode: c++ -*-
+ * Copyright (C) 2021 Keyboard.io, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see .
+ */
+
+#include
+#include
+
+// *INDENT-OFF*
+KEYMAPS(
+ [0] = KEYMAP_STACKED
+ (
+ OSM(LeftShift), OSM(LeftControl), ___, ___, ___, ___, ___,
+ Key_A, Key_B, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___,
+ ___,
+
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___, ___, ___, ___,
+ ___, ___, ___, ___,
+ ___
+ ),
+)
+// *INDENT-ON*
+
+KALEIDOSCOPE_INIT_PLUGINS(OneShot);
+
+void setup() {
+ Kaleidoscope.setup();
+ OneShot.setTimeout(50);
+ OneShot.setHoldTimeout(20);
+ OneShot.setDoubleTapTimeout(20);
+}
+
+void loop() {
+ Kaleidoscope.loop();
+}
diff --git a/tests/issues/673/sketch.json b/tests/issues/673/sketch.json
new file mode 100644
index 00000000..43dc4c7e
--- /dev/null
+++ b/tests/issues/673/sketch.json
@@ -0,0 +1,6 @@
+{
+ "cpu": {
+ "fqbn": "keyboardio:virtual:model01",
+ "port": ""
+ }
+}
\ No newline at end of file
diff --git a/tests/issues/673/test.ktest b/tests/issues/673/test.ktest
new file mode 100644
index 00000000..ec6f9b85
--- /dev/null
+++ b/tests/issues/673/test.ktest
@@ -0,0 +1,59 @@
+VERSION 1
+
+KEYSWITCH OS_SFT 0 0
+KEYSWITCH OS_CTL 0 1
+KEYSWITCH A 1 0
+KEYSWITCH B 1 1
+
+# ==============================================================================
+NAME Issue 673
+
+RUN 4 ms
+PRESS OS_CTL
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl # report: { e0 }
+
+RUN 4 ms
+RELEASE OS_CTL
+RUN 1 cycle
+
+RUN 4 ms
+PRESS OS_CTL
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE OS_CTL
+RUN 1 cycle
+
+RUN 100 ms
+
+RUN 4 ms
+PRESS OS_SFT
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl Key_LeftShift # report: { e0 e1 }
+
+RUN 4 ms
+RELEASE OS_SFT
+RUN 1 cycle
+
+RUN 4 ms
+PRESS OS_SFT
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE OS_SFT
+RUN 1 cycle
+
+RUN 100 ms
+
+RUN 4 ms
+PRESS A
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl Key_LeftShift Key_A # report: { 4 e0 e1 }
+
+RUN 4 ms
+RELEASE A
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftControl Key_LeftShift # report: { e0 e1 }
+
+RUN 5 ms
diff --git a/tests/plugins/Leader/basic/basic.ino b/tests/plugins/Leader/basic/basic.ino
index febdf47e..9995a663 100644
--- a/tests/plugins/Leader/basic/basic.ino
+++ b/tests/plugins/Leader/basic/basic.ino
@@ -23,7 +23,7 @@ KEYMAPS(
[0] = KEYMAP_STACKED
(
LEAD(0), ___, ___, ___, ___, ___, ___,
- Key_A, Key_B, Key_C, Key_D, ___, ___, ___,
+ Key_A, Key_B, Key_C, Key_D, Key_C, ___, ___,
___, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___,
___, ___, ___, ___,
@@ -41,18 +41,33 @@ KEYMAPS(
KALEIDOSCOPE_INIT_PLUGINS(Leader);
-static void leaderBC(uint8_t id) {
- Macros.type(PSTR("x"));
+static void leaderAB(uint8_t id) {
+ Macros.type(PSTR("z"));
}
static void leaderAC(uint8_t id) {
Macros.type(PSTR("xyz"));
}
+static void leaderBA(uint8_t id) {
+ Macros.type(PSTR("y"));
+}
+
+static void leaderBC(uint8_t id) {
+ Macros.type(PSTR("x"));
+}
+
+static void leaderC(uint8_t id) {
+ Macros.type(PSTR("q"));
+}
+
// *INDENT-OFF*
static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM =
- LEADER_DICT( {LEADER_SEQ(LEAD(0), Key_B, Key_C), leaderBC},
- {LEADER_SEQ(LEAD(0), Key_A, Key_C), leaderAC} );
+ LEADER_DICT( {LEADER_SEQ(LEAD(0), Key_A, Key_B), leaderAB},
+ {LEADER_SEQ(LEAD(0), Key_A, Key_C), leaderAC},
+ {LEADER_SEQ(LEAD(0), Key_B, Key_A), leaderBA},
+ {LEADER_SEQ(LEAD(0), Key_B, Key_C), leaderBC},
+ {LEADER_SEQ(LEAD(0), Key_C), leaderC } );
// *INDENT-ON*
void setup() {
diff --git a/tests/plugins/Leader/basic/test.ktest b/tests/plugins/Leader/basic/test.ktest
index 62cfa2f6..32ee6380 100644
--- a/tests/plugins/Leader/basic/test.ktest
+++ b/tests/plugins/Leader/basic/test.ktest
@@ -5,6 +5,70 @@ KEYSWITCH A 1 0
KEYSWITCH B 1 1
KEYSWITCH C 1 2
KEYSWITCH D 1 3
+KEYSWITCH C2 1 4
+
+# ==============================================================================
+NAME Leader sequence abort
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS A
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE A
+RUN 1 cycle
+
+RUN 4 ms
+PRESS D
+RUN 1 cycle
+EXPECT keyboard-report Key_D # report: { 7 }
+
+RUN 4 ms
+RELEASE D
+RUN 1 cycle
+EXPECT keyboard-report empty # report: { }
+
+RUN 5 ms
+
+# ==============================================================================
+NAME Leader sequence AB
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS A
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE A
+RUN 1 cycle
+
+RUN 4 ms
+PRESS B
+RUN 1 cycle
+EXPECT keyboard-report Key_Z # report should contain `Z` (0x1d)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+RELEASE B
+RUN 1 cycle
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
# ==============================================================================
NAME Leader sequence AC
@@ -42,6 +106,38 @@ RUN 1 cycle
RUN 5 ms
EXPECT no keyboard-report # expect no more reports
+# ==============================================================================
+NAME Leader sequence BA
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS B
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE B
+RUN 1 cycle
+
+RUN 4 ms
+PRESS A
+RUN 1 cycle
+EXPECT keyboard-report Key_Y # report should contain `Y` (0x1c)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+RELEASE A
+RUN 1 cycle
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
+
# ==============================================================================
NAME Leader sequence BC
@@ -74,6 +170,172 @@ RUN 1 cycle
RUN 5 ms
EXPECT no keyboard-report # expect no more reports
+# ==============================================================================
+NAME Leader sequence C
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS C
+RUN 1 cycle
+EXPECT keyboard-report Key_Q # report should contain `Q` (0x13)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+RELEASE C
+RUN 1 cycle
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
+
+# ==============================================================================
+NAME Leader sequence BA rollover
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS B
+RUN 1 cycle
+
+RUN 4 ms
+PRESS A
+RUN 1 cycle
+EXPECT keyboard-report Key_Y # report should contain `Y` (0x1c)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+RELEASE B
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE A
+RUN 1 cycle
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
+
+# ==============================================================================
+NAME Leader sequence C rollover
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS C
+RUN 1 cycle
+EXPECT keyboard-report Key_Q # report should contain `Q` (0x13)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+PRESS D
+RUN 1 cycle
+EXPECT keyboard-report Key_D # report should contain `D` (0x07)
+
+RUN 4 ms
+RELEASE C
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE D
+RUN 1 cycle
+EXPECT keyboard-report empty # report should be empty
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
+
+# ==============================================================================
+NAME Leader sequence C2 rollover
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS C2
+RUN 1 cycle
+EXPECT keyboard-report Key_Q # report should contain `Q` (0x13)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+PRESS D
+RUN 1 cycle
+EXPECT keyboard-report Key_D # report should contain `D` (0x07)
+
+RUN 4 ms
+RELEASE C2
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE D
+RUN 1 cycle
+EXPECT keyboard-report empty # report should be empty
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
+
+# ==============================================================================
+NAME Leader sequence ABD rollover
+
+RUN 4 ms
+PRESS LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE LEAD_0
+RUN 1 cycle
+
+RUN 4 ms
+PRESS A
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE A
+RUN 1 cycle
+
+RUN 4 ms
+PRESS B
+RUN 1 cycle
+EXPECT keyboard-report Key_Z # report should contain `Z` (0x1d)
+EXPECT keyboard-report empty # report should be empty
+
+RUN 4 ms
+PRESS D
+RUN 1 cycle
+EXPECT keyboard-report Key_D # report should contain `D` (0x07)
+
+RUN 4 ms
+RELEASE B
+RUN 1 cycle
+
+RUN 4 ms
+RELEASE D
+RUN 1 cycle
+EXPECT keyboard-report empty # report should be empty
+
+RUN 5 ms
+EXPECT no keyboard-report # expect no more reports
+
# ==============================================================================
NAME Leader sequence timeout
diff --git a/tests/plugins/SpaceCadet/basic/basic.ino b/tests/plugins/SpaceCadet/basic/basic.ino
index aba9a916..ea934f33 100644
--- a/tests/plugins/SpaceCadet/basic/basic.ino
+++ b/tests/plugins/SpaceCadet/basic/basic.ino
@@ -23,7 +23,7 @@
KEYMAPS(
[0] = KEYMAP_STACKED
(
- Key_LeftShift, Key_RightShift, ___, ___, ___, ___, ___,
+ Key_LeftShift, Key_RightShift, Key_RightGui, ___, ___, ___, ___,
Key_A, Key_B, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___,
diff --git a/tests/plugins/SpaceCadet/basic/test.ktest b/tests/plugins/SpaceCadet/basic/test.ktest
index f3edaae8..581069ce 100644
--- a/tests/plugins/SpaceCadet/basic/test.ktest
+++ b/tests/plugins/SpaceCadet/basic/test.ktest
@@ -2,6 +2,7 @@ VERSION 1
KEYSWITCH LSHIFT 0 0
KEYSWITCH RSHIFT 0 1
+KEYSWITCH RGUI 0 2
KEYSWITCH A 1 0
KEYSWITCH B 1 1
@@ -123,3 +124,28 @@ RUN 3 ms
RELEASE RSHIFT
RUN 1 cycle
EXPECT keyboard-report empty # Report should be empty
+
+# ==============================================================================
+NAME SpaceCadet interrupt with modifier
+
+RUN 5 ms
+PRESS LSHIFT
+RUN 1 cycle
+
+RUN 3 ms
+PRESS RGUI
+RUN 1 cycle
+EXPECT keyboard-report Key_LeftShift # report: { e1 }
+EXPECT keyboard-report Key_LeftShift Key_RightGui # report: { e1 e7 }
+
+RUN 5 ms
+RELEASE LSHIFT
+RUN 1 cycle
+EXPECT keyboard-report Key_RightGui # report: { e7 }
+
+RUN 3 ms
+RELEASE RGUI
+RUN 1 cycle
+EXPECT keyboard-report empty # Report should be empty
+
+RUN 5 ms