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 // Each layer gets a name for readability, which is then used in the keymap matrix below.
15 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
16 // Layer names don't all need to be of the same length, obviously, and you can also skip them
17 // entirely and just use numbers.
24 enum custom_keycodes {
32 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34 * ,------------------------------------------------. ,------------------------------------------------.
35 * | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bspc |
36 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
37 * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ |
38 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
39 * | Esc | A | S | D | F | G | | | | H | J | K | L | ; | ' |
40 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
41 * | Shift| Z | X | C | V | B | | | | N | M | , | . | / | Shift|
42 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
43 * | Ctrl | Alt | FN | LGui | RGB | Spc | Del | | Bspc | Spc | Adj | LGui | FN | Alt | Ctrl |
44 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
45 * | Spc | Ent | | Ent | Spc |
46 * `-------------' `-------------'
48 [_QWERTY] = LAYOUT_kc( \
49 //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+
50 GRV, 1, 2, 3, 4, 5, MINS, EQL, 6, 7, 8, 9, 0, BSPC,
51 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
52 TAB, Q, W, E, R, T, LBRC, RBRC, Y, U, I, O, P, BSLS,
53 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
54 ESC, A, S, D, F, G, _______, _______, H, J, K, L, SCLN, QUOT,
55 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
56 LSPO, Z, X, C, V, B, _______, _______, N, M, COMM, DOT, SLSH, RSPC,
57 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
58 LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL,
59 //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------|
61 // |--------+--------| |--------+-----------+
65 * ,------------------------------------------------. ,------------------------------------------------.
66 * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 |
67 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
68 * | | | | Up | | | | | | | | | | | |
69 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
70 * | | | Left | Down | Right| | | | | Play | Next | Mute | V-Up |V-Down| |
71 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
72 * | | | | | | | | | | | | | | | |
73 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
74 * | | | | | | | | | | | | | | | |
75 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
77 * `-------------' `-------------'
80 //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+
81 F1, F2, F3, F4, F5, F6, _______, _______, F7, F8, F9, F10, F11, F12,
82 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
83 _______, _______, _______, UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
84 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
85 _______, _______, LEFT, DOWN, RGHT, _______, _______, _______, MPLY, MNXT, MUTE, VOLD, VOLU, _______,
86 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
87 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
88 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
89 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
90 //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------|
91 _______, _______, _______, _______
92 // |--------+--------| |--------+-----------+
96 * ,------------------------------------------------. ,------------------------------------------------.
97 * | | | | | | | | | | | | | | | |
98 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
99 * | | Sat+ | Val+ | Hue+ |Speed+|Toggle| | | | | | | | | |
100 * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------|
101 * | | Sat- | Val- | Hue- |Speed-|Reset | | | | |QWERTY| COLE | | | |
102 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
103 * | | | | | | | | | | | | | | | |
104 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
105 * | | | | | | | | | | | | | | | |
106 * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
108 * `-------------' `-------------'
112 //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+
113 RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \
114 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
115 _______, RGB_SAI, RGB_VAI, RGB_HUI, RGB_SPI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, \
116 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
117 _______, RGB_SAD, RGB_VAD, RGB_HUD, RGB_SPD, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, \
118 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
119 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
120 //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------|
121 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
122 //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------|
123 _______, _______, _______, _______ \
124 // |--------+--------| |--------+--------+
129 // define variables for reactive RGB
130 bool TOG_STATUS = false;
131 int RGB_current_mode;
133 #ifdef ENCODER_ENABLE
134 void encoder_update_user(uint8_t index, bool clockwise) {
135 if (index == 0) { /* First encoder */
141 } else if (index == 1) { /* Second encoder*/
151 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
155 if (record->event.pressed) {
156 set_single_persistent_default_layer(_QWERTY);
161 if (record->event.pressed) {
169 if (record->event.pressed) {
176 //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
178 #ifdef RGBLIGHT_ENABLE
179 if (record->event.pressed) {
180 eeconfig_update_rgblight_default();
182 RGB_current_mode = rgblight_config.mode;
190 void matrix_init_user(void) {
191 #ifdef RGBLIGHT_ENABLE
192 RGB_current_mode = rgblight_config.mode;
198 #ifdef OLED_DRIVER_ENABLE
200 oled_rotation_t oled_init_user(oled_rotation_t rotation) {
201 if (!is_keyboard_master())
202 return OLED_ROTATION_180; // flip 180 for offhand
206 static void render_logo(void) {
207 static const char PROGMEM sol_logo[] = {
208 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
209 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
210 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
212 oled_write_P(sol_logo, false);
215 //assign the right code to your layers for OLED display
217 #define L_FN (1<<_FN)
218 #define L_ADJ (1<<_ADJ)
219 #define L_ADJ_TRI (L_ADJ|L_FN)
221 static void render_status(void) {
222 // Render to mode icon
223 static const char PROGMEM mode_logo[4][4] = {
227 {0xb7,0xb8,0x0a,0} };
229 if (keymap_config.swap_lalt_lgui != false) {
230 oled_write_P(mode_logo[0], false);
231 oled_write_P(mode_logo[1], false);
233 oled_write_P(mode_logo[2], false);
234 oled_write_P(mode_logo[3], false);
237 // 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
239 oled_write_P(PSTR("Layer: "), false);
240 switch (layer_state) {
242 oled_write_P(PSTR("Laser \n"), false);
245 oled_write_P(PSTR("Function \n"), false);
249 oled_write_P(PSTR("Adjustment\n"), false);
252 oled_write_P(PSTR("Undefined \n"), false);
255 // Host Keyboard LED Status
256 uint8_t led_usb_state = host_keyboard_leds();
257 oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("NUMLOCK ") : PSTR(" "), false);
258 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPS ") : PSTR(" "), false);
259 oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCLK ") : PSTR(" "), false);
262 void oled_task_user(void) {
263 if (is_keyboard_master())