diff options
author | noroadsleft <18669334+noroadsleft@users.noreply.github.com> | 2018-06-15 21:57:15 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-06-15 21:57:15 -0700 |
commit | 4e9fb1d0d93db07c9934f64f6c8fe7a0dce51464 (patch) | |
tree | 1c4381a93d5f646dc99962dbad69efe3065a1def /keyboards/contra/keymaps/ryanm101 | |
parent | 0f04a0a74581d922f551596eeb2a16587717e44c (diff) |
Contra refactor (#3191)
* Readme update
* Keyboard Refactor
* Keymap refactor
* Fixes per drashna
* Fixed curly brace
Diffstat (limited to 'keyboards/contra/keymaps/ryanm101')
-rw-r--r-- | keyboards/contra/keymaps/ryanm101/keymap.c | 185 |
1 files changed, 93 insertions, 92 deletions
diff --git a/keyboards/contra/keymaps/ryanm101/keymap.c b/keyboards/contra/keymaps/ryanm101/keymap.c index f8fbb96029..70082a5a4f 100644 --- a/keyboards/contra/keymaps/ryanm101/keymap.c +++ b/keyboards/contra/keymaps/ryanm101/keymap.c @@ -50,95 +50,96 @@ enum { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ;: | '@ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | \| | L1 | | | L2 | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = { - {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, COLON, QUOTE}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_NONUS_BSLASH, MO(_L1), XXXXXXX, KC_SPC, MO(_L2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -/* QwertyMAC - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ;: | '@ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | GUI | \| | L1 | | | L2 | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTYMAC] = { - {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, COLON, QUOTE}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT}, - {KC_LCTL, KC_LALT, KC_LGUI, KC_NONUS_BSLASH, MO(_L1), XXXXXXX,KC_SPC, MO(_L2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ;: | '@ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | \| | L1 | | | L2 | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_ortho_4x12( + 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, COLON, QUOTE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_NUBS, MO(_L1), XXXXXXX, KC_SPC, MO(_L2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), -/* L1 - * ,-----------------------------------------------------------------------------------. - * | `¬ |INSERT| PGUP | HOME | <> | | () | 7& | 8* | 9( | | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | |DELETE| PGDN | END | [] | {} | =+ | 4$ | 5% | 6^ | * | LMAC | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |LSHIFT|PSCRN | |CADCAE| L3 |LCKSCR| -_ | 1! | 2" | 3£ | /? |ENTER | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | #~ | | | | | 0) | .> | | MENU | - * `-----------------------------------------------------------------------------------' - */ -[_L1] = { - {KC_GRV, KC_INSERT, KC_PGUP, KC_HOME, ANGUL, XXXXXXX, PARAN, KC_7, KC_8, KC_9, XXXXXXX, KC_BSPC}, - {XXXXXXX, KC_DELETE, KC_PGDOWN, KC_END, SQUAR, CURLY, KC_EQL, KC_4, KC_5, KC_6, S(KC_8), TG(_QWERTYMAC)}, - {_______, KC_PSCREEN, XXXXXXX, CADCAE, MO(_L3), LCKSCR, KC_MINS, KC_1, KC_2, KC_3, KC_SLSH, KC_ENT}, - {_______, _______, _______, KC_NUHS, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_0, ALGR_T(KC_DOT), XXXXXXX, KC_MENU} -}, + /* QwertyMAC + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ;: | '@ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | ,< | .> | /? |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | \| | L1 | | | L2 | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTYMAC] = LAYOUT_ortho_4x12( + 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, COLON, QUOTE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_NUBS, MO(_L1), XXXXXXX, KC_SPC, MO(_L2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), -/* L2 - * ,-----------------------------------------------------------------------------------. - * |Sysreq| F9 | F10 | F11 | F12 | |NUMLK | 7 | 8 | 9 | * |Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 | | | 4 | 5 | 6 | / | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | | | 1 | 2 | 3 | + |KP_ENT| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | | | | | | 0 | . | - | | - * `-----------------------------------------------------------------------------------' - */ - [_L2] = { - {KC_SYSREQ, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_NUMLOCK, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_BSPC}, - {XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_SLASH, _______}, - {XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_KP_ENTER}, - {_______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_KP_0, KC_KP_DOT, KC_KP_MINUS, _______} - }, + /* L1 + * ,-----------------------------------------------------------------------------------. + * | `¬ |INSERT| PGUP | HOME | <> | | () | 7& | 8* | 9( | | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | |DELETE| PGDN | END | [] | {} | =+ | 4$ | 5% | 6^ | * | LMAC | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |LSHIFT|PSCRN | |CADCAE| L3 |LCKSCR| -_ | 1! | 2" | 3£ | /? |ENTER | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | #~ | | | | | 0) | .> | | MENU | + * `-----------------------------------------------------------------------------------' + */ + [_L1] = LAYOUT_ortho_4x12( + KC_GRV, KC_INS, KC_PGUP, KC_HOME, ANGUL, XXXXXXX, PARAN, KC_7, KC_8, KC_9, XXXXXXX, KC_BSPC, + XXXXXXX, KC_DEL, KC_PGDN, KC_END, SQUAR, CURLY, KC_EQL, KC_4, KC_5, KC_6, S(KC_8), TG(_QWERTYMAC), + _______, KC_PSCR, XXXXXXX, CADCAE, MO(_L3), LCKSCR, KC_MINS, KC_1, KC_2, KC_3, KC_SLSH, KC_ENT, + _______, _______, _______, KC_NUHS, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_0, ALGR_T(KC_DOT), XXXXXXX, KC_MENU + ), -/* L3 - * ,-----------------------------------------------------------------------------------. - * |RGBTOG|RGBHUI|RGBHUD|RGBSAI|RGBSAD| | | PGDN | PGUP | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * |BLTOG |BLSTEP|RGBVAI|RGBVAD|RGBMOD|RGBRMD| Left | Down | Up | Right| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | TMUX | | | | | | | | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_L3] = { - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDOWN, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, XXXXXXX}, - {TMUX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ENT}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} - } + /* L2 + * ,-----------------------------------------------------------------------------------. + * |Sysreq| F9 | F10 | F11 | F12 | |NUMLK | 7 | 8 | 9 | * |Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | | 4 | 5 | 6 | / | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | | | 1 | 2 | 3 | + |KP_ENT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | | | | | | 0 | . | - | | + * `-----------------------------------------------------------------------------------' + */ + [_L2] = LAYOUT_ortho_4x12( + KC_SYSREQ, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PAST, KC_BSPC, + XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PSLS, _______, + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PENT, + _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_P0, KC_PDOT, KC_PMNS, _______ + ), + + /* L3 + * ,-----------------------------------------------------------------------------------. + * |RGBTOG|RGBHUI|RGBHUD|RGBSAI|RGBSAD| | | PGDN | PGUP | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |BLTOG |BLSTEP|RGBVAI|RGBVAD|RGBMOD|RGBRMD| Left | Down | Up | Right| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | TMUX | | | | | | | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_L3] = LAYOUT_ortho_4x12( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, + TMUX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ENT, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) }; @@ -221,12 +222,12 @@ void cmd_dance (qk_tap_dance_state_t *state, void *user_data) { } } -void cmd_sft_slash_pipe_down (qk_tap_dance_state_t *state, void *user_data) { +void cmd_sft_slash_pipe_down (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { if (state->interrupted || state->pressed==0) { register_code (KC_NONUS_BSLASH); } else { - register_code (KC_LSFT); + register_code (KC_LSFT); } } else if (state->count == 2) { register_mods(MOD_BIT(KC_LSFT)); @@ -234,10 +235,10 @@ void cmd_sft_slash_pipe_down (qk_tap_dance_state_t *state, void *user_data) { } } -void cmd_sft_slash_pipe_up (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT)) { - unregister_code (KC_LSFT); +void cmd_sft_slash_pipe_up (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT)) { + unregister_code (KC_LSFT); } else { unregister_code (KC_NONUS_BSLASH); } @@ -257,5 +258,5 @@ void cmd_sft_slash_pipe_up (qk_tap_dance_state_t *state, void *user_data) { ,[SQU] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, NULL, square_dance ) ,[ANG] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, NULL, angular_dance ) ,[TD_TMUX] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, NULL, tmux_dance ) - ,[TD_SHIFTSLASHPIPE] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, cmd_sft_slash_pipe_down, cmd_sft_slash_pipe_up) + ,[TD_SHIFTSLASHPIPE] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, cmd_sft_slash_pipe_down, cmd_sft_slash_pipe_up) }; |