Skip to content

Instantly share code, notes, and snippets.

@v6ak
Last active May 14, 2019
Embed
What would you like to do?
Attempt to create an one-handed layout for Ergodox
#define MIRRORED( \
\
/* left hand, spatial positions */ \
k00,k01,k02,k03,k04,k05,k06, \
k10,k11,k12,k13,k14,k15,k16, \
k20,k21,k22,k23,k24,k25, \
k30,k31,k32,k33,k34,k35,k36, \
k40,k41,k42,k43,k44, \
k55,k56, \
k54, \
k53,k52,k51, \
\
/* right hand, spatial positions */ \
k07,k08,k09,k0A,k0B,k0C,k0D, \
k17,k18,k19,k1A,k1B,k1C,k1D, \
k28,k29,k2A,k2B,k2C,k2D, \
k37,k38,k39,k3A,k3B,k3C,k3D, \
k49,k4A,k4B,k4C,k4D, \
k57,k58, \
k59, \
k5C,k5B,k5A ) \
KEYMAP( \
\
/* left hand, spatial positions */ \
k00,k01,k02,k03,k04,k05,k06, \
k10,k11,k12,k13,k14,k15,k16, \
k20,k21,k22,k23,k24,k25, \
k30,k31,k32,k33,k34,k35,k36, \
k40,k41,k42,k43,k44, \
k55,k56, \
k54, \
k53,k52,k51, \
\
/* right hand, spatial positions */ \
k07,k08,k09,k0A,k0B,k0C,k0D, \
k17,k18,k19,k1A,k1B,k1C,k1D, \
k28,k29,k2A,k2B,k2C,k2D, \
k37,k38,k39,k3A,k3B,k3C,k3D, \
k49,k4A,k4B,k4C,k4D, \
k57,k58, \
k59, \
k5C,k5B,k5A ), \
KEYMAP( \
/* left hand, spatial positions */ \
k0D,k0C,k0B,k0A,k09,k08,k07, \
k1D,k1C,k1B,k1A,k19,k18,k17, \
k2D,k2C,k2B,k2A,k29,k28, \
k3D,k3C,k3B,k3A,k39,k38,k37, \
k4D,k4C,k4B,k4A,k49, \
k58,k57, \
k59, \
k5A,k5B,k5C, \
\
/* right hand, spatial positions */ \
k06,k05,k04,k03,k02,k01,k00, \
k16,k15,k14,k13,k12,k11,k10, \
k25,k24,k23,k22,k21,k20, \
k36,k35,k34,k33,k32,k31,k30, \
k44,k43,k42,k41,k40, \
k56,k55, \
k54, \
k51,k52,k53) \
#define MIRRORED_RTHUMB( \
\
/* left hand, spatial positions */ \
k00,k01,k02,k03,k04,k05,k06, \
k10,k11,k12,k13,k14,k15,k16, \
k20,k21,k22,k23,k24,k25, \
k30,k31,k32,k33,k34,k35,k36, \
k40,k41,k42,k43,k44, \
\
/* right hand, spatial positions */ \
k07,k08,k09,k0A,k0B,k0C,k0D, \
k17,k18,k19,k1A,k1B,k1C,k1D, \
k28,k29,k2A,k2B,k2C,k2D, \
k37,k38,k39,k3A,k3B,k3C,k3D, \
k49,k4A,k4B,k4C,k4D, \
k57,k58, \
k59, \
k5C,k5B,k5A ) \
MIRRORED( \
\
/* left hand, spatial positions */ \
k00,k01,k02,k03,k04,k05,k06, \
k10,k11,k12,k13,k14,k15,k16, \
k20,k21,k22,k23,k24,k25, \
k30,k31,k32,k33,k34,k35,k36, \
k40,k41,k42,k43,k44, \
k58,k57, \
k59, \
k5A,k5B,k5C, \
\
/* right hand, spatial positions */ \
k07,k08,k09,k0A,k0B,k0C,k0D, \
k17,k18,k19,k1A,k1B,k1C,k1D, \
k28,k29,k2A,k2B,k2C,k2D, \
k37,k38,k39,k3A,k3B,k3C,k3D, \
k49,k4A,k4B,k4C,k4D, \
k57,k58, \
k59, \
k5C,k5B,k5A ) \
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KEYMAP( // layer 0 : default
...
),
KEYMAP( // layer 1 : function and symbol keys
...
),
KEYMAP( // layer 2 : mouse functions
),
MIRRORED_RTHUMB( // layer 3+4 : default mirrored
// left hand
EQL, 1, 2, 3, 4, 5, PGUP,
TAB, Q, W, E, R, T, HOME,
ESC, A, S, D, F, G,
F2, Z, X, C, V, B, END,
F3, F4, APP, LGUI,INS,
// right hand
PGDN,6, 7, 8, 9, 0, MINS,
BSPC,Y, U, I, O, P, BSLS,
H, J, K, L, SCLN,QUOT,
ENT, N, M, COMM,DOT, SLSH,LBRC,
LEFT,DOWN,UP, RGHT,RBRC,
RSHIFT, FN5,
LALT,
LCTRL,FN4, SPC
),
MIRRORED_RTHUMB( // layer 5+6 : function and symbol keys
// left hand
GRV, KP_1,KP_2,KP_3,KP_4,KP_5,FN3,
TRNS,F1, F2, F3, F4, NO, TRNS,
TRNS,F5, F6, F7, F8, NO,
VOLU,F9, F10, F11, F12, NO, TRNS,
VOLD,MUTE,MPRV,MPLY,MNXT,
// right hand
TRNS,KP_6,KP_7,KP_8,KP_9,KP_0,TRNS,
DEL, NO ,KP_4,KP_5,KP_6,PSLS,PAST,
NO ,KP_1,KP_2,KP_3,PMNS,PPLS,
TRNS,NO ,KP_0,KP_0,PDOT,NO ,PSCR,
TRNS,TRNS,TRNS,TRNS,NO,
TRNS,TRNS,
TRNS,
TRNS,FN6,TRNS
),
};
/* id for user defined functions */
enum function_id {
LOCK,
//TEENSY_KEY,
};
/*
* Fn action definition
*/
static const uint16_t PROGMEM fn_actions[] = {
ACTION_FUNCTION(LOCK), // FN0 - Teensy key
ACTION_LAYER_TAP_TOGGLE(1), // FN1 - tap/toggle Layer1
ACTION_LAYER_TAP_TOGGLE(2),
ACTION_LAYER_TOGGLE(3),
ACTION_LAYER_MOMENTARY(4),
ACTION_LAYER_MOMENTARY(5),
ACTION_LAYER_MOMENTARY(6),
//ACTION_LAYER_SET(2, ON_PRESS), // FN2 - set Layer2
//ACTION_LAYER_TOGGLE(3), // FN3 - toggle Layer3 aka Numpad layer
//ACTION_LAYER_SET(0, ON_PRESS), // FN4 - set Layer0
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment