From 463cf819c5d9ecbeeee7c0e0f85fd469327dbe5b Mon Sep 17 00:00:00 2001 From: Glen Date: Wed, 6 Apr 2022 21:37:44 -0400 Subject: [PATCH] add flea --- config/flea.conf | 4 + config/flea.keymap | 456 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 460 insertions(+) create mode 100644 config/flea.conf create mode 100644 config/flea.keymap diff --git a/config/flea.conf b/config/flea.conf new file mode 100644 index 0000000..db469b4 --- /dev/null +++ b/config/flea.conf @@ -0,0 +1,4 @@ +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=12 +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 \ No newline at end of file diff --git a/config/flea.keymap b/config/flea.keymap new file mode 100644 index 0000000..2137e3a --- /dev/null +++ b/config/flea.keymap @@ -0,0 +1,456 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * SPDX-License-Identifier: MIT + * + * This is a Colemak 28 keymap for the Flea keyboard. + * Last edited by James White, December 6, 2021. + */ + +#include +#include +#include + +&kscan0 { + debounce-period = <10>; +}; + +#define DEF_L 0 +#define NUM_L 1 +#define NAV_L 2 + +&sl { + release-after-ms = <5000>; + quick-release; +}; +&sk { + release-after-ms = <10000>; +}; + +/ { + behaviors { + sq: sticky_key_quick_release { + compatible = "zmk,behavior-sticky-key"; + label = "sticky key quick release"; + #binding-cells = <1>; + bindings = <&kp>; + release-after-ms = <10000>; + quick-release; + }; + nl: not_so_sticky_layer { + compatible = "zmk,behavior-hold-tap"; + label = "not so sticky layer"; + #binding-cells = <2>; + tapping_term_ms = <200>; + flavor = "tap-preferred"; + bindings = <&mo>, <&sl>; + }; + nk: not_so_sticky_key { + compatible = "zmk,behavior-hold-tap"; + label = "not so sticky key"; + #binding-cells = <2>; + tapping_term_ms = <200>; + flavor = "tap-preferred"; + bindings = <&kp>, <&sk>; + }; + nq: not_so_sticky_quick_release { + compatible = "zmk,behavior-hold-tap"; + label = "not so sticky quick release"; + #binding-cells = <2>; + tapping_term_ms = <200>; + flavor = "tap-preferred"; + bindings = <&kp>, <&sq>; + }; + bm: bottom_row_mods { + compatible = "zmk,behavior-hold-tap"; + label = "bottom row mods"; + #binding-cells = <2>; + tapping_term_ms = <240>; + quick_tap_ms = <180>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + }; + f111: f_one_eleven { + compatible = "zmk,behavior-mod-morph"; + label = "F1 F11"; + #binding-cells = <0>; + bindings = <&kp F1>, <&kp F11>; + mods = <(MOD_RALT)>; + }; + f212: f_two_twelve { + compatible = "zmk,behavior-mod-morph"; + label = "F2 F12"; + #binding-cells = <0>; + bindings = <&kp F2>, <&kp F12>; + mods = <(MOD_RALT)>; + }; + f313: f_three_thirteen { + compatible = "zmk,behavior-mod-morph"; + label = "F3 F13"; + #binding-cells = <0>; + bindings = <&kp F3>, <&kp F13>; + mods = <(MOD_RALT)>; + }; + f414: f_four_fourteen { + compatible = "zmk,behavior-mod-morph"; + label = "F4 F14"; + #binding-cells = <0>; + bindings = <&kp F4>, <&kp F14>; + mods = <(MOD_RALT)>; + }; + f515: f_five_fifteen { + compatible = "zmk,behavior-mod-morph"; + label = "F5 F15"; + #binding-cells = <0>; + bindings = <&kp F5>, <&kp F15>; + mods = <(MOD_RALT)>; + }; + f616: f_six_sixteen { + compatible = "zmk,behavior-mod-morph"; + label = "F6 F16"; + #binding-cells = <0>; + bindings = <&kp F6>, <&kp F16>; + mods = <(MOD_RALT)>; + }; + f717: f_seven_seventeen { + compatible = "zmk,behavior-mod-morph"; + label = "F7 F17"; + #binding-cells = <0>; + bindings = <&kp F7>, <&kp F17>; + mods = <(MOD_RALT)>; + }; + f818: f_eight_eighteen { + compatible = "zmk,behavior-mod-morph"; + label = "F8 F18"; + #binding-cells = <0>; + bindings = <&kp F8>, <&kp F18>; + mods = <(MOD_RALT)>; + }; + f919: f_nine_nineteen { + compatible = "zmk,behavior-mod-morph"; + label = "F9 F19"; + #binding-cells = <0>; + bindings = <&kp F9>, <&kp F19>; + mods = <(MOD_RALT)>; + }; + f1020: f_ten_twenty { + compatible = "zmk,behavior-mod-morph"; + label = "F10 F20"; + #binding-cells = <0>; + bindings = <&kp F10>, <&kp F20>; + mods = <(MOD_RALT)>; + }; + }; + combos { + compatible = "zmk,combos"; + combo_left_brace { + timeout-ms = <25>; + key-positions = <0 1>; + layers = <0>; + bindings = <&kp LBRC>; + }; + combo_right_brace { + timeout-ms = <25>; + key-positions = <1 2>; + layers = <0>; + bindings = <&kp RBRC>; + }; + combo_underscore { + timeout-ms = <25>; + key-positions = <2 3>; + layers = <0>; + bindings = <&kp UNDER>; + }; + combo_left_parenthesis { + timeout-ms = <25>; + key-positions = <9 10>; + layers = <0>; + bindings = <&kp LPAR>; + }; + combo_right_parenthesis { + timeout-ms = <25>; + key-positions = <10 11>; + layers = <0>; + bindings = <&kp RPAR>; + }; + combo_minus { + timeout-ms = <25>; + key-positions = <11 12>; + layers = <0>; + bindings = <&kp MINUS>; + }; + combo_grave { + timeout-ms = <25>; + key-positions = <18 19>; + layers = <0>; + bindings = <&kp GRAVE>; + }; + combo_left_bracket { + timeout-ms = <25>; + key-positions = <19 20>; + layers = <0>; + bindings = <&kp LBKT>; + }; + combo_right_bracket { + timeout-ms = <25>; + key-positions = <20 21>; + layers = <0>; + bindings = <&kp RBKT>; + }; + combo_plus { + timeout-ms = <25>; + key-positions = <4 5>; + layers = <0>; + bindings = <&kp PLUS>; + }; + combo_semicolon { + timeout-ms = <25>; + key-positions = <5 6>; + layers = <0>; + bindings = <&kp SEMI>; + }; + combo_colon { + timeout-ms = <25>; + key-positions = <6 7>; + layers = <0>; + bindings = <&kp COLON>; + }; + combo_equal { + timeout-ms = <25>; + key-positions = <13 14>; + layers = <0>; + bindings = <&kp EQUAL>; + }; + combo_comma { + timeout-ms = <25>; + key-positions = <14 15>; + layers = <0>; + bindings = <&kp COMMA>; + }; + combo_dot { + timeout-ms = <25>; + key-positions = <15 16>; + layers = <0>; + bindings = <&kp DOT>; + }; + combo_apostrophe { + timeout-ms = <25>; + key-positions = <22 23>; + layers = <0>; + bindings = <&kp APOS>; + }; + combo_forward_slash { + timeout-ms = <25>; + key-positions = <23 24>; + layers = <0>; + bindings = <&kp SLASH>; + }; + combo_backslash { + timeout-ms = <25>; + key-positions = <24 25>; + layers = <0>; + bindings = <&kp BSLH>; + }; + combo_f_one { + timeout-ms = <25>; + key-positions = <8 18>; + layers = <1 2>; + bindings = <&f111>; + }; + combo_f_two { + timeout-ms = <25>; + key-positions = <0 9>; + layers = <1>; + bindings = <&f212>; + }; + combo_f_three { + timeout-ms = <25>; + key-positions = <1 10>; + layers = <1 2>; + bindings = <&f313>; + }; + combo_f_four { + timeout-ms = <25>; + key-positions = <2 11>; + layers = <1 2>; + bindings = <&f414>; + }; + combo_f_five { + timeout-ms = <25>; + key-positions = <3 12>; + layers = <1 2>; + bindings = <&f515>; + }; + combo_f_six { + timeout-ms = <25>; + key-positions = <4 13>; + layers = <1 2>; + bindings = <&f616>; + }; + combo_f_seven { + timeout-ms = <25>; + key-positions = <5 14>; + layers = <1 2>; + bindings = <&f717>; + }; + combo_f_eight { + timeout-ms = <25>; + key-positions = <6 15>; + layers = <1 2>; + bindings = <&f818>; + }; + combo_f_nine { + timeout-ms = <25>; + key-positions = <7 16>; + layers = <1 2>; + bindings = <&f919>; + }; + combo_f_ten { + timeout-ms = <25>; + key-positions = <17 25>; + layers = <1 2>; + bindings = <&f1020>; + }; + combo_mute { + timeout-ms = <25>; + key-positions = <9 19>; + layers = <1 2>; + bindings = <&kp C_MUTE>; + }; + combo_vol_down { + timeout-ms = <25>; + key-positions = <10 20>; + layers = <1 2>; + bindings = <&kp C_VOLUME_DOWN>; + }; + combo_vol_up { + timeout-ms = <25>; + key-positions = <11 21>; + layers = <1 2>; + bindings = <&kp C_VOLUME_UP>; + }; + combo_media_play_pause { + timeout-ms = <25>; + key-positions = <14 22>; + layers = <1 2>; + bindings = <&kp C_PLAY_PAUSE>; + }; + combo_media_prev { + timeout-ms = <25>; + key-positions = <15 23>; + layers = <1 2>; + bindings = <&kp C_PREV>; + }; + combo_media_next { + timeout-ms = <25>; + key-positions = <16 24>; + layers = <1 2>; + bindings = <&kp C_NEXT>; + }; + combo_ctl_sft_tab { + timeout-ms = <25>; + key-positions = <0 1 2>; + layers = <0>; + bindings = <&kp LC(LS(TAB))>; + }; + combo_alt_sft_tab { + timeout-ms = <25>; + key-positions = <9 10 11>; + layers = <0>; + bindings = <&kp LA(LS(TAB))>; + }; + combo_gui_sft_tab { + timeout-ms = <25>; + key-positions = <19 20 21>; + layers = <0>; + bindings = <&kp LG(LS(TAB))>; + }; + combo_ctl_tab { + timeout-ms = <25>; + key-positions = <5 6 7>; + layers = <0>; + bindings = <&kp LC(TAB)>; + }; + combo_alt_tab { + timeout-ms = <25>; + key-positions = <14 15 16>; + layers = <0>; + bindings = <&kp LA(TAB)>; + }; + combo_gui_tab { + timeout-ms = <25>; + key-positions = <22 23 24>; + layers = <0>; + bindings = <&kp LG(TAB)>; + }; + combo_toggle_number_layer { + timeout-ms = <25>; + key-positions = <8 9 10 11>; + layers = <0 1>; + bindings = <&tog NUM_L>; + }; + combo_toggle_navigation_layer { + timeout-ms = <25>; + key-positions = <14 15 16 17>; + layers = <0 2>; + bindings = <&tog NAV_L>; + }; + combo_cancel_stickies_left { + timeout-ms = <25>; + key-positions = <8 9 10 11>; + layers = <2>; + bindings = <&kp F21>; + }; + combo_cancel_stickies_right { + timeout-ms = <25>; + key-positions = <14 15 16 17>; + layers = <1>; + bindings = <&kp F21>; + }; + combo_printscreen { + timeout-ms = <25>; + key-positions = <27 28>; + bindings = <&kp PSCRN>; + }; + }; +}; +#define SL(KEY) &nl KEY KEY +#define SK(KEY) &nk KEY KEY +#define SQ(KEY) &nq KEY KEY +#define BMG(KEY) &bm LGUI KEY +#define CAPSWORD &caps_word + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp J &kp W &kp M &kp G &kp P &kp F &kp U &kp Y + &kp A &kp R &kp S &kp T &kp V &kp B &kp N &kp E &kp I &kp O + BMG(Q) &kp L &kp C &kp D &kp H &kp Z &kp K BMG(X) + SL(NAV_L) &kp SPACE &kp BSPC SL(NUM_L) + >; + }; + + num_layer { + label = "Num"; + bindings = < + &kp N7 &kp N8 &kp N9 &kp ASTRK &trans CAPSWORD &trans &trans + &kp MINUS &kp N4 &kp N5 &kp N6 &kp SLASH &trans SQ(LSHFT) SK(LCTRL) SK(LALT) SK(LGUI) + &kp PLUS &kp N1 &kp N2 &kp N3 SQ(RSHFT) SK(RCTRL) SK(RALT) SK(RGUI) + < NAV_L DOT &kp N0 &trans &trans + >; + }; + + nav_layer { + label = "Nav"; + bindings = < + &trans &trans CAPSWORD &trans &kp PG_UP &kp HOME &kp UARW &kp END + SK(LGUI) SK(LALT) SK(LCTRL) SQ(LSHFT) &trans &kp PG_DN &kp LARW &kp DARW &kp RARW &kp LC(Z) + SK(RGUI) SK(RALT) SK(RCTRL) SQ(RSHFT) &kp ESC &kp TAB &kp RET &kp LS(INS) + &trans &trans &kp BSPC < NUM_L DEL + >; + }; + + }; +};