@ -1,23 +1,20 @@
# include "ergodox .h"
# include "ergodox _ez .h"
# include "led.h"
# include "led.h"
# include "debug.h"
# include "debug.h"
# include "action_layer.h"
# include "action_layer.h"
# include "action_util.h"
# include "action_util.h"
# include "mousekey.h"
# define BASE 0 // default layer
# define BASE 0 // default layer
# define SYMB 1 // symbols layer
# define SYMB 1 // symbols layer
# define MDIA 2 // media layer
# define MDIA 2 // media layer
# define SPEC 3 // special layer
# define SPEC 3 // special layer
# define LCaps 10 // left caps-shift key
# define LSymb 10 // left symbol-shift key
# define LSymb 11 // left symbol-shift key
# define LMdia 11 // left media-shift key
# define LMdia 12 // left media-shift key
# define LSpec 12 // left special-shift key
# define LSpec 13 // left special-shift key
# define RSymb 13 // right symbol-shift key
# define RCaps 14 // right caps-shift key
# define RMdia 14 // right media-shift key
# define RSymb 15 // right symbol-shift key
# define RSpec 15 // right special-shift key
# define RMdia 16 // right media-shift key
# define RSpec 17 // right special-shift key
# define MUL 20 // mouse up left
# define MUL 20 // mouse up left
# define MUR 21 // mouse up right
# define MUR 21 // mouse up right
@ -25,13 +22,14 @@
# define MDR 23 // mouse down right
# define MDR 23 // mouse down right
/*
/*
* The Ordinary Layout for the Ergodox EZ keyboard , v4
* The Ordinary Layout for the Ergodox EZ keyboard , v4 .20
*
*
* Modifications from default by Nicholas Keene ergodoxez @ nicholaskeene . com
* Modifications from default by Nicholas Keene ergodoxez @ nicholaskeene . com
*
*
* No rights reserved . This software is in the public domain .
* No rights reserved . This software is in the public domain .
* Credit me if you are friendly but if you ' re a jerk don ' t bother .
* Credit me if you are friendly but if you ' re a jerk don ' t bother .
*
* If you use or modify this layout I would love to hear from you .
*
* Details : readme . md
* Details : readme . md
* https : //github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary
* https : //github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary
*/
*/
@ -61,10 +59,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
*/
[ BASE ] = KEYMAP (
[ BASE ] = KEYMAP (
// left hand
// left hand
F ( LSpec ) , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_ESC
F ( LSpec ) , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_ESC
, F ( LMdia ) , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_LBRC
, F ( LMdia ) , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_LBRC
, M ( LSymb ) , KC_A , KC_S , KC_D , KC_F , KC_G
, M ( LSymb ) , KC_A , KC_S , KC_D , KC_F , KC_G
, M ( LCaps ) , KC_Z , KC_X , KC_C , KC_V , KC_B , LSFT ( KC_TAB )
, KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , LSFT ( KC_TAB )
, KC_LCTL , KC_MEH , KC_HYPR , KC_LALT , KC_LGUI
, KC_LCTL , KC_MEH , KC_HYPR , KC_LALT , KC_LGUI
, KC_HOME , KC_END
, KC_HOME , KC_END
, KC_PGUP
, KC_PGUP
@ -73,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
, KC_MINS , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , F ( RSpec )
, KC_MINS , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , F ( RSpec )
, KC_RBRC , KC_Y , KC_U , KC_I , KC_O , KC_P , F ( RMdia )
, KC_RBRC , KC_Y , KC_U , KC_I , KC_O , KC_P , F ( RMdia )
, KC_H , KC_J , KC_K , KC_L , KC_SCLN , F ( RSymb )
, KC_H , KC_J , KC_K , KC_L , KC_SCLN , F ( RSymb )
, KC_TAB , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , M ( RCaps )
, KC_TAB , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT
, KC_RGUI , KC_RALT , KC_HYPR , KC_MEH , KC_RCTL
, KC_RGUI , KC_RALT , KC_HYPR , KC_MEH , KC_RCTL
, KC_LEFT , KC_RGHT
, KC_LEFT , KC_RGHT
, KC_UP
, KC_UP
@ -91,8 +89,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - | Tab | | Shift | - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - |
* | - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - | Tab | | Shift | - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - |
* | | % | ^ | [ | ] | ~ | | | - Tab | \ | 1 | 2 | 3 | - | |
* | | % | ^ | [ | ] | ~ | | | - Tab | \ | 1 | 2 | 3 | - | |
* ` - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - '
* ` - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - '
* | LCtrl | Meh | Hyper | LAlt | LGui | | RGui / 0 | RAlt / . | Hypr / = | Meh / + | RCtrl / Ent |
* | LCtrl | Meh | Hyper | LAlt | LGui | | 0 | . | = | + | Ent |
* ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
* ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
* , - - - - - - - - - - - - - . , - - - - - - - - - - - - - .
* , - - - - - - - - - - - - - . , - - - - - - - - - - - - - .
* | Left | Right | | Home | End |
* | Left | Right | | Home | End |
* , - - - - - - | - - - - - - | - - - - - - | | - - - - - - + - - - - - - + - - - - - - .
* , - - - - - - | - - - - - - | - - - - - - | | - - - - - - + - - - - - - + - - - - - - .
@ -105,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// left hand
// left hand
KC_TRNS , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_ESC
KC_TRNS , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_ESC
, KC_TRNS , KC_EXLM , KC_AT , KC_LCBR , KC_RCBR , KC_AMPR , LSFT ( KC_COMM )
, KC_TRNS , KC_EXLM , KC_AT , KC_LCBR , KC_RCBR , KC_AMPR , LSFT ( KC_COMM )
, KC_TRNS , KC_HASH , KC_DLR , KC_LPRN , KC_RPRN , KC_GRV
, KC_TRNS , KC_HASH , KC_DLR , KC_LPRN , KC_RPRN , KC_GRV
, KC_TRNS , KC_PERC , KC_CIRC , KC_LBRC , KC_RBRC , KC_TILD , KC_TAB
, KC_TRNS , KC_PERC , KC_CIRC , KC_LBRC , KC_RBRC , KC_TILD , KC_TAB
, KC_LCTL , KC_MEH , KC_HYPR , KC_LALT , KC_LGUI
, KC_LCTL , KC_MEH , KC_HYPR , KC_LALT , KC_LGUI
, KC_LEFT , KC_RGHT
, KC_LEFT , KC_RGHT
@ -116,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
, LSFT ( KC_DOT ) , KC_PIPE , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_TRNS
, LSFT ( KC_DOT ) , KC_PIPE , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_TRNS
, KC_SLSH , KC_4 , KC_5 , KC_6 , KC_ASTR , KC_TRNS
, KC_SLSH , KC_4 , KC_5 , KC_6 , KC_ASTR , KC_TRNS
, LSFT ( KC_TAB ) , KC_BSLS , KC_1 , KC_2 , KC_3 , KC_MINS , KC_TRNS
, LSFT ( KC_TAB ) , KC_BSLS , KC_1 , KC_2 , KC_3 , KC_MINS , KC_TRNS
, GUI_T ( KC_0 ) , ALT_T ( KC_DOT ) , ALL_T ( KC_EQL ) , MEH_T ( KC_PLUS ) , CTL_T ( KC_ENT )
, KC_0 , KC_DOT , KC_EQL , KC_PLUS , KC_ENT
, KC_HOME , KC_END
, KC_HOME , KC_END
, KC_PGUP
, KC_PGUP
, KC_PGDN , KC_BSPC , KC_DEL
, KC_PGDN , KC_BSPC , KC_DEL
@ -124,24 +122,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/******* Media Layer *******************************************************************************************************
/******* Media Layer *******************************************************************************************************
*
*
* , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
* , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
* | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | |
* | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | |
* | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - - - - - - - - | | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - |
* | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - - - - - - - - | | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - |
* | | Shut Down | MouseUpLf | Mouse Up | MouseUpRg | Volume Up | Scroll | | Scroll | PrintScrn | Home | Up | PgUp | Mail | |
* | | Shut Down | MouseUpLf | Mouse Up | MouseUpRg | Volume Up | Scroll | | Scroll | PrintScrn | Home | Up | PgUp | Mail | |
* | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - | Up | | Up | - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - |
* | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - | Up | | Up | - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - |
* | | Sleep | MouseLeft | MouseDown | MouseRght | Volume Dn | - - - - - - | | - - - - - - | Num Lock | Left | Down | Right | MyComp | |
* | | Sleep | MouseLeft | MouseDown | MouseRght | Volume Dn | - - - - - - | | - - - - - - | Num Lock | Left | Down | Right | MyComp | |
* | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - | Scroll | | Scroll | - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - |
* | - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - | Scroll | | Scroll | - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - |
* | | | MouseDnLf | MouseDown | MouseDnRg | Mute | Down | | Down | | End | Down | PgDn | | |
* | | | MouseDnLf | MouseDown | MouseDnRg | Mute | Down | | Down | | End | Down | PgDn | | |
* ` - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - '
* ` - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - - - - + - - - - - - '
* | LCtrl | Meh | MClick | LClick | R Click | | Cmd / Insrt | Optn / Del | Hyper | Meh | RCtrl |
* | LCtrl | Meh | MClick | LClick | R Click | | Cmd / Insrt | Optn / Del | Hyper | Meh | RCtrl |
* ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
* ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
* , - - - - - - - - - - - - - . , - - - - - - - - - - - - - .
* , - - - - - - - - - - - - - . , - - - - - - - - - - - - - .
* | Stop | Refrsh | | Prev | Next |
* | Stop | Refrsh | | Prev | Next |
* , - - - - - - | - - - - - - | - - - - - - | | - - - - - - + - - - - - - + - - - - - - .
* , - - - - - - | - - - - - - | - - - - - - | | - - - - - - + - - - - - - + - - - - - - .
* | Brwser | Brwser | Search | | VolUp | | |
* | Brwser | Brwser | Search | | VolUp | | |
* | Back | Fwd | - - - - - - | | - - - - - - | Stop | Play - |
* | Back | Fwd | - - - - - - | | - - - - - - | Stop | Play - |
* | | | Home | | VolDn | | Pause |
* | | | Home | | VolDn | | Pause |
* ` - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - '
* ` - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - '
*/
*/
[ MDIA ] = KEYMAP (
[ MDIA ] = KEYMAP (
// left hand
// left hand
@ -166,67 +164,63 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/******* Special Layer *****************************************************************************************************
/******* Special Layer *****************************************************************************************************
*
*
* , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
* , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
* | | Esc | | | | | | | | | | | | Bspc | |
* | | Esc | | | | | | | | | | | - | Bspc | |
* | - - - - - - - - - - - +- - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - | | - - - - - - + - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - |
* | - - - - - - - - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - | | - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - |
* | | | | | | | | | | | | | | | |
* | Media Lock | | | | | | | | | | | | [ | ] | Media Lock |
* | - - - - - - - - - - - +- - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - | | | | - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - |
* | - - - - - - - - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - | | | | - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - |
* | | | | | | | - - - - - - | | - - - - - - | | | | | | |
* | Symbol Lock | | | | | | - - - - - - | | - - - - - - | | | | | | Symbol Lock |
* | - - - - - - - - - - - +- - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - | | | | - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - |
* | - - - - - - - - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - | | | | - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - |
* | | | | | | | | | | | | | | | RShift |
* | Caps Lock | | | | | | | | | | | | | | Caps Lock |
* ` - - - - - - - - - - - +- - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - ' ` - - - - - - - - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - '
* ` - - - - - - - - - - - -- + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - + - - - - - - - - - - - - - '
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
* ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
* , - - - - - - - - - - - - - . , - - - - - - - - - - - - - .
* , - - - - - - - - - - - - - . , - - - - - - - - - - - - - .
* | | | | | |
* | | | | | |
* , - - - - - - | - - - - - - | - - - - - - | | - - - - - - + - - - - - - + - - - - - - .
* , - - - - - - | - - - - - - | - - - - - - | | - - - - - - + - - - - - - + - - - - - - .
* | | | | | | | |
* | | | | | | | |
* | | | - - - - - - | | - - - - - - | | |
* | | | - - - - - - | | - - - - - - | | |
* | | | | | | | |
* | | | | | | | |
* ` - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - '
* ` - - - - - - - - - - - - - - - - - - - - ' ` - - - - - - - - - - - - - - - - - - - - '
*/
*/
[ SPEC ] = KEYMAP (
[ SPEC ] = KEYMAP (
// left hand
// left hand
KC_TRNS , KC_ESC , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
KC_TRNS , KC_ESC , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_ TRN S , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_ CAP S , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS
, KC_TRNS
, KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS
// right hand
// right hand
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_BSPC , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_MINS , KC_BSPC , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_LBRC , KC_RBRC , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_RSFT
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_CAPS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS
, KC_TRNS
, KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS
, KC_TRNS , KC_TRNS , KC_TRNS
)
)
} ;
} ;
const uint16_t PROGMEM fn_actions [ ] = {
const uint16_t PROGMEM fn_actions [ ] = {
// the faux shift keys are implemented as macro taps
// the faux shift keys are implemented as macro taps
[ LCaps ] = ACTION_MACRO_TAP ( LCaps )
[ LSymb ] = ACTION_MACRO_TAP ( LSymb )
, [ LSymb ] = ACTION_MACRO_TAP ( LSymb )
, [ LMdia ] = ACTION_MACRO_TAP ( LMdia )
, [ LMdia ] = ACTION_MACRO_TAP ( LMdia )
, [ LSpec ] = ACTION_MACRO_TAP ( LSpec )
, [ LSpec ] = ACTION_MACRO_TAP ( LSpec )
, [ RCaps ] = ACTION_MACRO_TAP ( RCaps )
, [ RSymb ] = ACTION_MACRO_TAP ( RSymb )
, [ RSymb ] = ACTION_MACRO_TAP ( RSymb )
, [ RMdia ] = ACTION_MACRO_TAP ( RMdia )
, [ RMdia ] = ACTION_MACRO_TAP ( RMdia )
, [ RSpec ] = ACTION_MACRO_TAP ( RSpec )
, [ RSpec ] = ACTION_MACRO_TAP ( RSpec )
} ;
} ;
uint16_t caps_shift = 0 ;
uint16_t symb_shift = 0 ;
uint16_t symb_shift = 0 ;
uint16_t mdia_shift = 0 ;
uint16_t mdia_shift = 0 ;
uint16_t spec_shift = 0 ;
bool symb_lock = false ;
bool mdia_lock = false ;
bool mdia_lock = false ;
bool symb_lock = false ;
const macro_t * action_get_macro ( keyrecord_t * record , uint8_t id , uint8_t opt )
const macro_t * action_get_macro ( keyrecord_t * record , uint8_t id , uint8_t opt )
{
{
@ -237,50 +231,28 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
// only because sometimes rapid pressing led to irregular events; this way the states
// only because sometimes rapid pressing led to irregular events; this way the states
// are self healing during use.
// are self healing during use.
case LCaps : // both caps-shift keys trigger Left Shift
case LSymb : //
case RCaps : // so they don't interfere with the magic combo
if ( record - > event . pressed ) { // when the LSymb button is pressed
if ( record - > event . pressed & & ! record - > tap . count ) {
if ( + + symb_shift > 2 ) mdia_shift = 2 ; // increment the symb shift count, max two
if ( + + caps_shift > 2 ) caps_shift = 2 ;
if ( spec_shift ) symb_lock = ! symb_lock ; // if the Special layer is on, toggle the shift lock
if ( caps_shift = = 2 ) {
layer_on ( SYMB ) ; // in any case, turn on the Symbols layer
register_code ( KC_CAPS ) ;
} else { // when the LSymb button is released
unregister_code ( KC_CAPS ) ;
if ( - - symb_shift < 0 ) symb_shift = 0 ; // decrement the shift count, minimum zero
} else if ( caps_shift = = 1 ) {
if ( ( ! symb_shift ) & & ( ! symb_lock ) ) layer_off ( SYMB ) ; // if both shifts are released and the lock is off, turn off the Symbols layer
register_code ( KC_LSFT ) ;
}
} else {
if ( - - caps_shift < 0 ) caps_shift = 0 ;
if ( caps_shift = = 0 ) unregister_code ( KC_LSFT ) ;
}
break ;
case LSymb :
if ( record - > event . pressed ) {
if ( + + symb_shift > 2 ) symb_shift = 2 ;
if ( symb_shift = = 2 ) {
symb_lock = ! symb_lock ;
} else if ( symb_shift = = 1 ) {
layer_on ( SYMB ) ;
}
} else {
if ( - - symb_shift < 0 ) symb_shift = 0 ;
if ( ( symb_shift = = 0 ) & & ( ! symb_lock ) ) layer_off ( SYMB ) ;
}
}
break ;
break ;
case LMdia :
case LMdia :
if ( record - > event . pressed ) {
if ( record - > event . pressed ) {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) ) {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) & & ( ! spec_shift ) ) {
register_code ( KC_TAB ) ;
register_code ( KC_TAB ) ;
} else {
} else {
if ( spec_shift ) mdia_lock = ! mdia_lock ;
if ( + + mdia_shift > 2 ) mdia_shift = 2 ;
if ( + + mdia_shift > 2 ) mdia_shift = 2 ;
if ( mdia_shift = = 2 ) {
layer_on ( MDIA ) ;
mdia_lock = ! mdia_lock ;
} else if ( mdia_shift = = 1 ) {
layer_on ( MDIA ) ;
}
}
}
} else {
} else {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) ) {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) & & ( ! spec_shift ) ) {
unregister_code ( KC_TAB ) ;
unregister_code ( KC_TAB ) ;
} else {
} else {
if ( - - mdia_shift < 0 ) mdia_shift = 0 ;
if ( - - mdia_shift < 0 ) mdia_shift = 0 ;
@ -290,35 +262,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break ;
break ;
case LSpec :
case LSpec :
if ( record - > event . pressed ) {
if ( record - > event . pressed ) { // when the LSpec button is pressed
if ( record - > tap . count & & ! record - > tap . interrupted ) {
if ( symb_shift ) symb_lock = = ! symb_lock ; // if another layer button is engaged, then
register_code ( KC_GRV ) ;
else if ( mdia_shift ) mdia_lock = ! mdia_lock ; // lock that layer, be it caps or symb or mdia
else if ( record - > tap . count & & ! record - > tap . interrupted & & ( ! spec_shift ) ) {
register_code ( KC_GRV ) ; // otherwise, if it's an uninterrupted tap, emit a char
} else {
} else {
layer_on ( SPEC ) ;
if ( + + spec_shift > 2 ) spec_shift = 2 ;
layer_on ( SPEC ) ; // otherwise, turn on the Special layer
}
}
} else {
} else {
if ( record - > tap . count & & ! record - > tap . interrupted ) {
if ( record - > tap . count & & ! record - > tap . interrupted & & ( ! spec_shift ) ) {
unregister_code ( KC_GRV ) ;
unregister_code ( KC_GRV ) ;
} else {
} else {
layer_off ( SPEC ) ;
if ( - - spec_shift < 0 ) spec_shift = 0 ;
if ( ! spec_shift ) layer_off ( SPEC ) ;
}
}
}
}
break ;
break ;
case RSymb :
case RSymb :
if ( record - > event . pressed ) {
if ( record - > event . pressed ) {
if ( record - > tap . count & & ( ! symb_shift ) & & ( ! symb_lock ) ) {
if ( record - > tap . count & & ( ! symb_shift ) & & ( ! symb_lock ) & & ( ! spec_shift ) ) {
register_code ( KC_QUOT ) ;
register_code ( KC_QUOT ) ;
} else {
} else {
if ( + + symb_shift > 2 ) symb_shift = 2 ;
if ( + + symb_shift > 2 ) symb_shift = 2 ;
if ( symb_shift = = 2 ) {
if ( spec_shift ) symb_lock = ! symb_lock ;
symb_lock = ! symb_lock ;
layer_on ( SYMB ) ;
} else if ( symb_shift = = 1 ) {
layer_on ( SYMB ) ;
}
}
}
} else {
} else {
if ( record - > tap . count & & symb_shift = = 0 ) {
if ( record - > tap . count & & ( ! symb_shift ) & & ( ! symb_lock ) & & ( ! spec_shift ) ) {
unregister_code ( KC_QUOT ) ;
unregister_code ( KC_QUOT ) ;
} else {
} else {
if ( - - symb_shift < 0 ) symb_shift = 0 ;
if ( - - symb_shift < 0 ) symb_shift = 0 ;
@ -329,18 +302,15 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case RMdia :
case RMdia :
if ( record - > event . pressed ) {
if ( record - > event . pressed ) {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) ) {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) & & ( ! spec_shift ) ) {
register_code ( KC_BSLS ) ;
register_code ( KC_BSLS ) ;
} else {
} else {
if ( + + mdia_shift > 2 ) mdia_shift = 2 ;
if ( + + mdia_shift > 2 ) mdia_shift = 2 ;
if ( mdia_shift = = 2 ) {
if ( spec_shift ) mdia_lock = ! mdia_lock ;
mdia_lock = ! mdia_lock ;
layer_on ( MDIA ) ;
} else if ( mdia_shift = = 1 ) {
layer_on ( MDIA ) ;
}
}
}
} else {
} else {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) ) {
if ( record - > tap . count & & ( ! mdia_shift ) & & ( ! mdia_lock ) & & ( ! spec_shift ) ) {
unregister_code ( KC_BSLS ) ;
unregister_code ( KC_BSLS ) ;
} else {
} else {
if ( - - mdia_shift < 0 ) mdia_shift = 0 ;
if ( - - mdia_shift < 0 ) mdia_shift = 0 ;
@ -351,16 +321,20 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case RSpec :
case RSpec :
if ( record - > event . pressed ) {
if ( record - > event . pressed ) {
if ( record - > tap . count & & ! record - > tap . interrupted ) {
if ( symb_shift ) symb_lock = ! symb_lock ;
else if ( mdia_shift ) mdia_lock = ! mdia_lock ;
else if ( record - > tap . count & & ! record - > tap . interrupted & & ( ! spec_shift ) ) {
register_code ( KC_EQL ) ;
register_code ( KC_EQL ) ;
} else {
} else {
if ( + + spec_shift > 2 ) spec_shift = 2 ;
layer_on ( SPEC ) ;
layer_on ( SPEC ) ;
}
}
} else {
} else {
if ( record - > tap . count & & ! record - > tap . interrupted ) {
if ( record - > tap . count & & ! record - > tap . interrupted & & ( ! spec_shift ) ) {
unregister_code ( KC_EQL ) ;
unregister_code ( KC_EQL ) ;
} else {
} else {
layer_off ( SPEC ) ;
if ( - - spec_shift < 0 ) spec_shift = 0 ;
if ( ! spec_shift ) layer_off ( SPEC ) ;
}
}
}
}
break ;
break ;
@ -419,7 +393,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
// none
// none
break ;
break ;
}
}
return MACRO_NONE ;
return MACRO_NONE ;
} ;
} ;
@ -431,7 +405,9 @@ void matrix_init_user(void) {
// Runs constantly in the background, in a loop.
// Runs constantly in the background, in a loop.
void matrix_scan_user ( void ) {
void matrix_scan_user ( void ) {
// shift or caps lock turns on red light
// shift or caps lock turns on red light
if ( caps_shift | | ( keyboard_report - > mods & MOD_BIT ( KC_RSFT ) ) | | ( host_keyboard_leds ( ) & ( 1 < < USB_LED_CAPS_LOCK ) ) ) {
if ( ( keyboard_report - > mods & MOD_BIT ( KC_LSFT ) )
| | ( keyboard_report - > mods & MOD_BIT ( KC_RSFT ) )
| | ( host_keyboard_leds ( ) & ( 1 < < USB_LED_CAPS_LOCK ) ) ) {
ergodox_right_led_1_on ( ) ;
ergodox_right_led_1_on ( ) ;
} else {
} else {
ergodox_right_led_1_off ( ) ;
ergodox_right_led_1_off ( ) ;
@ -451,4 +427,3 @@ void matrix_scan_user(void) {
ergodox_right_led_3_off ( ) ;
ergodox_right_led_3_off ( ) ;
}
}
} ;
} ;