Update testcases: events/keyboard-state/macros

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1024/head
Michael Richters 4 years ago
parent c1e64d0a60
commit 78ec964b09
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -19,10 +19,6 @@
#include "./common.h" #include "./common.h"
#undef min
#undef max
#include <iostream>
// *INDENT-OFF* // *INDENT-OFF*
KEYMAPS( KEYMAPS(
[0] = KEYMAP_STACKED [0] = KEYMAP_STACKED
@ -60,12 +56,13 @@ KEYMAPS(
) )
// *INDENT-ON* // *INDENT-ON*
const macro_t *macroAction(uint8_t index, uint8_t key_state) { const macro_t *macroAction(uint8_t index, KeyEvent &event) {
if (keyToggledOn(key_state)) { if (keyToggledOn(event.state)) {
switch (index) { switch (index) {
case 0: case 0:
Kaleidoscope.hid().keyboard().pressKey(Key_Y); return MACRO(D(Y));
break; //event.key = Key_Y;
//break;
} }
} }
return MACRO_NONE; return MACRO_NONE;

@ -1,51 +1,47 @@
VERSION 1 VERSION 1
KEYSWITCH A 0 0 KEYSWITCH A 0 0
KEYSWITCH LAYER_SHIFT 1 0 KEYSWITCH L_1 1 0
# ============================================================================== # ==============================================================================
# Keyboard state array # Keyboard state array
NAME Keyboard state array cleared NAME Keyboard state array cleared
RUN 10 ms RUN 4 ms
PRESS A PRESS A
RUN 1 cycle RUN 1 cycle
EXPECT keyboard-report Key_A # Report should contain only `A` EXPECT keyboard-report Key_A # Report should contain only `A`
RUN 5 ms RUN 4 ms
RELEASE A RELEASE A
RUN 1 cycle RUN 1 cycle
EXPECT keyboard-report empty # Report should be empty EXPECT keyboard-report empty # Report should be empty
RUN 5 ms RUN 5 ms
# Press and hold `ShiftToLayer(1)`, changing the `A` key to `X` # Press and hold `ShiftToLayer(1)`, changing the `A` key to `X`
PRESS LAYER_SHIFT PRESS L_1
RUN 5 ms
RUN 4 ms
PRESS A PRESS A
RUN 1 cycle RUN 1 cycle
EXPECT keyboard-report Key_Y # Report should contain only `Y` EXPECT keyboard-report Key_Y # Report should contain only `Y`
RUN 1 cycle
EXPECT keyboard-report empty # Report should be empty
RUN 5 ms RUN 5 ms
RELEASE L_1
RUN 4 ms
RELEASE A RELEASE A
RUN 1 cycle
EXPECT keyboard-report empty # Report should be empty
RUN 5 ms RUN 4 ms
RELEASE LAYER_SHIFT
RUN 5 ms
PRESS A PRESS A
RUN 1 cycle RUN 1 cycle
EXPECT keyboard-report Key_A # Report should contain only `A` EXPECT keyboard-report Key_A # Report should contain only `A`
RUN 5 ms RUN 4 ms
RELEASE A RELEASE A
RUN 1 cycle RUN 1 cycle
EXPECT keyboard-report empty # Report should be empty EXPECT keyboard-report empty # Report should be empty
RUN 5 ms

Loading…
Cancel
Save