diff options
| -rw-r--r-- | keyboards/crkbd/keymaps/sulrich/README.md | 72 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/sulrich/config.h | 36 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/sulrich/keymap.c | 156 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/sulrich/rules.mk | 2 |
4 files changed, 266 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/sulrich/README.md b/keyboards/crkbd/keymaps/sulrich/README.md new file mode 100644 index 000000000..0bb585aa2 --- /dev/null +++ b/keyboards/crkbd/keymaps/sulrich/README.md | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | # sulrich crkbd layout | ||
| 2 | |||
| 3 | this is the personal keyboard layout of [@sulrich](https://github.com/sulrich), | ||
| 4 | and is heavily oriented towards operation in the Mac OS environment. | ||
| 5 | |||
| 6 | there are no LED rules in this keymap and the OLED display uses the default | ||
| 7 | corne images | ||
| 8 | |||
| 9 | ## layout notes | ||
| 10 | |||
| 11 | this layout uses a standard QWERTY layout on the default layer followed by a | ||
| 12 | separate layer for symbols and numbers (and F-keys) | ||
| 13 | |||
| 14 | ### thumb cluster: left | ||
| 15 | |||
| 16 | this contains the Mac OS modifier keys as well as the enter key. these are | ||
| 17 | transparently mapped through the remaining layers with the exception of the | ||
| 18 | enter key which is toggled to backspace on the symbols layer. | ||
| 19 | |||
| 20 | ### thumb cluster: right | ||
| 21 | |||
| 22 | the largest right thumb button provides the space and the layer toggles. | ||
| 23 | |||
| 24 | ### default layer | ||
| 25 | ```text | ||
| 26 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
| 27 | TAB, Q, W, E, R, T, Y, U, I, O, P, \, | ||
| 28 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 29 | LCTL, A, S, D, F, G, H, J, K, L, ;, ', | ||
| 30 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 31 | LSFT, Z, X, C, V, B, N, M, ,, ., /, RSFT, | ||
| 32 | //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
| 33 | OPT, CMD, ENTER, SPC, MO(1), MO(2) | ||
| 34 | //`--------------------------' `--------------------------' | ||
| 35 | ``` | ||
| 36 | |||
| 37 | ### symbols layer [1] | ||
| 38 | |||
| 39 | this layer contains all of the standard symbols. the arrow keys are mapped to | ||
| 40 | the default vi bindings for single character motion (h, j, k, l). | ||
| 41 | |||
| 42 | ```text | ||
| 43 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
| 44 | ESC, !, @, {, }, |, ^, +, =, -, *, , | ||
| 45 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 46 | , #, $, (, ), `, LEFT, DOWN, UP, RIGHT, , ENTER, | ||
| 47 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 48 | , %, ^, [, ], ~, _, &, <, >, \, , | ||
| 49 | //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
| 50 | OPT, CMD, BSPACE, SPC, MO(1), MO(2) | ||
| 51 | //`--------------------------' `--------------------------' | ||
| 52 | ``` | ||
| 53 | |||
| 54 | ### number/media layer [2] | ||
| 55 | |||
| 56 | this layer has all of the numbers and the F-keys mapped to reasonably intuitive | ||
| 57 | locations. additionally, media controls allow for quick access to volume and | ||
| 58 | track changes. | ||
| 59 | |||
| 60 | ```text | ||
| 61 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
| 62 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, | ||
| 63 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 64 | , 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, | ||
| 65 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 66 | , PREV, PLAY, NEXT, VOL_DN, VOL_UP, , MUTE, , , , , | ||
| 67 | //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
| 68 | OPT, CMD, ENTER, SPC, MO(1), MO(2) | ||
| 69 | //`--------------------------' `--------------------------' | ||
| 70 | |||
| 71 | ``` | ||
| 72 | |||
diff --git a/keyboards/crkbd/keymaps/sulrich/config.h b/keyboards/crkbd/keymaps/sulrich/config.h new file mode 100644 index 000000000..29b1f4419 --- /dev/null +++ b/keyboards/crkbd/keymaps/sulrich/config.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | This is the c configuration file for the keymap | ||
| 3 | |||
| 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 5 | Copyright 2015 Jack Humbert | ||
| 6 | |||
| 7 | This program is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 2 of the License, or | ||
| 10 | (at your option) any later version. | ||
| 11 | |||
| 12 | This program is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #pragma once | ||
| 22 | |||
| 23 | /* select hand configuration */ | ||
| 24 | #define MASTER_LEFT | ||
| 25 | |||
| 26 | #ifdef RGBLIGHT_ENABLE | ||
| 27 | #undef RGBLED_NUM | ||
| 28 | #define RGBLIGHT_ANIMATIONS | ||
| 29 | #define RGBLED_NUM 27 | ||
| 30 | #define RGBLIGHT_LIMIT_VAL 120 | ||
| 31 | #define RGBLIGHT_HUE_STEP 10 | ||
| 32 | #define RGBLIGHT_SAT_STEP 17 | ||
| 33 | #define RGBLIGHT_VAL_STEP 17 | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c" | ||
diff --git a/keyboards/crkbd/keymaps/sulrich/keymap.c b/keyboards/crkbd/keymaps/sulrich/keymap.c new file mode 100644 index 000000000..4e75d5bdd --- /dev/null +++ b/keyboards/crkbd/keymaps/sulrich/keymap.c | |||
| @@ -0,0 +1,156 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 @sulrich <sulrich@botwerks.org> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | |||
| 21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 22 | [0] = LAYOUT_split_3x6_3( | ||
| 23 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
| 24 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
| 25 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 26 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
| 27 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 28 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 29 | //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
| 30 | KC_LOPT, KC_LGUI, KC_ENT, KC_SPC, MO(1), MO(2) | ||
| 31 | //`--------------------------' `--------------------------' | ||
| 32 | |||
| 33 | ), | ||
| 34 | |||
| 35 | [1] = LAYOUT_split_3x6_3( | ||
| 36 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
| 37 | KC_ESC, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_CIRC, KC_PLUS,KC_EQUAL,KC_MINUS, KC_ASTR, KC_TRNS, | ||
| 38 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 39 | KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN,KC_GRAVE, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, KC_TRNS,KC_ENTER, | ||
| 40 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 41 | KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_UNDS, KC_AMPR, KC_LABK, KC_RABK,KC_BSLASH,KC_TRNS, | ||
| 42 | //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
| 43 | KC_TRNS, KC_TRNS,KC_BSPACE, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 44 | //`--------------------------' `--------------------------' | ||
| 45 | ), | ||
| 46 | |||
| 47 | [2] = LAYOUT_split_3x6_3( | ||
| 48 | //,-----------------------------------------------------. ,-----------------------------------------------------. | ||
| 49 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, | ||
| 50 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 51 | KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F12, | ||
| 52 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
| 53 | KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 54 | //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| | ||
| 55 | KC_TRNS, KC_TRNS, KC_ENT, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 56 | //`--------------------------' `--------------------------' | ||
| 57 | ) | ||
| 58 | }; | ||
| 59 | |||
| 60 | #ifdef OLED_DRIVER_ENABLE | ||
| 61 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 62 | if (!is_keyboard_master()) { | ||
| 63 | return OLED_ROTATION_180; // flips the display 180 degrees if offhand | ||
| 64 | } | ||
| 65 | return rotation; | ||
| 66 | } | ||
| 67 | |||
| 68 | #define L_BASE 0 | ||
| 69 | #define L_SYMBOLS 2 | ||
| 70 | #define L_NUMBERS 4 | ||
| 71 | |||
| 72 | void oled_render_layer_state(void) { | ||
| 73 | oled_write_P(PSTR("layer: "), false); | ||
| 74 | switch (layer_state) { | ||
| 75 | case L_BASE: | ||
| 76 | oled_write_ln_P(PSTR("default"), false); | ||
| 77 | break; | ||
| 78 | case L_SYMBOLS: | ||
| 79 | oled_write_ln_P(PSTR("symbols"), false); | ||
| 80 | break; | ||
| 81 | case L_NUMBERS: | ||
| 82 | oled_write_ln_P(PSTR("numbers/media"), false); | ||
| 83 | break; | ||
| 84 | } | ||
| 85 | } | ||
| 86 | |||
| 87 | |||
| 88 | char keylog_str[24] = {}; | ||
| 89 | |||
| 90 | const char code_to_name[60] = { | ||
| 91 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', | ||
| 92 | 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', | ||
| 93 | 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', | ||
| 94 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', | ||
| 95 | 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', | ||
| 96 | '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; | ||
| 97 | |||
| 98 | void set_keylog(uint16_t keycode, keyrecord_t *record) { | ||
| 99 | char name = ' '; | ||
| 100 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || | ||
| 101 | (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } | ||
| 102 | if (keycode < 60) { | ||
| 103 | name = code_to_name[keycode]; | ||
| 104 | } | ||
| 105 | |||
| 106 | // update keylog | ||
| 107 | snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", | ||
| 108 | record->event.key.row, record->event.key.col, | ||
| 109 | keycode, name); | ||
| 110 | } | ||
| 111 | |||
| 112 | void oled_render_keylog(void) { | ||
| 113 | oled_write(keylog_str, false); | ||
| 114 | } | ||
| 115 | |||
| 116 | void render_bootmagic_status(bool status) { | ||
| 117 | /* Show ctrl-Gui Swap options */ | ||
| 118 | static const char PROGMEM logo[][2][3] = { | ||
| 119 | {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, | ||
| 120 | {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, | ||
| 121 | }; | ||
| 122 | if (status) { | ||
| 123 | oled_write_ln_P(logo[0][0], false); | ||
| 124 | oled_write_ln_P(logo[0][1], false); | ||
| 125 | } else { | ||
| 126 | oled_write_ln_P(logo[1][0], false); | ||
| 127 | oled_write_ln_P(logo[1][1], false); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | |||
| 131 | void oled_render_logo(void) { | ||
| 132 | static const char PROGMEM crkbd_logo[] = { | ||
| 133 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
| 134 | 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, | ||
| 135 | 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, | ||
| 136 | 0}; | ||
| 137 | oled_write_P(crkbd_logo, false); | ||
| 138 | } | ||
| 139 | |||
| 140 | void oled_task_user(void) { | ||
| 141 | if (is_keyboard_master()) { | ||
| 142 | oled_render_layer_state(); | ||
| 143 | oled_render_keylog(); | ||
| 144 | } else { | ||
| 145 | oled_render_logo(); | ||
| 146 | } | ||
| 147 | } | ||
| 148 | |||
| 149 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 150 | if (record->event.pressed) { | ||
| 151 | set_keylog(keycode, record); | ||
| 152 | } | ||
| 153 | return true; | ||
| 154 | } | ||
| 155 | #endif // OLED_DRIVER_ENABLE | ||
| 156 | |||
diff --git a/keyboards/crkbd/keymaps/sulrich/rules.mk b/keyboards/crkbd/keymaps/sulrich/rules.mk new file mode 100644 index 000000000..5ec4f0587 --- /dev/null +++ b/keyboards/crkbd/keymaps/sulrich/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | EXTRAKEY_ENABLE = yes | ||
| 2 | OLED_DRIVER_ENABLE = yes | ||
