diff options
author | Jack Humbert <jack.humb@gmail.com> | 2015-05-27 12:26:02 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2015-05-27 12:26:02 -0400 |
commit | 1add9b72e74491b37016c641cc2fd8a809effa7e (patch) | |
tree | 9831b529a825131c82843fbf037dfde621069ccc /keyboard/planck | |
parent | 49ba5817c43262b50e711facdb7a7b2ff7616a71 (diff) | |
parent | c59255879ddb20df5e149e556e22e39c2082bf91 (diff) |
Merge branch 'master' of https://github.com/jackhumbert/tmk_keyboard
Diffstat (limited to 'keyboard/planck')
-rw-r--r-- | keyboard/planck/common_keymaps/keymap_joe.c | 98 | ||||
-rw-r--r-- | keyboard/planck/extended_keymaps/extended_keymap_joe.c | 90 |
2 files changed, 127 insertions, 61 deletions
diff --git a/keyboard/planck/common_keymaps/keymap_joe.c b/keyboard/planck/common_keymaps/keymap_joe.c index 07122b702c..598b0c455c 100644 --- a/keyboard/planck/common_keymaps/keymap_joe.c +++ b/keyboard/planck/common_keymaps/keymap_joe.c @@ -1,39 +1,37 @@ #include "keymap_common.h" const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( /* Joe colemak */ - ESC, Q, W, F, P, G, J, L, U, Y, SCLN, MINS, - BSPC, A, R, S, T, D, H, N, E, I, O, ENT, - TAB, Z, X, C, V, B, K, M, COMM, DOT, SLSH, QUOT, - LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, DOWN, UP, RGHT), -[1] = KEYMAP( /* Joe qwerty */ +[0] = KEYMAP( /* Joe qwerty */ ESC, Q, W, E, R, T, Y, U, I, O, P, MINS, - BSPC, A, S, D, F, G, H, J, K, L, SCLN, ENT, - TAB, Z, X, C, V, B, N, M, COMM, DOT, SLSH, QUOT, - LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, DOWN, UP, RGHT), -[2] = KEYMAP( /* Joe RAISE */ + BSPC, A, S, D, F, G, H, J, K, L, SCLN, ENTER, + FN7, Z, X, C, V, B, N, M, COMM, DOT, SLSH, QUOT, + LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, UP, DOWN, RGHT), +[1] = KEYMAP( /* Joe colemak */ + ESC, Q, W, F, P, G, J, L, U, Y, SCLN, MINS, + BSPC, A, R, S, T, D, H, N, E, I, O, ENTER, + FN7, Z, X, C, V, B, K, M, COMM, DOT, SLSH, QUOT, + LCTL, LGUI, LALT, LSFT, FN1, SPC, FN0, LEFT, UP, DOWN, RGHT), +[2] = KEYMAP( /* Joe UPPER */ F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - DEL, FN10, FN11, FN12, FN13, FN14, FN15, FN16, FN17, FN18, FN19, TRNS, - BSLS, FN5, FN6, TRNS, TRNS, MENU, CAPS, INS, PSCR, LBRC, RBRC, FN21, + DEL, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, MENU, CAPS, INS, PSCR, TRNS, FN5, FN6, TRNS, TRNS, TRNS, TRNS, FN2, TRNS, FN0, FN26, FN27, FN28, FN29), [3] = KEYMAP( /* Joe LOWER */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN7, FN8, FN9, FN30, FN31, - DEL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, - FN25, FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN23, FN24, EQL, - TRNS, TRNS, TRNS, TRNS, FN1, TRNS, FN2, HOME, PGDN, PGUP, END), -[4] = KEYMAP( /* Joe LOWER + RAISE */ + GRV, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN8, FN9, FN30, + BSPC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, RBRC, TRNS, EQL, + TRNS, TRNS, TRNS, TRNS, FN1, TRNS, FN2, HOME, PGUP, PGDN, END), +[4] = KEYMAP( /* Joe LOWER + UPPER */ + FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, SLEP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MPLY), + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, VOLU, MPLY), }; enum macro_id { M_Q0, M_Q1, - M_Q2, - M_Q3, - M_Q4 + M_Q2 }; const uint16_t PROGMEM fn_actions[] = { @@ -44,64 +42,42 @@ const uint16_t PROGMEM fn_actions[] = { [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), - [5] = ACTION_MODS_KEY(MOD_LCTL, KC_PGDN), - [6] = ACTION_MODS_KEY(MOD_LCTL, KC_PGUP), + [5] = ACTION_MODS_KEY(MOD_LCTL, KC_PGUP), + [6] = ACTION_MODS_KEY(MOD_LCTL, KC_PGDN), - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + /* tab on tap, shift on hold */ + [7] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB), - [7] = ACTION_MACRO(M_Q0), - [8] = ACTION_MACRO(M_Q1), - [9] = ACTION_MACRO(M_Q2), - [30] = ACTION_MACRO(M_Q3), - [31] = ACTION_MACRO(M_Q4), + [8] = ACTION_MACRO(M_Q0), + [9] = ACTION_MACRO(M_Q1), [26] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_LEFT), - [27] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DOWN), - [28] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_UP), + [27] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_UP), + [28] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_DOWN), [29] = ACTION_MODS_KEY(MOD_LCTL | MOD_LALT, KC_RGHT), + [30] = ACTION_MACRO(M_Q2), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ +{ keyevent_t event = record->event; switch (id) { case M_Q0: + /* :( | ): */ return event.pressed ? - MACRO( D(LSFT), T(SCLN), U(LSFT), T(SLSH), END ) : + MACRO( D(LSFT), T(P), T(9), T(SPC), T(SPC), T(0), T(P), U(LSFT), T(LEFT), T(LEFT), T(LEFT), END ) : MACRO_NONE; case M_Q1: + /* (: | :) */ return event.pressed ? - MACRO( D(LSFT), T(SCLN), T(9), U(LSFT), END ) : + MACRO( D(LSFT), T(9), T(P), T(SPC), T(SPC), T(P), T(0), U(LSFT), T(LEFT), T(LEFT), T(LEFT), END ) : MACRO_NONE; case M_Q2: + /* :) */ return event.pressed ? - MACRO( D(LSFT), T(0), T(SCLN), U(LSFT), END ) : - MACRO_NONE; - case M_Q3: - return event.pressed ? - MACRO( D(LSFT), T(9), T(SCLN), U(LSFT), END ) : - MACRO_NONE; - case M_Q4: - return event.pressed ? - MACRO( D(LSFT), T(SCLN), T(0), U(LSFT), END ) : + MACRO( D(LSFT), T(P), T(0), U(LSFT), END ) : MACRO_NONE; - } return MACRO_NONE; -}
\ No newline at end of file +} diff --git a/keyboard/planck/extended_keymaps/extended_keymap_joe.c b/keyboard/planck/extended_keymaps/extended_keymap_joe.c new file mode 100644 index 0000000000..36a6d0d687 --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_joe.c @@ -0,0 +1,90 @@ +#include "extended_keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Joe soft Colemak */ + {FUNC(3), CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_MINS}, + {KC_BSPC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_ENT }, + {FUNC(15), CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, FUNC(1), KC_SPC, KC_SPC, FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + [1] = { /* Joe colemak */ + {FUNC(3), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {FUNC(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, FUNC(1), KC_SPC, KC_SPC, FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, + [2] = { /* Joe NUMPAD */ + {FUNC(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_9), LSFT(KC_0), KC_P7, KC_P8, KC_P9, KC_PSLS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_5), KC_PEQL, KC_P4, KC_P5, KC_P6, KC_PAST}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PCMM, KC_P1, KC_P2, KC_P3, KC_PMNS}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), KC_P0, KC_PDOT, KC_PENT, KC_PPLS} + }, + [4] = { /* Joe LOWER fn1 */ + {KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(28), FUNC(27), FUNC(26), FUNC(25)}, + {KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS }, + {KC_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_EQL }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), KC_HOME, KC_PGDN, KC_PGUP, KC_END } + }, + [5] = { /* Joe UPPER fn2 */ + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, + {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, RESET }, + {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_MENU, KC_CAPS, KC_INS, KC_PSCR, KC_TRNS, LCTL(KC_PGUP), LCTL(KC_PGDN) }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} + }, + [6] = { /* Joe SPECIAL fn3 */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(LSFT(CM_U)), KC_TRNS, KC_TRNS, KC_SLEP}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {FUNC(6), FUNC(7), FUNC(8), KC_TRNS, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} + } +}; + +enum macro_id { + M_Q0, + M_Q1, + M_Q2, + M_Q3 +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(4), // fn1 + [2] = ACTION_LAYER_MOMENTARY(5), // fn2 + + /* ESC on tap, fn3 on hold */ + [3] = ACTION_LAYER_TAP_KEY(6, KC_ESC), + + /* toggle layers */ + [6] = ACTION_DEFAULT_LAYER_SET(0), + [7] = ACTION_DEFAULT_LAYER_SET(1), + [8] = ACTION_DEFAULT_LAYER_SET(2), + + /* tab on tap, shift on hold */ + [15] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB), + + /* smiley macros */ + [25] = ACTION_MACRO(M_Q0), + [26] = ACTION_MACRO(M_Q1), + [27] = ACTION_MACRO(M_Q2), + [28] = ACTION_MACRO(M_Q3), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) { + case M_Q0: + /* :( */ + return MACRODOWN( D(LSFT), T(CM_SCLN), T(0), U(LSFT), END ); + case M_Q1: + /* :) */ + return MACRODOWN( D(LSFT), T(CM_SCLN), T(9), U(LSFT), END ); + case M_Q2: + /* (: | :) */ + return MACRODOWN( D(LSFT), T(9), T(CM_SCLN), T(SPC), T(SPC), T(CM_SCLN), T(0), U(LSFT), T(LEFT), T(LEFT), T(LEFT), END ); + case M_Q3: + /* :( | ): */ + return MACRODOWN( D(LSFT), T(CM_SCLN), T(9), T(SPC), T(SPC), T(0), T(CM_SCLN), U(LSFT), T(LEFT), T(LEFT), T(LEFT), END ); + default: + break; + } + return MACRO_NONE; +} |