Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions include/aekeynox/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
* LT[1-3], RT[1-3]: keys on the left/right thumb clusters (usually Space or modifiers/layers)
*/

// This macro concatenates Selenium keymap bindings so they can be used by ZMK:
// This macro concatenates Selenium keymap bindings so they can be used by ZMK,
// it can be overridden in /config/*.keymap for keyboards with more or less than 42 keys:
#ifndef SELENIUM_KEYMAP_BINDINGS
#define SELENIUM_KEYMAP_BINDINGS(LOUT1, LROW1, RROW1, ROUT1, \
LOUT2, LROW2, RROW2, ROUT2, \
Expand All @@ -25,4 +26,15 @@
LT1 LT2 LT3 RT3 RT2 RT1
#endif

// This macro can be overridden in /config/*.keymap for keyboards with more or less than 42 keys.

#define SELENIUM_LAYER_COMPOSE_(LROW1, LROW2, LROW3, RROW1, RROW2, RROW3, \
LT1, LT2, LT3, RT3, RT2, RT1) \
SELENIUM_KEYMAP_BINDINGS(&trans, LROW1, RROW1, &trans, \
&trans, LROW2, RROW2, &trans, \
&trans, LROW3, RROW3, &trans, \
LT1, LT2, LT3, RT3, RT2, RT1)

// This macro allows us to build a full layer frow two half layers
#define SELENIUM_LAYER_COMPOSE(...) SELENIUM_LAYER_COMPOSE_(__VA_ARGS__)


38 changes: 38 additions & 0 deletions include/aekeynox/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,41 @@
#else
#define OMIT_IF_NO_REF
#endif

// Half-layers

#ifndef NAV_LEFT
#define NAV_LEFT HL_ARROWS_ESDF
#endif

#ifndef NAV_RIGHT
#define NAV_RIGHT HL_NUMPAD
#endif

#ifndef FN_LEFT
#define FN_LEFT HL_FUN_PAD
#endif

#ifndef FN_RIGHT
#define FN_RIGHT HL_MEDIA
#endif

#ifndef L_LAYER_1
#define L_LAYER_1 NAV_LAYER
#endif

#ifndef R_LAYER_1
#define R_LAYER_1 NAV_LAYER
#endif

#ifndef L_LAYER_2
#define L_LAYER_2 FN_MEDIA_LAYER
#endif

#ifndef R_LAYER_2
#define R_LAYER_2 FN_MEDIA_LAYER
#endif

#ifndef NUM_LAYER
#define NUM_LAYER NAV_LAYER
#endif
48 changes: 48 additions & 0 deletions include/aekeynox/half_layers.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/******************************************************************************
* Left hand half layers
******************************************************************************/

#define HL_ARROWS_ESDF \
&kp ESC &kp HOME &kp UP &kp END &kp PG_UP , \
X_ALL &kp LEFT &kp DOWN &kp RIGHT &kp PG_DN , \
X_UNDO X_CUT X_COPY X_PASTE X_REDO

#define HL_CONTROL \
&none X_CTL_W X_PREV X_NEXT &none , \
X_ALL X_SAVE X_SHTAB &kp TAB &none , \
X_UNDO X_CUT X_COPY X_PASTE X_REDO

#define HL_FUN_PAD \
&kp F1 &kp F2 &kp F3 &kp F4 &none , \
&kp F5 &kp F6 &kp F7 &kp F8 &none , \
&kp F9 &kp F10 &kp F11 &kp F12 &none

#define HL_MIRROR \
&kp P &kp O &kp I &kp U &kp Y , \
HRM_SEMI HRM_L HRM_K HRM_J &kp H , \
&kp FSLH &kp DOT &kp COMMA &kp M &kp N

/******************************************************************************
* Right hand half layers
******************************************************************************/

#define HL_NUMPAD \
&to NUM_LOCK_LAYER S_N7 S_N8 S_N9 S_FSLH , \
S_MINUS S_N4 S_N5 S_N6 S_N0 , \
S_COMMA S_N1 S_N2 S_N3 S_DOT

#define HL_ARROWS_HJKL \
&kp HOME &kp PG_DN &kp PG_UP &kp END &kp DEL , \
&kp LEFT &kp DOWN &kp UP &kp RIGHT &none , \
&none &none &none &none &none

#define HL_ARROWS_IJKL \
&kp PG_UP &kp HOME &kp PG_UP &kp END &none , \
&kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &none , \
&none &none &none &none &none

#define HL_MEDIA \
&bt BT_SEL 2 &kp C_PREV &kp C_VOL_UP &kp C_BRI_UP &kp SLCK , \
&bt_sel1_clr H_J C_PP H_K C_MUTE H_L C_AL_LOCK H_SEMI PSCRN , \
&bt BT_SEL 0 &kp C_NEXT &kp C_VOL_DN &kp C_BRI_DN &kp INS

29 changes: 10 additions & 19 deletions include/aekeynox/hold_taps.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
#define BASE_LAYER 0
#define NUM_LOCK_LAYER 1
#define SYMBOLS_LAYER 2
#define VIM_NAV_LAYER 3
#define NAV_NUM_LAYER 4
#define NUM_ROW_LAYER 5
#define FN_MEDIA_LAYER 6
#define NAV_LAYER 3
#define NUM_ROW_LAYER 4
#define FN_MEDIA_LAYER 5

// Potentially used by other keymaps deriving from this one, who may add extra layers.
// Make sure this stays equal to <index_of_last_layer> + 1
#define EXTRA_LAYERS_START_INDEX 7
#define EXTRA_LAYERS_START_INDEX 6


/**
Expand Down Expand Up @@ -82,22 +81,14 @@
#define NAV_SC &sc
#endif

#ifdef VIM_NAVIGATION
#define NAV_LAYER VIM_NAV_LAYER
#define NUM_LAYER NUM_ROW_LAYER
#define HRM_LAYER NUM_ROW_LAYER
#define S34_LAYER NUM_ROW_LAYER
#ifdef ENABLE_QUICK_ESCAPE
#define REACH_TAP ESCAPE
#else
#define NAV_LAYER NAV_NUM_LAYER
#define NUM_LAYER NAV_NUM_LAYER
#define HRM_LAYER FN_MEDIA_LAYER
#define S34_LAYER NAV_NUM_LAYER
#define REACH_TAP TAB
#endif

#if defined HT_TWO_THUMB_KEYS && !defined VIM_NAVIGATION
#define SYM_NUM_LAYER &sc NAV_NUM_LAYER CAPSLOCK
#define SYM_NUM_LAYER &sc NAV_LAYER CAPSLOCK
#else
#define SYM_NUM_LAYER &EZ_SL(NUM_LAYER)
#endif
Expand All @@ -115,7 +106,7 @@
#define LTHUMB_HRM NAV_SC NAV_LAYER BACKSPACE
#define RTHUMB_HRM &lt NAV_LAYER SPACE
#define LTHUMB_S34 NAV_SC NAV_LAYER BACKSPACE
#define RTHUMB_S34 &lt S34_LAYER SPACE
#define RTHUMB_S34 &lt R_LAYER_1 SPACE
#endif

#ifdef HT_NONE
Expand All @@ -135,8 +126,8 @@
#elifdef HT_HOME_ROW_MODS
#define LTHUMB_TUCK &EZ_SK(LSHIFT)
#define LTHUMB_HOME LTHUMB_HRM
#define LTHUMB_REACH &sc HRM_LAYER REACH_TAP
#define RTHUMB_REACH &sc HRM_LAYER ENTER
#define LTHUMB_REACH &sc L_LAYER_2 REACH_TAP
#define RTHUMB_REACH &sc R_LAYER_2 ENTER
#define RTHUMB_HOME RTHUMB_HRM
#define RTHUMB_TUCK &sym_shift_altgr
#elifdef HT_TWO_THUMB_KEYS
Expand Down Expand Up @@ -248,7 +239,7 @@
OMIT_IF_NO_REF magic_backspace_34_keys: magic_backspace_34_keys {
compatible = "zmk,behavior-mod-morph";
#binding-cells = <0>;
bindings = <&sc HRM_LAYER BACKSPACE>, <&lt HRM_LAYER SPACE>;
bindings = <&sc R_LAYER_1 BACKSPACE>, <&lt R_LAYER_1 SPACE>;
mods = <MOD_LSFT>;
keep-mods = <MOD_LSFT>;
};
Expand Down
52 changes: 17 additions & 35 deletions include/aekeynox/selenium.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
#include "settings.h" // user settings
#endif

#include "defaults.h" // default options and safeguards
#include "aliases.h" // defines symbols and actions
#include "bindings.h" // default SELENIUM_KEYMAP_BINDINGS macro
#include "mappings.dtsi" // key mapping helpers and macros
#include "hold_taps.dtsi" // defines thumb keys and homerow mods
#include "defaults.h" // default options and safeguards
#include "aliases.h" // defines symbols and actions
#include "bindings.h" // default SELENIUM_KEYMAP_BINDINGS macro
#include "half_layers.dtsi" // half layers for Nav and Fn/media
#include "mappings.dtsi" // key mapping helpers and macros
#include "hold_taps.dtsi" // defines thumb keys and homerow mods

/**
* All keyboard layers are defined by blocks on a 42-key basis, as follows:
Expand Down Expand Up @@ -51,7 +52,7 @@
&trans , &kp ESC &kp HOME &kp UP &kp END &kp PG_UP , &to BASE_LAYER S_N7 S_N8 S_N9 S_FSLH , &trans ,
&trans , S_EQUAL &kp LEFT &kp DOWN &kp RIGHT &kp PG_DN , S_MINUS S_N4 S_N5 S_N6 S_N0 , &trans ,
&trans , S_MONEY S_COLON S_STAR S_PLUS S_PRCNT , S_COMMA S_N1 S_N2 S_N3 S_DOT , &trans ,
&trans , &sc NAV_NUM_LAYER BACKSPACE , &kp (TAB) , &trans , &lt NAV_NUM_LAYER LS(SPACE) , &EZ_SL(SYMBOLS_LAYER)
&trans , &sc NAV_LAYER BACKSPACE , &kp (TAB) , &trans , &lt NAV_LAYER LS(SPACE) , &EZ_SL(SYMBOLS_LAYER)
)>;
};

Expand All @@ -70,30 +71,14 @@
// 3. VimNav layer -- HJKL arrow cluster on the right hand
// -- best used along with the NumRow layer
// -- keyboard shortcuts on the left hand are adjusted to the OS layout (Ergol here)
vim_nav_layer: vim_nav_layer {
display-name = "VimNav";
bindings = <SELENIUM_KEYMAP_BINDINGS(
&trans , &none X_CTL_W &vim_prev &vim_next &none , &kp HOME &kp PG_DN &kp PG_UP &kp END &kp DEL , &trans ,
&trans , X_ALL X_SAVE X_SHTAB &kp TAB &none , &kp LEFT &kp DOWN &kp UP &kp RIGHT &none , &trans ,
&trans , X_UNDO X_CUT X_COPY X_PASTE X_REDO , &none &none &none &none &none , &trans ,
&kp CAPS , &sc FN_MEDIA_LAYER DEL , &mo NUM_ROW_LAYER , &trans , &mo FN_MEDIA_LAYER , &EZ_LSK(RALT)
navigation_layer: navigation_layer {
display-name = "Navigation";
bindings = <SELENIUM_LAYER_COMPOSE(NAV_LEFT, NAV_RIGHT,
NAV_LTHUMB_TUCK , &sc FN_MEDIA_LAYER DEL , &sc NUM_LAYER LS(TAB) , &sc NUM_LAYER ENTER , &lt FN_MEDIA_LAYER LS(SPACE) , &EZ_LSK(RALT)
)>;
};

// 4. NavNum layer -- inverted T arrow cluster on the left hand, numpad on the right hand
// -- can be the only extra layer you need if you're not too picky with number+symbols n-grams
// -- keyboard shortcuts on the left hand are adjusted to the OS layout (Ergol here)
nav_num_layer: nav_num_layer {
display-name = "NavNum";
bindings = <SELENIUM_KEYMAP_BINDINGS(
&trans , &kp ESC &kp HOME &kp UP &kp END &kp PG_UP , &to NUM_LOCK_LAYER S_N7 S_N8 S_N9 S_FSLH , &trans ,
&trans , X_ALL &kp LEFT &kp DOWN &kp RIGHT &kp PG_DN , S_MINUS S_N4 S_N5 S_N6 S_N0 , &trans ,
&trans , X_UNDO X_CUT X_COPY X_PASTE X_REDO , S_COMMA S_N1 S_N2 S_N3 S_DOT , &trans ,
NAV_LTHUMB_TUCK , &sc FN_MEDIA_LAYER DEL , NAV_LTHUMB_REACH , &kp ESCAPE , &lt FN_MEDIA_LAYER LS(SPACE) , &EZ_LSK(RALT)
)>;
};

// 5. NumRow layer -- bring the numbers to the homerow, keep shift+numbers for shortcuts and symbols
// 4. NumRow layer -- bring the numbers to the homerow, keep shift+numbers for shortcuts and symbols
// -- space becomes shift+space, which is a no-break space with some OS layouts (e.g. Ergol)
// -- best used along with the VimNav layer
num_row_layer: num_row_layer {
Expand All @@ -106,16 +91,13 @@
)>;
};

// 6. FnMedia layer -- F1..12 pad on the left hand, HRM on the right hand
// 5. FnMedia layer -- F1..12 pad on the left hand, HRM on the right hand
// -- reset and bootloader reset on difficult thumb keys
// -- could be completed with other rare keys
fn_media_layer: fn_media_layer {
display-name = "FnMedia";
bindings = <SELENIUM_KEYMAP_BINDINGS(
&trans , &kp F1 &kp F2 &kp F3 &kp F4 &none , &bt BT_SEL 2 &kp C_NEXT &kp C_VOL_UP &kp C_BRI_UP &kp SLCK , &trans ,
&trans , &kp F5 &kp F6 &kp F7 &kp F8 &none , &bt_sel1_clr H_J C_PP H_K C_MUTE H_L C_AL_LOCK H_SEMI PSCRN , &trans ,
&trans , &kp F9 &kp F10 &kp F11 &kp F12 &none , &bt BT_SEL 0 &kp C_PREV &kp C_VOL_DN &kp C_BRI_DN &kp INS , &trans ,
&trans , &bootloader , &trans , &trans , &sys_reset , &studio_unlock
function_layer: function_layer {
display-name = "Function";
bindings = <SELENIUM_LAYER_COMPOSE(FN_LEFT, FN_RIGHT,
&trans , &bootloader , &trans , &trans , &sys_reset , &studio_unlock
)>;
};

Expand Down
39 changes: 32 additions & 7 deletions include/aekeynox/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,35 @@


/******************************************************************************
* Other Options
* Half layers selection
*****************************************************************************/

// Uncomment the following line to split the NavNum layer in two:
// - one layer for vim-style navigation (right) and GUI shortcuts (left)
// - one layer for a full number row + easy access to Shift+Number
// + Escape under the left thumb (direct access)
// Highly recommended for Vim users, obviously. :-)
// Uncomment some of the following lines to customise the definitions of the
// Navigation or Function layers. They are composed from two independant half
// layers that you may pick and choose however you want.

// #define NAV_LEFT HL_ARROWS_ESDF
// #define NAV_RIGHT HL_NUMPAD
// #define FN_LEFT HL_FUN_PAD
// #define FN_RIGHT HL_MEDIA

// Uncomment some of the following lines to customise which layer the thumb
// keys of the base layer will send you to.

// #define VIM_NAVIGATION
// #define L_LAYER_1 NAV_LAYER
// #define L_LAYER_2 NAV_LAYER
// #define R_LAYER_1 FN_MEDIA_LAYER
// #define R_LAYER_2 FN_MEDIA_LAYER

// Uncomment the following line to specify which layer contains the numbers,
// so that transitions from the Navigation or Symbols layers work as expected.
// XXX: Needs a better name

// #define NUM_LAYER NAV_LAYER

/******************************************************************************
* Other Options
*****************************************************************************/

// [Experimental]
// Uncomment the following line to enable the "mod-hold behavior" on the left
Expand All @@ -121,3 +140,9 @@
// Beware: this increases the typing load of the left thumb.

// #define LEFT_HAND_SPACE

// Swaps Tab for Escape on the base layer’s left-reach thumb key.
// Highly recommended for Vim users and users of the `HL_CONTROL` half layer,
// as it has quick access to Tab and Shift+Tab.

// #define ENABLE_QUICK_ESCAPE