From ac8d117f367b713131cd502c7592bb1870687298 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 20 Apr 2016 18:55:40 -0400 Subject: Add new custom dvorak keymap. --- keyboard/planck/keymaps/kj.c | 113 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 keyboard/planck/keymaps/kj.c (limited to 'keyboard/planck') diff --git a/keyboard/planck/keymaps/kj.c b/keyboard/planck/keymaps/kj.c new file mode 100644 index 0000000000..2bc7186c8f --- /dev/null +++ b/keyboard/planck/keymaps/kj.c @@ -0,0 +1,113 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DV 0 +#define _QW 1 +#define _LW 2 +#define _RS 3 + +#define _SHIFT 1 +#define _AA 2 +#define _OE 3 +#define _AE 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_DV] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT}, + {M(_SHIFT), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SLSH }, + {KC_ESC, KC_LCTL, KC_LGUI, KC_LALT, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +[_QW] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +[_LW] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS}, + {KC_TRNS, KC_VOLD, KC_VOLU, KC_PAUSE, KC_INSERT, KC_DELT, KC_ESC, KC_ENT, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, + +[_RS] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_TRNS, M(_AA), M(_OE), M(_AE), KC_TRNS, KC_TRNS, KC_TRNS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_TRNS}, + {KC_TRNS, KC_RALT, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_PIPE}, + {DF(_DV), DF(_QW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET} +}, +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + static uint16_t shift_pressed = 0; + + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + case _SHIFT: + if (record->event.pressed) { + register_code(KC_RSFT); + shift_pressed = 1; + } else { + unregister_code(KC_RSFT); + shift_pressed = 0; + } + break; + case _AA: + if (record->event.pressed) { + if (shift_pressed) { + return MACRO(I(10), U(RSFT), T(RALT), D(RSFT), T(A), T(A), END); + } else { + return MACRO(I(10), T(RALT), T(A), T(A), END); + } + } + break; + case _OE: + if (record->event.pressed) { + if (shift_pressed) { + return MACRO(I(10), U(RSFT), T(RALT), T(SLSH), D(RSFT), T(O), END); + } else { + return MACRO(I(10), T(RALT), T(SLSH), T(O), END); + } + } + break; + case _AE: + if (record->event.pressed) { + if (shift_pressed) { + return MACRO(I(10), U(RSFT), T(RALT), D(RSFT), T(A), T(E), END); + } else { + return MACRO(I(10), T(RALT), T(A), T(E), END); + } + } + break; + } + return MACRO_NONE; +}; + -- cgit v1.2.3