diff options
Diffstat (limited to 'keyboards/boardsource/microdox/keymaps/cole/keymap.c')
-rw-r--r-- | keyboards/boardsource/microdox/keymaps/cole/keymap.c | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/keyboards/boardsource/microdox/keymaps/cole/keymap.c b/keyboards/boardsource/microdox/keymaps/cole/keymap.c new file mode 100644 index 000000000..8ff570747 --- /dev/null +++ b/keyboards/boardsource/microdox/keymaps/cole/keymap.c | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | Copyright 2020 Cole Smith <[email protected]> | ||
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 | #include "split_util.h" | ||
20 | |||
21 | enum layers { | ||
22 | _QWERTY, | ||
23 | _RAISE, | ||
24 | _LOWER, | ||
25 | _ADJUST | ||
26 | }; | ||
27 | |||
28 | #define KC_CTSC RCTL_T(KC_SCLN) | ||
29 | #define LOWER_SPC LT(_LOWER, KC_SPC) | ||
30 | #define RASE_BACK LT(_RAISE, KC_BSPC) | ||
31 | #define SHFT_Z MT(MOD_LSFT, KC_Z) | ||
32 | #define SHIFT_SLASH MT(MOD_RSFT,KC_SLSH) | ||
33 | #define RASE_ENT LT(_RAISE, KC_ENT) | ||
34 | #define CTRL_A MT(MOD_LCTL,KC_A) | ||
35 | #define PREVWINDOW MT(MOD_LCTL, KC_LEFT) | ||
36 | #define NEXTWINDOW MT(MOD_LCTL, KC_RGHT) | ||
37 | |||
38 | |||
39 | |||
40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
41 | [_QWERTY] = LAYOUT_split_3x5_3( | ||
42 | KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, | ||
43 | CTRL_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_CTSC, | ||
44 | SHFT_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SHIFT_SLASH, | ||
45 | MO(_LOWER),KC_LGUI, RASE_ENT, RASE_BACK, LOWER_SPC, KC_TAB | ||
46 | ), | ||
47 | [_RAISE] = LAYOUT_split_3x5_3( | ||
48 | KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, | ||
49 | KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_QUOT, | ||
50 | KC_LSFT, KC_GRV, PREVWINDOW, NEXTWINDOW, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, | ||
51 | _______, KC_LGUI, KC_ENT, KC_BSPC, KC_SPC, _______ | ||
52 | ), | ||
53 | [_LOWER] = LAYOUT_split_3x5_3( | ||
54 | KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, | ||
55 | KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DQT, | ||
56 | KC_ESC, KC_TILD, PREVWINDOW, NEXTWINDOW, RGB_MODE_FORWARD, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, | ||
57 | _______, KC_LGUI, KC_ENT, KC_BSPC, KC_SPC, _______ | ||
58 | ) | ||
59 | }; | ||
60 | |||
61 | #ifdef OLED_ENABLE | ||
62 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
63 | if (is_keyboard_master()) | ||
64 | return OLED_ROTATION_180; | ||
65 | return rotation; | ||
66 | } | ||
67 | |||
68 | static void render_logo(void) { | ||
69 | static const char PROGMEM qmk_logo[] = { | ||
70 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
71 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
72 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, | ||
73 | 0 | ||
74 | }; | ||
75 | oled_write_P(qmk_logo, false); | ||
76 | } | ||
77 | |||
78 | static void render_status(void) { | ||
79 | switch (get_highest_layer(layer_state)) { | ||
80 | case _QWERTY: | ||
81 | oled_write_P(PSTR("B R L A O\n"), false); | ||
82 | oled_write_P(PSTR("^\n"), false); | ||
83 | oled_write_P(PSTR("Layer: Base\n"), false); | ||
84 | break; | ||
85 | case _RAISE: | ||
86 | oled_write_P(PSTR("B R L A O\n"), false); | ||
87 | oled_write_P(PSTR(" ^\n"), false); | ||
88 | oled_write_P(PSTR("Layer: Raise\n"), false); | ||
89 | break; | ||
90 | case _LOWER: | ||
91 | oled_write_P(PSTR("B R L A O\n"), false); | ||
92 | oled_write_P(PSTR(" ^\n"), false); | ||
93 | oled_write_P(PSTR("Layer: Lower\n"), false); | ||
94 | break; | ||
95 | case _ADJUST: | ||
96 | oled_write_P(PSTR("B R L A O\n"), false); | ||
97 | oled_write_P(PSTR(" ^\n"), false); | ||
98 | oled_write_P(PSTR("Layer: Adjust\n"), false); | ||
99 | break; | ||
100 | default: | ||
101 | oled_write_P(PSTR("B R L A O"), false); | ||
102 | oled_write_P(PSTR(" ^\n"), false); | ||
103 | oled_write_P(PSTR("Layer: Other\n"), false); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | bool oled_task_user(void) { | ||
108 | if (is_keyboard_master()) { | ||
109 | render_status(); | ||
110 | } else { | ||
111 | render_logo(); | ||
112 | oled_scroll_left(); | ||
113 | } | ||
114 | return false; | ||
115 | } | ||
116 | |||
117 | #endif | ||