Files
Nicolas Munnich 19582174f3 chore: Add basic tests for Studio's layer manipulation (#3164)
chore: Add test behaviors for Studio testing

chore: Add basic tests for studio layer adjustment

chore: Fixes from code review
2026-01-07 19:01:05 -05:00

27 lines
750 B
Plaintext

#include <dt-bindings/zmk/keys.h>
#include <behaviors.dtsi>
#include <dt-bindings/zmk/kscan_mock.h>
#include "../behavior_keymap.dtsi"
// Test removing layer 0: layer 1 becomes bottom layer
&kscan {
events = <
// toggle layer 1 on
ZMK_MOCK_PRESS(0,1,10)
ZMK_MOCK_RELEASE(0,1,10)
// remove layer 0
ZMK_MOCK_PRESS(1,0,10)
ZMK_MOCK_RELEASE(1,0,10)
// press position 0,0 - should output B (layer 1)
ZMK_MOCK_PRESS(0,0,10)
ZMK_MOCK_RELEASE(0,0,10)
// try to toggle layer 1 off
ZMK_MOCK_PRESS(0,1,10)
ZMK_MOCK_RELEASE(0,1,10)
// press position 0,0 - should output B
// (layer 1 is now the bottom layer, so shouldn't be disabled)
ZMK_MOCK_PRESS(0,0,10)
ZMK_MOCK_RELEASE(0,0,10)
>;
};