diff options
Diffstat (limited to 'keyboards/crkbd/keymaps/thunderbird2086')
-rw-r--r-- | keyboards/crkbd/keymaps/thunderbird2086/config.h | 95 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/thunderbird2086/layers_block.h | 89 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/thunderbird2086/oled.c | 298 |
3 files changed, 482 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/thunderbird2086/config.h b/keyboards/crkbd/keymaps/thunderbird2086/config.h new file mode 100644 index 0000000000..41e5c3ff43 --- /dev/null +++ b/keyboards/crkbd/keymaps/thunderbird2086/config.h @@ -0,0 +1,95 @@ +// Copyright 2021 Allen Choi (@thunderbird2086) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define EE_HANDS +#define SPLIT_USB_DETECT + +// #define RGB_LAYER_ENABLE + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD + +#if defined(TAPPING_TERM) +# undef TAPPING_TERM +#endif +#define TAPPING_TERM 200 + +#define NO_ACTION_ONESHOT + +#if defined(OLED_ENABLE) +# define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_LED_STATE_ENABLE +# define SPLIT_MODS_ENABLE +# define SPLIT_OLED_ENABLE +# define OLED_FONT_H "keyboards/crkbd/keymaps/thunderbird2086/glcdfont.c" +# undef OLED_TIMEOUT + // due to timer_read() for render_prompt(), we have own implementation of oled time out +# define OLED_KEY_TIMEOUT 30000 +# define KEY_LOG_ENABLE +#endif + +#define RGBLIGHT_SLEEP + +#if defined(RGBLIGHT_ENABLE) +# define RGBLIGHT_LIMIT_VAL 150 +# define RGBLIGHT_HUE_STEP 16 +# define RGBLIGHT_SAT_STEP 32 +# define RGBLIGHT_VAL_STEP 32 + +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_KNIGHT +#endif + +#if defined(RGB_MATRIX_ENABLE) +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 + // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. +# define RGB_MATRIX_HUE_STEP 32 +# define RGB_MATRIX_SAT_STEP 64 +# define RGB_MATRIX_VAL_STEP 64 +# define RGB_MATRIX_SPD_STEP 20 +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR + +/* Disable the animations you don't want/need. You will need to disable a good number of these * + * because they take up a lot of space. Disable until you can successfully compile your firmware. */ +# undef ENABLE_RGB_MATRIX_ALPHAS_MODS +# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_BREATHING +# undef ENABLE_RGB_MATRIX_BAND_SAT +# undef ENABLE_RGB_MATRIX_BAND_VAL +# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# undef ENABLE_RGB_MATRIX_DUAL_BEACON +# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON +# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# undef ENABLE_RGB_MATRIX_RAINDROPS +# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP +# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# undef ENABLE_RGB_MATRIX_MULTISPLASH +# undef ENABLE_RGB_MATRIX_SOLID_SPLASH +# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif diff --git a/keyboards/crkbd/keymaps/thunderbird2086/layers_block.h b/keyboards/crkbd/keymaps/thunderbird2086/layers_block.h new file mode 100644 index 0000000000..ba41cd9223 --- /dev/null +++ b/keyboards/crkbd/keymaps/thunderbird2086/layers_block.h @@ -0,0 +1,89 @@ +// Copyright 2021 Allen Choi (@thunderbird2086) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "keycodes.h" +#include "tap_dances.h" + +// Layout blocks +#define ___________________COLEMAK_DH_L1_______________ KC_Q , KC_W , KC_F , KC_P , KC_B +#define ___________________COLEMAK_DH_L2_______________ CTL_A , KC_R , KC_S , M_LOPT_T, KC_G +#define ___________________COLEMAK_DH_L3_______________ SFT_Z , KC_X , KC_C , KC_D , KC_V + +#define ___________________COLEMAK_DH_R1_______________ KC_J , KC_L , KC_U , KC_Y , KC_SCLN +#define ___________________COLEMAK_DH_R2_______________ KC_M , RCMD_N , KC_E , KC_I , CTL_O +#define ___________________COLEMAK_DH_R3_______________ KC_K , KC_H , KC_COMM , KC_DOT , SFT_SLSH + +#define ___________________QWERTY_L1___________________ KC_Q , KC_W , KC_E , KC_R , KC_T +#define ___________________QWERTY_L2___________________ CTL_A , KC_S , KC_D , M_LOPT_F, KC_G +#define ___________________QWERTY_L3___________________ SFT_Z , KC_X , KC_C , KC_V , KC_B + +#define ___________________QWERTY_R1___________________ KC_Y , KC_U , KC_I , KC_O , KC_P +#define ___________________QWERTY_R2___________________ KC_H , RCMD_J , KC_K , KC_L , CTL_SCLN +#define ___________________QWERTY_R3___________________ KC_N , KC_M , KC_COMM , KC_DOT , SFT_SLSH + +#define ___________________COLEMAK_L1__________________ KC_Q , KC_W , KC_F , KC_P , KC_G +#define ___________________COLEMAK_L2__________________ CTL_A , KC_R , KC_S , M_LOPT_T, KC_D +#define ___________________COLEMAK_L3__________________ SFT_Z , KC_X , KC_C , KC_V , KC_B + +#define ___________________COLEMAK_R1__________________ KC_J , KC_L , KC_U , KC_Y , KC_SCLN +#define ___________________COLEMAK_R2__________________ KC_H , RCMD_N , KC_E , KC_I , CTL_O +#define ___________________COLEMAK_R3__________________ KC_K , KC_M , KC_COMM , KC_DOT , SFT_SLSH + +#define ___________________NUM_LEFT____________________ KC_1 , KC_2 , KC_3 , KC_4 , KC_5 +#define ___________________NUM_RIGHT___________________ KC_6 , KC_7 , KC_8 , KC_9 , KC_0 + +#define ___________________FUNC_LEFT___________________ KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 +#define ___________________FUNC_RIGHT__________________ KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 + +#define ________________________SYMBOL_L1________________________ KC_TILD , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC +#define ________________________SYMBOL_L2________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX + +#define ________________________SYMBOL_R1________________________ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , KC_PIPE +#define ________________________SYMBOL_R2________________________ XXXXXXX , KC_LCBR , KC_RCBR , KC_LBRC , KC_RBRC , KC_PLUS + + +#define ________________________ADJUST_L1________________________ QK_BOOT , XXXXXXX , KC_PWR , KC_WAKE , KC_SLEP , XXXXXXX + +#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) +# define ________________________ADJUST_L2________________________ RGBRST , XXXXXXX , RGB_SPI , RGB_SAI , RGB_HUI , RGB_VAI +# define ________________________ADJUST_L3________________________ EE_CLR , XXXXXXX , RGB_SPD , RGB_SAD , RGB_HUD , RGB_VAD +#else +# define ________________________ADJUST_L2________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX +# define ________________________ADJUST_L3________________________ EE_CLR , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX +#endif + +#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) +# define ________________________ADJUST_R1________________________ RGB_TOG , XXXXXXX , XXXXXXX , XXXXXXX , COLEMAK , QWERTY +# define ________________________ADJUST_R3________________________ RGB_MOD , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX +#else +# define ________________________ADJUST_R1________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , COLEMAK , QWERTY +# define ________________________ADJUST_R3________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX +#endif +#define ________________________ADJUST_R2________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX + +#define ________________________SECRET_L1________________________ M_XXX1 , XXXXXXX , M_XXX3 , XXXXXXX , M_XXX5 , XXXXXXX +#define ________________________SECRET_L2________________________ XXXXXXX , M_XXX2 , XXXXXXX , M_XXX4 , XXXXXXX , XXXXXXX +#define ________________________SECRET_L3________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX + +#define ________________________SECRET_R1________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX +#define ________________________SECRET_R2________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX +#define ________________________SECRET_R3________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX + +#define _______________NAV_1_________________ KC_LEFT , KC_UP , KC_RGHT , KC_PGUP +#define _______________NAV_2_________________ KC_HOME , KC_DOWN , KC_END , KC_PGDN + +#define _______________MOUSE_1_______________ KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_D +#define _______________MOUSE_2_______________ KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_U + +#define ____________________MEDIA_1____________________ KC_BRMU , KC_MFFD , KC_MPLY , KC_VOLU , K_BACK +#define ____________________MEDIA_2____________________ KC_BRMD , KC_MRWD , KC_MUTE , KC_VOLD , K_FWRD + +#define _________MOD_LEFT__________ T_GUI , FCT_DEL , RAI_SPC +#define _________MOD_RIGHT_________ RAI_ENT , FCT_BSP , KC_ROPT +#define _______MOD_TRNS_LEFT_______ KC_TRNS , T_ESC , XXXXXXX +#define _______MOD_TRNS_RIGHT______ XXXXXXX , T_ESC , KC_TRNS + +// Layout wrappers +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) diff --git a/keyboards/crkbd/keymaps/thunderbird2086/oled.c b/keyboards/crkbd/keymaps/thunderbird2086/oled.c new file mode 100644 index 0000000000..108f3e0cdd --- /dev/null +++ b/keyboards/crkbd/keymaps/thunderbird2086/oled.c @@ -0,0 +1,298 @@ +// Copyright 2021 Allen Choi (@thunderbird2086) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H +#include "keycodes.h" + + +// 5x3 Logos +void render_qmk_logo(void) { + static const char PROGMEM font_qmk_logo[16] = { + 0x80, 0x81, 0x82, 0x83, 0x84, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, + 0 + }; + oled_write_P(font_qmk_logo, false); +}; + +// 5x2 Keyboard, Controller logos +void render_kb_split(void) { + static const char PROGMEM font_kb_split[11] = { + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, + 0 + }; + oled_write_P(font_kb_split, false); +}; + +// 5x1 Layer indicator + +void render_layer(void) { + static const char PROGMEM font_layer[4][6] = { + {0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0}, + {0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0}, + {0xda, 0xdb, 0xdc, 0xdd, 0xde, 0}, + {0x95, 0x96, 0x97, 0x98, 0x99, 0}, + }; + + uint8_t layer = 0; + if (layer_state_is(_FUNCTION)) { + layer = 1; + } else if (layer_state_is(_CODE)) { + layer = 2; + } else if (layer_state_is(_ADJUST)) { + layer = 3; + } + oled_write_P(font_layer[layer], false); +}; + + +void render_layers(void) { + static const char PROGMEM font_layers[4][16] = { + {0x20, 0x85, 0x86, 0x87, 0x20, + 0x20, 0xa5, 0xa6, 0xa7, 0x20, + 0x20, 0xc5, 0xc6, 0xc7, 0x20, + 0}, + {0x20, 0x88, 0x89, 0x8a, 0x20, + 0x20, 0xa8, 0xa9, 0xaa, 0x20, + 0x20, 0xc8, 0xc9, 0xca, 0x20, + 0}, + {0x20, 0x8b, 0x8c, 0x8d, 0x20, + 0x20, 0xab, 0xac, 0xad, 0x20, + 0x20, 0xcb, 0xcc, 0xcd, 0x20, + 0}, + {0x20, 0x8e, 0x8f, 0x90, 0x20, + 0x20, 0xae, 0xaf, 0xb0, 0x20, + 0x20, 0xce, 0xcf, 0xd0, 0x20, + 0}, + }; + + uint8_t layer = 0; + if (layer_state_is(_FUNCTION)) { + layer = 1; + } else if (layer_state_is(_CODE)) { + layer = 2; + } else if (layer_state_is(_ADJUST)) { + layer = 3; + } + oled_write_P(font_layers[layer], false); +}; + +#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) + +void render_rgb_status(void) { + static const char PROGMEM font_rgb_off[3] = {0xd1, 0xd2, 0}; + static const char PROGMEM font_rgb_on[3] = {0xd3, 0xd4, 0}; + bool rgb_enabled = +# if defined(RGBLIGHT_ENABLE) + rgblight_is_enabled(); +# elif defined(RGB_MATRIX_ENABLE) + rgb_matrix_is_enabled(); +# endif + + oled_write_P(rgb_enabled ? font_rgb_on : font_rgb_off, false); +}; +#endif + +// 2x1 Ctrl, Alt, Shift, GUI, Caps + +void render_mod_ctrl(void) { + static const char PROGMEM font_ctrl[3] = {0x91, 0x92, 0}; + oled_write_P(font_ctrl, false); +}; + +void render_mod_alt(void) { + static const char PROGMEM font_alt[3] = {0xb1, 0xb2, 0}; + oled_write_P(font_alt, false); +}; + +void render_mod_shift(void) { + static const char PROGMEM font_shift[3] = {0xb3, 0xb4, 0}; + oled_write_P(font_shift, false); +}; + +void render_mod_gui(void) { + static const char PROGMEM font_gui[3] = {0x93, 0x94, 0}; + oled_write_P(font_gui, false); +}; + +void render_caps_lock(void) { + static const char PROGMEM font_caps[3] = {0x9f, 0xbf, 0}; + oled_write_P(font_caps, false); +}; + + +// 5x2 Mod and feature indicator clusters + +void render_mod_status(void) { +#if defined(NO_ACTION_ONESHOT) + uint8_t modifiers = get_mods(); +#else + uint8_t modifiers = get_mods() | get_oneshot_mods(); +#endif + + (modifiers & MOD_MASK_CTRL) ? render_mod_ctrl() : oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(" "), false); + (modifiers & MOD_MASK_SHIFT) ? render_mod_shift() : oled_write_P(PSTR(" "), false); + + (modifiers & MOD_MASK_ALT) ? render_mod_alt() : oled_write_P(PSTR(" "), false); + oled_write_P(PSTR(" "), false); + (modifiers & MOD_MASK_GUI) ? render_mod_gui() : oled_write_P(PSTR(" "), false); + + led_t led_state = host_keyboard_led_state(); + (led_state.caps_lock) ? render_caps_lock() : oled_write_P(PSTR(" "), false); +} + +void render_feature_status(void) { +#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) + render_rgb_status(); +#endif +}; + +// Keylogger +#define KEYLOGGER_LENGTH 5 +static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; +// clang-format off +static const char PROGMEM code_to_name[0xFF] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', // 0x + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', // 1x + '3', '4', '5', '6', '7', '8', '9', '0', 20, 19, 27, 26, 22, '-', '=', '[', // 2x + ']','\\', '#', ';','\'', '`', ',', '.', '/', 128, ' ', ' ', ' ', ' ', ' ', ' ', // 3x + ' ', ' ', ' ', ' ', ' ', ' ', 'P', 'S', ' ', ' ', ' ', ' ', 16, ' ', ' ', ' ', // 4x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 5x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 6x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 8x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 9x + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ax + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Bx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Cx + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Dx + 'C', 'S', 'A', 'C', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // Ex + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // Fx +}; + + +#if defined(KEY_LOG_ENABLE) +void add_keylog(uint16_t keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) + || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) + || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { + keycode = keycode & 0xFF; + } else if (keycode > 0xFF) { + keycode = 0; + } + + for (uint8_t i = (KEYLOGGER_LENGTH - 1); i > 0; --i) { + keylog_str[i] = keylog_str[i - 1]; + } + + if (keycode < ARRAY_SIZE(code_to_name)) { + keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); + } +} +#endif + +static uint16_t key_timer = 0; +static bool is_key_processed = true; +bool process_record_oled(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + key_timer = timer_read(); + is_key_processed = true; + +# if defined(KEY_LOG_ENABLE) + add_keylog(keycode); +#endif + } + + return true; +} + + +void render_keylogger_status(void) { + oled_write(keylog_str, false); +} + + +void render_prompt(void) { + bool blink = (timer_read() % 1000) < 500; + + if (layer_state_is(_FUNCTION)) { + oled_write_ln_P(blink ? PSTR("> ft_") : PSTR("> ft "), false); + } else if (layer_state_is(_CODE)) { + oled_write_ln_P(blink ? PSTR("> sy_") : PSTR("> sy "), false); + } else if (layer_state_is(_ADJUST)) { + oled_write_ln_P(blink ? PSTR("> aj_") : PSTR("> aj "), false); + } else { + oled_write_ln_P(blink ? PSTR("> _ ") : PSTR("> "), false); + } +}; + + +void render_status_secondary(void) { + oled_write_ln("", false); + oled_write_ln("", false); + + render_kb_split(); + + oled_write_ln("", false); + oled_write_ln("", false); + oled_write_ln("", false); + + render_layer(); + + oled_write_ln("", false); + oled_write_ln("", false); + oled_write_ln("", false); + +#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE) + layer_state_is(_ADJUST) ? render_feature_status() : render_mod_status(); +#else + render_mod_status(); +#endif +}; + + +void render_status_main(void) { + oled_write_ln("", false); + oled_write_ln("", false); + + render_qmk_logo(); + + oled_write_ln("", false); + oled_write_ln("", false); + + render_layers(); + + oled_write_ln("", false); + oled_write_ln("", false); + + render_prompt(); + + oled_write_ln("", false); + + render_keylogger_status(); +} + + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + + +bool oled_task_user(void) { + if (is_keyboard_master()) { + if (is_key_processed && (timer_elapsed(key_timer) < OLED_KEY_TIMEOUT)) { + render_status_main(); + } else if (is_key_processed) { + is_key_processed = false; + oled_off(); + } + } else { + render_status_secondary(); + } + + return false; +} |