Skip to content

Instantly share code, notes, and snippets.

@vineethk
Created December 28, 2023 02:05
Show Gist options
  • Save vineethk/fd68f9c1230902323cd28a89ef850edb to your computer and use it in GitHub Desktop.
Save vineethk/fd68f9c1230902323cd28a89ef850edb to your computer and use it in GitHub Desktop.
Glove 80 Keymap
/*
* Copyright (c) 2020 The ZMK Contributors
* Copyright (c) 2023 Innaworks Development Limited, trading as MoErgo
*
* SPDX-License-Identifier: MIT
*/
/* THIS FILE WAS GENERATED BY GLOVE80 LAYOUT EDITOR
*
* This file was generated automatically. You may or may not want to
* edit it directly.
*/
#include <behaviors.dtsi>
/* Include all behaviour includes needed */
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
/* Automatically generated layer name #define */
#define LAYER_Base 0
#define LAYER_Numnav 1
#define LAYER_Magic 2
#define LAYER_Factory 3
#define LAYER_Symbol 4
#define LAYER_Function 5
#define LAYER_Macros 6
/* To deal with the situation where there is no Lower layer, to keep &lower happy */
#ifndef LAYER_Lower
#define LAYER_Lower 0
#endif
/* Custom Device-tree */
/* Glove80 system behavior & macros */
/ {
behaviors {
// For the "layer" key, it'd nice to be able to use it as either a shift or a toggle.
// Configure it as a tap dance, so the first tap (or hold) is a &mo and the second tap is a &to
lower: lower {
compatible = "zmk,behavior-tap-dance";
label = "LAYER_TAP_DANCE";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&mo LAYER_Lower>, <&to LAYER_Lower>;
};
};
};
/ {
macros {
rgb_ug_status_macro: rgb_ug_status_macro {
label = "RGB_UG_STATUS";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&rgb_ug RGB_STATUS>;
};
};
};
/ {
#ifdef BT_DISC_CMD
behaviors {
bt_0: bt_0 {
compatible = "zmk,behavior-tap-dance";
label = "BT_0";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_0>, <&bt BT_DISC 0>;
};
bt_1: bt_1 {
compatible = "zmk,behavior-tap-dance";
label = "BT_1";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_1>, <&bt BT_DISC 1>;
};
bt_2: bt_2 {
compatible = "zmk,behavior-tap-dance";
label = "BT_2";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_2>, <&bt BT_DISC 2>;
};
bt_3: bt_3 {
compatible = "zmk,behavior-tap-dance";
label = "BT_3";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&bt_select_3>, <&bt BT_DISC 3>;
};
};
macros {
bt_select_0: bt_select_0 {
label = "BT_SELECT_0";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 0>;
};
bt_select_1: bt_select_1 {
label = "BT_SELECT_1";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 1>;
};
bt_select_2: bt_select_2 {
label = "BT_SELECT_2";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 2>;
};
bt_select_3: bt_select_3 {
label = "BT_SELECT_3";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 3>;
};
};
#else
macros {
bt_0: bt_0 {
label = "BT_0";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 0>;
};
bt_1: bt_1 {
label = "BT_1";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 1>;
};
bt_2: bt_2 {
label = "BT_2";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 2>;
};
bt_3: bt_3 {
label = "BT_3";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&out OUT_BLE>,
<&bt BT_SEL 3>;
};
};
#endif
};
/ {
behaviors {
magic: magic {
compatible = "zmk,behavior-hold-tap";
label = "MAGIC_HOLD_TAP";
#binding-cells = <2>;
flavor = "tap-preferred";
tapping-term-ms = <200>;
bindings = <&mo>, <&rgb_ug_status_macro>;
};
};
};
/* #define for key positions */
#define POS_LH_T1 52
#define POS_LH_T2 53
#define POS_LH_T3 54
#define POS_LH_T4 69
#define POS_LH_T5 70
#define POS_LH_T6 71
#define POS_LH_C1R2 15
#define POS_LH_C1R3 27
#define POS_LH_C1R4 39
#define POS_LH_C1R5 51
#define POS_LH_C2R1 4
#define POS_LH_C2R2 14
#define POS_LH_C2R3 26
#define POS_LH_C2R4 38
#define POS_LH_C2R5 50
#define POS_LH_C2R6 68
#define POS_LH_C3R1 3
#define POS_LH_C3R2 13
#define POS_LH_C3R3 25
#define POS_LH_C3R4 37
#define POS_LH_C3R5 49
#define POS_LH_C3R6 67
#define POS_LH_C4R1 2
#define POS_LH_C4R2 12
#define POS_LH_C4R3 24
#define POS_LH_C4R4 36
#define POS_LH_C4R5 48
#define POS_LH_C4R6 66
#define POS_LH_C5R1 1
#define POS_LH_C5R2 11
#define POS_LH_C5R3 23
#define POS_LH_C5R4 35
#define POS_LH_C5R5 47
#define POS_LH_C5R6 65
#define POS_LH_C6R1 0
#define POS_LH_C6R2 10
#define POS_LH_C6R3 22
#define POS_LH_C6R4 34
#define POS_LH_C6R5 46
#define POS_LH_C6R6 64
#define POS_RH_T1 57
#define POS_RH_T2 56
#define POS_RH_T3 55
#define POS_RH_T4 74
#define POS_RH_T5 73
#define POS_RH_T6 72
#define POS_RH_C1R2 16
#define POS_RH_C1R3 28
#define POS_RH_C1R4 40
#define POS_RH_C1R5 58
#define POS_RH_C2R1 5
#define POS_RH_C2R2 17
#define POS_RH_C2R3 29
#define POS_RH_C2R4 41
#define POS_RH_C2R5 59
#define POS_RH_C2R6 75
#define POS_RH_C3R1 6
#define POS_RH_C3R2 18
#define POS_RH_C3R3 30
#define POS_RH_C3R4 42
#define POS_RH_C3R5 60
#define POS_RH_C3R6 76
#define POS_RH_C4R1 7
#define POS_RH_C4R2 19
#define POS_RH_C4R3 31
#define POS_RH_C4R4 43
#define POS_RH_C4R5 61
#define POS_RH_C4R6 77
#define POS_RH_C5R1 8
#define POS_RH_C5R2 20
#define POS_RH_C5R3 32
#define POS_RH_C5R4 44
#define POS_RH_C5R5 62
#define POS_RH_C5R6 78
#define POS_RH_C6R1 9
#define POS_RH_C6R2 21
#define POS_RH_C6R3 33
#define POS_RH_C6R4 45
#define POS_RH_C6R5 63
#define POS_RH_C6R6 79
/* Custom Defined Behaviors */
/ {
macros {
go_back: go_back {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &kp LCTRL>
, <&macro_tap &kp KP_MINUS>
, <&macro_release &kp LCTRL>
;
};
toggle_fold: toggle_fold {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &kp LGUI>
, <&macro_tap &kp K &kp L>
, <&macro_release &kp LGUI>
;
};
show_info: show_info {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &kp LGUI>
, <&macro_tap &kp K &kp I>
, <&macro_release &kp LGUI>
;
};
next_change: next_change {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &kp LALT>
, <&macro_tap &kp F5>
, <&macro_release &kp LALT>
;
};
expand_selection: expand_selection {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &kp LCTRL &kp LSHIFT>
, <&macro_tap &kp RIGHT_ARROW>
, <&macro_release &kp LCTRL &kp LSHIFT>
;
};
def_to_side: def_to_side {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_press &kp LGUI>
, <&macro_tap &kp K &kp F12>
, <&macro_release &kp LGUI>
;
};
};
behaviors {
bhm: homerow_mods {
compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS";
#binding-cells = <2>;
flavor = "balanced";
tapping-term-ms = <280>;
quick-tap-ms = <175>;
bindings = <&kp>, <&kp>;
};
comsemi: comma_semi {
compatible = "zmk,behavior-mod-morph";
label = "COMMA_SEMI";
#binding-cells = <0>;
bindings = <&kp COMMA>, <&kp SEMICOLON>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
dotcolon: dot_colon {
compatible = "zmk,behavior-mod-morph";
label = "DOT_COLON";
#binding-cells = <0>;
bindings = <&kp KP_DOT>, <&kp COLON>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
};
};
/* Automatically generated keymap */
/ {
keymap {
compatible = "zmk,keymap";
layer_Base {
bindings = <
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10
&kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
&kp TAB &kp Q &kp W &kp D &kp F &kp K &kp Y &kp U &kp I &kp L &kp ESC &kp BSLH
&kp ESC &bhm LCTRL A &bhm LALT S &bhm LGUI T &bhm LSHIFT R &kp G &kp H &bhm RSHIFT N &bhm LGUI E &bhm RALT O &bhm RCTRL P &kp SQT
&kp GRAVE &kp Z &kp X &kp C &kp V &kp B &mo 1 &mo 5 &to 0 &kp LGUI &mo 6 &mo 4 &kp J &kp M &comsemi &dotcolon &caps_word &kp PG_UP
&magic LAYER_Magic 0 &kp HOME &kp END &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp LALT &kp RALT &kp RET &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &kp PG_DN
>;
};
layer_Numnav {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &kp PG_UP &kp UP &kp PG_DN &kp F11 &none &kp KP_N7 &kp KP_N8 &kp KP_N9 &none &none
&caps_word &caps_word &kp LEFT_ARROW &kp DOWN_ARROW &kp RIGHT_ARROW &kp F12 &kp KP_N0 &kp KP_N4 &kp KP_N5 &kp KP_N6 &none &none
&trans &none &kp HOME &none &kp END &kp TAB &trans &trans &to 0 &trans &trans &trans &none &kp KP_N1 &kp KP_N2 &kp KP_N3 &none &none
&magic LAYER_Magic 0 &kp CAPS &none &none &none &trans &trans &trans &trans &trans &trans &none &none &none &none &none
>;
};
layer_Magic {
bindings = <
&bt BT_CLR &none &none &none &none &none &none &none &none &bt BT_CLR_ALL
&none &none &none &none &none &none &none &none &none &none &none &none
&none &rgb_ug RGB_SPI &rgb_ug RGB_SAI &rgb_ug RGB_HUI &rgb_ug RGB_BRI &rgb_ug RGB_TOG &none &none &none &none &none &none
&bootloader &rgb_ug RGB_SPD &rgb_ug RGB_SAD &rgb_ug RGB_HUD &rgb_ug RGB_BRD &rgb_ug RGB_EFF &none &none &none &none &none &bootloader
&sys_reset &none &none &none &none &none &bt_2 &bt_3 &none &none &none &none &none &none &none &none &none &sys_reset
&none &none &none &none &none &bt_0 &bt_1 &out OUT_USB &none &none &none &none &none &none &none &to 3
>;
};
layer_Factory {
bindings = <
&kp NUMBER_0 &kp NUMBER_6 &kp NUMBER_2 &kp NUMBER_8 &kp NUMBER_4 &kp NUMBER_4 &kp NUMBER_8 &kp NUMBER_2 &kp NUMBER_6 &kp NUMBER_0
&kp NUMBER_1 &kp NUMBER_7 &kp NUMBER_3 &kp NUMBER_9 &kp NUMBER_5 &kp NUMBER_0 &kp NUMBER_0 &kp NUMBER_5 &kp NUMBER_9 &kp NUMBER_3 &kp NUMBER_7 &kp NUMBER_1
&kp NUMBER_2 &kp NUMBER_8 &kp NUMBER_4 &kp NUMBER_0 &kp NUMBER_6 &kp NUMBER_1 &kp NUMBER_1 &kp NUMBER_6 &kp NUMBER_0 &kp NUMBER_4 &kp NUMBER_8 &kp NUMBER_2
&kp NUMBER_3 &kp NUMBER_9 &kp NUMBER_5 &kp NUMBER_1 &kp NUMBER_7 &kp NUMBER_2 &kp NUMBER_2 &kp NUMBER_7 &kp NUMBER_1 &kp NUMBER_5 &kp NUMBER_9 &kp NUMBER_3
&kp NUMBER_4 &kp NUMBER_0 &kp NUMBER_6 &kp NUMBER_2 &kp NUMBER_8 &kp NUMBER_3 &kp NUMBER_4 &kp NUMBER_5 &kp NUMBER_6 &kp NUMBER_6 &kp NUMBER_5 &kp NUMBER_4 &kp NUMBER_3 &kp NUMBER_8 &kp NUMBER_2 &kp NUMBER_6 &kp NUMBER_0 &kp NUMBER_4
&kp NUMBER_5 &kp NUMBER_1 &kp NUMBER_7 &kp NUMBER_3 &kp NUMBER_9 &kp NUMBER_7 &kp NUMBER_8 &kp NUMBER_9 &kp NUMBER_9 &kp NUMBER_8 &kp NUMBER_7 &kp NUMBER_9 &kp NUMBER_3 &kp NUMBER_7 &kp NUMBER_1 &kp NUMBER_5
>;
};
layer_Symbol {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &kp GRAVE &kp SQT &kp DQT &kp TILDE &kp FSLH &kp PLUS &kp MINUS &kp STAR &none &none
&caps_word &kp LT &kp LBKT &kp LBRC &kp LPAR &kp EQUAL &kp PIPE &kp RPAR &kp RBRC &kp RBKT &kp GT &none
&none &kp PRCNT &kp AT &kp HASH &kp QMARK &kp EXCL &trans &trans &trans &trans &trans &trans &kp BSLH &kp AMPS &kp UNDER &kp DLLR &kp CARET &none
&trans &none &none &none &none &trans &trans &trans &trans &trans &trans &none &none &none &none &none
>;
};
layer_Function {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &kp F12 &kp F7 &kp F8 &kp F9 &trans &trans
&trans &trans &trans &trans &trans &trans &kp F11 &kp F4 &kp F5 &kp F6 &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp F10 &kp F1 &kp F2 &kp F3 &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
layer_Macros {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &expand_selection &toggle_fold &trans &trans &trans &trans &trans &trans &trans
&trans &trans &go_back &show_info &next_change &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &def_to_side &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment