diff options
Diffstat (limited to 'keyboards/planck/keymaps/samuel/keymap.c')
-rw-r--r-- | keyboards/planck/keymaps/samuel/keymap.c | 228 |
1 files changed, 92 insertions, 136 deletions
diff --git a/keyboards/planck/keymaps/samuel/keymap.c b/keyboards/planck/keymaps/samuel/keymap.c index ff1424489f..20e64a022b 100644 --- a/keyboards/planck/keymaps/samuel/keymap.c +++ b/keyboards/planck/keymaps/samuel/keymap.c @@ -29,10 +29,6 @@ KC_EZGUI, KC_EZALT, KC_DVORAK, KC_QWERTY, -KC_USER, -KC_EMAIL, -KC_NAME, -KC_DIR, KC_COM }; @@ -45,47 +41,39 @@ _COMMAND const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_DVORAK] = - -{{ KC_T_LRSE, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_T_RRSE}, -{ KC_T_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_T_RSFT}, -{ KC_T_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_T_RCTL}, -{ KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_T_RGUI} -}, - -[_QWERTY] = - -{{ KC_T_LRSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_T_RRSE}, -{ KC_T_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_T_RSFT}, -{ KC_T_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, KC_T_RCTL}, -{ KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_DVORAK} -}, - -[_RISE] = - -{{ KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_EQL, KC_7, KC_8, KC_9, KC_TRANSPARENT, KC_TRANSPARENT}, -{ KC_EZSHFT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_HOME, KC_ASTR, KC_4, KC_5, KC_6, KC_0, KC_EZSHFT}, -{ KC_EZCTRL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_COM, KC_EZCTRL}, -{ KC_EZGUI, KC_EZALT, KC_EZUP, KC_EZDOWN, KC_SPC, KC_AMPR, KC_PIPE, KC_END, KC_EZLEFT, KC_EZRGHT, KC_EZALT, KC_EZGUI} -}, - -[_COMMAND] = - -{{ KC_TRANSPARENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRANSPARENT}, -{ KC_TRANSPARENT, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRANSPARENT}, -{ KC_TRANSPARENT, KC_F21, KC_F22, KC_F23, KC_F24, KC_QWERTY, KC_DVORAK, KC_USER, KC_EMAIL, KC_NAME, KC_TRANSPARENT, KC_TRANSPARENT}, -{ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_DIR, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT} -}, - +[_DVORAK] = LAYOUT_planck_grid( +KC_T_LRSE, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_T_RRSE, +KC_T_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_T_RSFT, +KC_T_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_T_RCTL, +KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_SPC, KC_EQL, KC_GRAVE, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_T_RGUI +), +[_QWERTY] = LAYOUT_planck_grid( +KC_T_LRSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_T_RRSE, +KC_T_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_T_RSFT, +KC_T_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, KC_T_RCTL, +KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_SPC, KC_EQL, KC_GRAVE, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_DVORAK +), +[_RISE] = LAYOUT_planck_grid( +KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_ASTR, KC_7, KC_8, KC_9, KC_TRANSPARENT, KC_TRANSPARENT, +KC_EZSHFT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_HOME, KC_AMPR, KC_4, KC_5, KC_6, KC_0, KC_EZSHFT, +KC_EZCTRL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_COM, KC_EZCTRL, +KC_EZGUI, KC_EZALT, KC_EZUP, KC_EZDOWN, KC_SPC, KC_PIPE, KC_BSLASH, KC_END, KC_EZLEFT, KC_EZRGHT, KC_EZALT, KC_EZGUI +), +[_COMMAND] = LAYOUT_planck_grid( +KC_TRANSPARENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRANSPARENT, +KC_TRANSPARENT, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRANSPARENT, +KC_TRANSPARENT, KC_F21, KC_F22, KC_F23, KC_F24, KC_QWERTY, KC_DVORAK, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, +KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT +) }; static uint16_t tap_timer = 0; char last_mod = 10; void mod_press(uint16_t tap_code, uint16_t hold_code, int id) { - // this first if body makes double modified keys impossible, but stops the - // delay when modifying a tap key which would result in the tap key not - // getting modified. + /* this first if body makes double modified keys impossible, but stops the */ + /* delay when modifying a tap key which would result in the tap key not */ + /* getting modified. */ if (last_mod != id && last_mod != 10) { tap_code16(tap_code); last_mod = 10; @@ -100,8 +88,8 @@ void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) { unregister_code(hold_code); if (last_mod == id && timer_elapsed(tap_timer) < TAPPING_TERM) { tap_code16(tap_code); - last_mod = 10; } + last_mod = 10; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -121,73 +109,81 @@ if (record->event.pressed) { return true; break; -case KC_T_LALT: -if (record->event.pressed) { - mod_press(S(KC_9), KC_LALT, 0); -} else { - mod_lift(S(KC_9), KC_LALT, 0); -} -return false; -break; -case KC_T_RALT: +case KC_COM: if (record->event.pressed) { - mod_press(S(KC_0), KC_RALT, 1); + layer_on(_COMMAND); + set_oneshot_layer(_COMMAND, ONESHOT_START); + last_mod = 10; } else { - mod_lift(S(KC_0), KC_RALT, 1); + clear_oneshot_layer_state (ONESHOT_PRESSED); } return false; break; +case KC_T_LALT: + if (record->event.pressed) { + mod_press(KC_LPRN, KC_LALT, 0); + } else { + mod_lift(KC_LPRN, KC_LALT, 0); + } + return false; + break; +case KC_T_RALT: + if (record->event.pressed) { + mod_press(KC_RPRN, KC_RALT, 1); + } else { + mod_lift(KC_RPRN, KC_RALT, 1); + } + return false; + break; case KC_T_LGUI: -if (record->event.pressed) { - mod_press(KC_GRAVE, KC_LGUI, 2); -} else { - mod_lift(KC_GRAVE, KC_LGUI, 2); -} -return false; -break; + if (record->event.pressed) { + mod_press(KC_SLASH, KC_LGUI, 2); + } else { + mod_lift(KC_SLASH, KC_LGUI, 2); + } + return false; + break; case KC_T_RGUI: -if (record->event.pressed) { - mod_press(KC_BSLASH, KC_RGUI, 3); -} else { - mod_lift(KC_BSLASH, KC_RGUI, 3); -} -return false; -break; - + if (record->event.pressed) { + mod_press(KC_MINS, KC_RGUI, 3); + } else { + mod_lift(KC_MINS, KC_RGUI, 3); + } + return false; + break; case KC_T_LCTL: -if (record->event.pressed) { - mod_press(KC_LBRACKET, KC_LCTL, 4); -} else { - mod_lift(KC_LBRACKET, KC_LCTL, 4); -} -return false; -break; + if (record->event.pressed) { + mod_press(KC_LBRACKET, KC_LCTL, 4); + } else { + mod_lift(KC_LBRACKET, KC_LCTL, 4); + } + return false; + break; case KC_T_RCTL: -if (record->event.pressed) { - mod_press(KC_RBRACKET, KC_RCTL, 5); -} else { - mod_lift(KC_RBRACKET, KC_RCTL, 5); -} -return false; -break; - + if (record->event.pressed) { + mod_press(KC_RBRACKET, KC_RCTL, 5); + } else { + mod_lift(KC_RBRACKET, KC_RCTL, 5); + } + return false; + break; case KC_T_LSFT: -if (record->event.pressed) { - mod_press(KC_EQUAL, KC_LSFT, 6); -} else { - mod_lift(KC_EQUAL, KC_LSFT, 6); -} -return false; -break; + if (record->event.pressed) { + mod_press(KC_TAB, KC_LSFT, 6); + } else { + mod_lift(KC_TAB, KC_LSFT, 6); + } + return false; + break; case KC_T_RSFT: -if (record->event.pressed) { - mod_press(KC_MINUS, KC_RSFT, 7); -} else { - mod_lift(KC_MINUS, KC_RSFT, 7); -} -return false; -break; + if (record->event.pressed) { + mod_press(KC_ENTER, KC_RSFT, 7); + } else { + mod_lift(KC_ENTER, KC_RSFT, 7); + } + return false; + break; case KC_T_LRSE: if (record->event.pressed) { @@ -211,7 +207,7 @@ if (record->event.pressed) { } else { layer_off(_RISE); if (last_mod == 9 && timer_elapsed(tap_timer) < TAPPING_TERM) { - tap_code16(KC_SLASH); + tap_code16(KC_BSPACE); last_mod = 10; } } @@ -313,46 +309,6 @@ if (record->event.pressed) { return false; break; -case KC_COM: -if (record->event.pressed) { - layer_on(_COMMAND); - set_oneshot_layer(_COMMAND, ONESHOT_START); - last_mod = 10; -} else { - clear_oneshot_layer_state (ONESHOT_PRESSED); -} -return false; -break; - -case KC_USER: -if (record->event.pressed) { - send_string("mhostley"); - last_mod = 10; -} -return true; -break; -case KC_EMAIL: -if (record->event.pressed) { - send_string("mhostley@gmail.com"); - last_mod = 10; -} -return true; -break; -case KC_NAME: -if (record->event.pressed) { - send_string("Samuel Jahnke"); - last_mod = 10; -} -return true; -break; -case KC_DIR: -if (record->event.pressed) { - send_string("home/mhostley/"); - last_mod = 10; -} -return true; -break; - } last_mod = 10; return true; |