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

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

Loading…
Cancel
Save