1 #include QMK_KEYBOARD_H
4 #include "split_util.h"
7 extern keymap_config_t keymap_config;
10 //Following line allows macro to read current RGB settings
11 extern rgblight_config_t rgblight_config;
14 extern uint8_t is_master;
16 // Each layer gets a name for readability, which is then used in the keymap matrix below.
17 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
18 // Layer names don't all need to be of the same length, obviously, and you can also skip them
19 // entirely and just use numbers.
26 enum custom_keycodes {
34 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36 * ,------------------------------------------------. ,------------------------------------------------.
37 * | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bspc |
38 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
39 * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ |
40 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
41 * | Esc | A | S | D | F | G | | | | H | J | K | L | ; | ' |
42 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
43 * | Shift| Z | X | C | V | B | | | | N | M | , | . | / | Shift|
44 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
45 * | Ctrl | Alt | FN | LGui | RGB | Spc | Del | | Bspc | Spc | Adj | LGui | FN | Alt | Ctrl |
46 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
47 * | Spc | Ent | | Ent | Spc |
48 * `-------------' `-------------'
50 [_QWERTY] = LAYOUT_kc( \
51 //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+
52 GRV, 1, 2, 3, 4, 5, MINS, EQL, 6, 7, 8, 9, 0, BSPC,
53 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
54 TAB, Q, W, E, R, T, LBRC, RBRC, Y, U, I, O, P, BSLS,
55 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
56 ESC, A, S, D, F, G, _______, _______, H, J, K, L, SCLN, QUOT,
57 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
58 LSPO, Z, X, C, V, B, _______, _______, N, M, COMM, DOT, SLSH, RSPC,
59 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
60 LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL,
61 //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------|
62 VOLD, VOLU, SPC, ENT, ENT, SPC, DOWN, UP
63 // Rotary Left |--------+--------| |--------+-----------+ Rotary Right
67 * ,------------------------------------------------. ,------------------------------------------------.
68 * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 |
69 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
70 * | | | | Up | | | | | | | | | | | |
71 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
72 * | | | Left | Down | Right| | | | | Play | Next | Mute | V-Up |V-Down| |
73 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
74 * | | | | | | | | | | | | | | | |
75 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
76 * | | | | | | | | | | | | | | | |
77 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
79 * `-------------' `-------------'
82 //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+
83 F1, F2, F3, F4, F5, F6, _______, _______, F7, F8, F9, F10, F11, F12,
84 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
85 _______, _______, _______, UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
86 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
87 _______, _______, LEFT, DOWN, RGHT, _______, _______, _______, MPLY, MNXT, MUTE, VOLD, VOLU, _______,
88 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
89 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
90 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
91 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
92 //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------|
93 VOLD, VOLU, _______, _______, _______, _______, UP, DOWN
94 // Rotary Left |--------+--------| |--------+-----------+ Rotary Right
98 * ,------------------------------------------------. ,------------------------------------------------.
99 * | | | | | | | | | | | | | | | |
100 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
101 * | | Sat+ | Val+ | Hue+ |Speed+|Toggle| | | | | | | | | |
102 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
103 * | | Sat- | Val- | Hue- |Speed-|Reset | | | | |QWERTY| COLE | | | |
104 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
105 * | | | | | | | | | | | | | | | |
106 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
107 * | | | | | | | | | | | | | | | |
108 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
110 * `-------------' `-------------'
114 //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+
115 RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \
116 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
117 _______, RGB_SAI, RGB_VAI, RGB_HUI, RGB_SPI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, \
118 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
119 _______, RGB_SAD, RGB_VAD, RGB_HUD, RGB_SPD, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, \
120 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
121 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
122 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
123 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
124 //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------|
125 _______, _______, _______, _______, _______, _______, _______, _______ \
126 // Rotary Left |--------+--------| |--------+--------+ Rotary Right
131 // define variables for reactive RGB
132 bool TOG_STATUS = false;
133 int RGB_current_mode;
135 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
139 if (record->event.pressed) {
140 set_single_persistent_default_layer(_QWERTY);
145 if (record->event.pressed) {
153 if (record->event.pressed) {
160 //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
162 #ifdef RGBLIGHT_ENABLE
163 if (record->event.pressed) {
164 eeconfig_update_rgblight_default();
166 RGB_current_mode = rgblight_config.mode;
174 void matrix_init_user(void) {
175 #ifdef RGBLIGHT_ENABLE
176 RGB_current_mode = rgblight_config.mode;
182 #ifdef OLED_DRIVER_ENABLE
184 oled_rotation_t oled_init_user(oled_rotation_t rotation) {
186 return OLED_ROTATION_180; // flip 180 for offhand
190 static void render_logo(void) {
191 static const char PROGMEM sol_logo[] = {
192 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
193 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
194 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
196 oled_write_P(sol_logo, false);
199 //assign the right code to your layers for OLED display
201 #define L_FN (1<<_FN)
202 #define L_ADJ (1<<_ADJ)
203 #define L_ADJ_TRI (L_ADJ|L_FN)
205 static void render_status(void) {
206 // Render to mode icon
207 static const char PROGMEM mode_logo[4][4] = {
211 {0xb7,0xb8,0x0a,0} };
213 if (keymap_config.swap_lalt_lgui != false) {
214 oled_write_P(mode_logo[0], false);
215 oled_write_P(mode_logo[1], false);
217 oled_write_P(mode_logo[2], false);
218 oled_write_P(mode_logo[3], false);
221 // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
223 oled_write_P(PSTR("Layer: "), false);
224 switch (layer_state) {
226 oled_write_P(PSTR("Laser \n"), false);
229 oled_write_P(PSTR("Function \n"), false);
233 oled_write_P(PSTR("Adjustment\n"), false);
236 oled_write_P(PSTR("Undefined \n"), false);
239 // Host Keyboard LED Status
240 uint8_t led_usb_state = host_keyboard_leds();
241 oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("NUMLOCK ") : PSTR(" "), false);
242 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPS ") : PSTR(" "), false);
243 oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCLK ") : PSTR(" "), false);
246 void oled_task_user(void) {