From 5f20a3f41c9380180c175c0ef6e9476b1416d70c Mon Sep 17 00:00:00 2001 From: "Chow Castro, Marcos" Date: Wed, 28 Sep 2022 13:17:58 +0200 Subject: [PATCH] LOCK and UNLOCK added --- config/corne.keymap | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/config/corne.keymap b/config/corne.keymap index e721da8..132877c 100644 --- a/config/corne.keymap +++ b/config/corne.keymap @@ -78,6 +78,10 @@ SPDX-License-Identifier: MIT #define FUNCTION 3 #define MEDIA 4 #define MOUSE 5 +#define NONE_LOCK_LAYER 6 +#define LOCK_LAYER 7 +#define LOCK &tog LOCK_LAYER +#define UNLOCK &tog DEFAULT // combinadas para optimizar espacio #define MEDIA_ESC < MEDIA ESC #define MOUSE_TAB < MOUSE TAB @@ -107,6 +111,15 @@ SPDX-License-Identifier: MIT //}}} // ### keymap {{{ / { + conditional_layers { + compatible = "zmk,conditional-layers"; + + tri_layer { + if-layers = ; + then-layer = ; + }; + }; + keymap { compatible = "zmk,keymap"; // ### default_layer {{{ @@ -172,9 +185,9 @@ SPDX-License-Identifier: MIT // ### function_layer {{{ function_layer { // .------------------------------------------------. .-------------------------------------------------. - // | F1 | F2 | F3 | F4 | SPELL |TRADUCT| | | | | | | | + // | F1 | F2 | F3 | F4 | SPELL |TRADUCT| | | | | | | LOCK | // |--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+---------| - // | F5 | F6 | F7 | F8 | \ |SNIPPET| |TASKM | | | |BRI_UP | | + // | F5 | F6 | F7 | F8 | \ |SNIPPET| |TASKM | | | |BRI_UP | UNLOCK | // |--------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+---------| // | F9 | F10 | F11 | F12 |CLIPBRD|EMOJI | |L_SHIFT|L_SHIFT|R_SHIFT| | BRI_UP| | // '---------------------------------------------------------| |----------------------------------------------------------' @@ -183,8 +196,8 @@ SPDX-License-Identifier: MIT // LCTL(LGUI(KC_D)), LCTL(LGUI(KC_SPC)) // label = "FUNCTION"; bindings = < - DE_F1 DE_F2 DE_F3 DE_F4 SPELL TRADUCT XXX XXX XXX XXX XXX XXX - DE_F5 DE_F6 DE_F7 DE_F8 DE_BSLS SNIPPET TASKM XXX XXX XXX DE_BRI_UP XXX + DE_F1 DE_F2 DE_F3 DE_F4 SPELL TRADUCT XXX XXX XXX XXX XXX LOCK + DE_F5 DE_F6 DE_F7 DE_F8 DE_BSLS SNIPPET TASKM XXX XXX XXX DE_BRI_UP UNLOCK DE_F9 DE_F10 DE_F11 DE_F12 CLIPBRD EMOJI DE_LSHFT DE_LSHFT DE_RSHFT XXX DE_BRI_DN XXX DE_LCTRL DE_LGUI DE_LALT DE_TAB DE_ACUT DE_LCTRL >; @@ -253,6 +266,28 @@ SPDX-License-Identifier: MIT }; // }}} #endif // CONFIG_ZMK_RGB_UNDERGLOW + // in default_layer(RALT) + Backspace = lock + // in lock_layer(RALT) + none_lock(ESC)+lock(Q)+Enter = unlock + // The "soft lock" mode that effective disables + // other keys, allowing the keyboard to be transported without spurious key presses. + // If https://github.com/zmkfirmware/zmk/issues/405 is implemented, this layer can be + // replaced by a native behavior in the future. + none_lock_layer { + bindings = < + &mo NONE_LOCK &mo LOCK &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none + >; + }; + lock_layer { + bindings = < + &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &mo NONE_LOCK + >; + }; }; }; // }}}