qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

v1.c (21593B)


      1 // Copyright 2023 Andrian (@PoringH)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 
      4 #include QMK_KEYBOARD_H
      5 
      6 enum { MAIN = 0, SECOND = 1, THIRD = 2, FOURTH = 3 };
      7 
      8 #ifdef ENCODER_ENABLE
      9 bool encoder_update_kb(uint8_t index, bool clockwise) {
     10     if (!encoder_update_user(index, clockwise)) {
     11         return false;
     12     }
     13     switch (get_highest_layer(layer_state)) {
     14         default:
     15             if (clockwise) {
     16                 tap_code(KC_VOLU);
     17             } else {
     18                 tap_code(KC_VOLD);
     19             }
     20         case SECOND:
     21             if (clockwise) {
     22                 tap_code(KC_MNXT);
     23             } else {
     24                 tap_code(KC_MPRV);
     25             }
     26             break;
     27         case THIRD:
     28             if (clockwise) {
     29                 tap_code(MS_RGHT);
     30             } else {
     31                 tap_code(MS_LEFT);
     32             }
     33             break;
     34         case FOURTH:
     35             if (clockwise) {
     36                 tap_code(MS_UP);
     37             } else {
     38                 tap_code(MS_DOWN);
     39             }
     40             break;
     41     }
     42     return true;
     43 }
     44 #endif
     45 
     46 #ifdef OLED_ENABLE
     47 #    define KB_STAT_SIZE 18
     48 #    define WIN_STAT_SIZE 12
     49 #    define MIN_WALK_SPEED 10
     50 #    define MIN_RUN_SPEED 40
     51 #    define ANIM_FRAME_DURATION 200
     52 #    define ANIM_SIZE 96
     53 
     54 uint32_t anim_timer    = 0;
     55 uint8_t  current_frame = 0;
     56 int      current_wpm   = 0;
     57 led_t    led_usb_state;
     58 
     59 bool isguiDisabled = false;
     60 bool isSneaking    = false;
     61 bool isJumping     = false;
     62 bool showedJump    = true;
     63 
     64 #    ifdef OLED_ENABLE
     65 
     66 static void render_animation(int ANIM_X, int ANIM_Y) {
     67     // sit animation 32 X 22
     68     static const char PROGMEM sit[2][3][ANIM_SIZE] = {{
     69                                                           {
     70                                                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c, 0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     71                                                           },
     72                                                           {
     73                                                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x68, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     74                                                           },
     75                                                           {
     76                                                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28, 0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     77                                                           },
     78                                                       },
     79 
     80                                                       {{
     81                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c, 0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     82                                                        },
     83                                                        {0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x90, 0x08, 0x18, 0x60, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0e, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
     84                                                        {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28, 0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
     85 
     86                                                       }};
     87 
     88     // walk animation 32 X 22
     89     static const char PROGMEM walk[2][3][ANIM_SIZE] = {{{
     90                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x90, 0x90, 0x90, 0xa0, 0xc0, 0x80, 0x80, 0x80, 0x70, 0x08, 0x14, 0x08, 0x90, 0x10, 0x10, 0x08, 0xa4, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00,
     91                                                         },
     92                                                         {
     93                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0xea, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00,
     94                                                         },
     95                                                         {
     96                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x03, 0x06, 0x18, 0x20, 0x20, 0x3c, 0x0c, 0x12, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     97                                                         }},
     98 
     99                                                        {{
    100                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x20, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x28, 0x10, 0x20, 0x20, 0x20, 0x10, 0x48, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
    101                                                         },
    102                                                         {
    103                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x20, 0xf8, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x30, 0xd5, 0x20, 0x1f, 0x00, 0x00, 0x00, 0x00,
    104                                                         },
    105                                                         {
    106                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x02, 0x1c, 0x14, 0x08, 0x10, 0x20, 0x2c, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    107                                                         }
    108 
    109                                                        }};
    110 
    111     // run animation 32 X 22
    112     static const char PROGMEM run[2][3][ANIM_SIZE] = {{{
    113                                                            0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0xc8, 0xb0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00,
    114                                                        },
    115                                                        {
    116                                                            0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0xc4, 0xa4, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x58, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00,
    117                                                        },
    118                                                        {
    119                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x09, 0x04, 0x04, 0x04, 0x04, 0x02, 0x03, 0x02, 0x01, 0x01, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
    120                                                        }},
    121 
    122                                                       {{
    123                                                            0x00, 0x00, 0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x78, 0x28, 0x08, 0x10, 0x20, 0x30, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00,
    124                                                        },
    125                                                        {
    126                                                            0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0xb0, 0x50, 0x55, 0x20, 0x1f, 0x00, 0x00,
    127                                                        },
    128                                                        {
    129                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x1e, 0x20, 0x20, 0x18, 0x0c, 0x14, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    130                                                        }
    131 
    132                                                       }};
    133 
    134     // bark animation 32 X 22
    135     static const char PROGMEM bark[2][3][ANIM_SIZE] = {{
    136                                                            {
    137                                                                0x00, 0xc0, 0x20, 0x10, 0xd0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
    138                                                            },
    139                                                            {
    140                                                                0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
    141                                                            },
    142                                                            {
    143                                                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    144                                                            },
    145                                                        },
    146 
    147                                                        {{
    148                                                             0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x2c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00,
    149                                                         },
    150                                                         {
    151                                                             0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x20, 0x4a, 0x09, 0x10,
    152                                                         },
    153                                                         {
    154                                                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    155                                                         }
    156 
    157                                                        }};
    158 
    159     // sneak animation 32 X 22
    160     static const char PROGMEM sneak[2][3][ANIM_SIZE] = {{
    161                                                             {
    162                                                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    163                                                             },
    164                                                             {
    165                                                                 0x00, 0x00, 0x00, 0x00, 0x1e, 0x21, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x04, 0x04, 0x04, 0x03, 0x01, 0x00, 0x00, 0x09, 0x01, 0x80, 0x80, 0xab, 0x04, 0xf8, 0x00, 0x00, 0x00,
    166                                                             },
    167                                                             {
    168                                                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x02, 0x06, 0x18, 0x20, 0x20, 0x38, 0x08, 0x10, 0x18, 0x04, 0x04, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00,
    169                                                             },
    170                                                         },
    171 
    172                                                         {{
    173                                                              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xa0, 0x20, 0x40, 0x80, 0xc0, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
    174                                                          },
    175                                                          {
    176                                                              0x00, 0x00, 0x00, 0x00, 0x3e, 0x41, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x40, 0x55, 0x82, 0x7c, 0x00, 0x00, 0x00,
    177                                                          },
    178                                                          {
    179                                                              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x04, 0x18, 0x10, 0x08, 0x10, 0x20, 0x28, 0x34, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
    180                                                          }
    181 
    182                                                         }};
    183 
    184     void animate_luna(void) {
    185         int anim_x;
    186         int anim_y;
    187 
    188         if (isJumping || !showedJump) {
    189             oled_set_cursor(ANIM_X, ANIM_Y + 2);
    190             oled_write("     ", false);
    191             anim_x     = ANIM_X;
    192             anim_y     = ANIM_Y - 1;
    193             showedJump = true;
    194         } else {
    195             oled_set_cursor(ANIM_X, ANIM_Y - 1);
    196             oled_write("     ", false);
    197 
    198             anim_x = ANIM_X;
    199             anim_y = ANIM_Y;
    200         }
    201 
    202         if (led_usb_state.caps_lock) {
    203             oled_set_cursor(anim_x, anim_y);
    204             oled_write_raw_P(bark[current_frame][0], ANIM_SIZE);
    205             oled_set_cursor(anim_x, anim_y + 1);
    206             oled_write_raw_P(bark[current_frame][1], ANIM_SIZE);
    207             oled_set_cursor(anim_x, anim_y + 2);
    208             oled_write_raw_P(bark[current_frame][2], ANIM_SIZE);
    209         } else if (get_mods() & MOD_MASK_CS) {
    210             oled_set_cursor(anim_x, anim_y);
    211             oled_write_raw_P(sneak[current_frame][0], ANIM_SIZE);
    212             oled_set_cursor(anim_x, anim_y + 1);
    213             oled_write_raw_P(sneak[current_frame][1], ANIM_SIZE);
    214             oled_set_cursor(anim_x, anim_y + 2);
    215             oled_write_raw_P(sneak[current_frame][2], ANIM_SIZE);
    216         } else if (current_wpm <= MIN_WALK_SPEED) {
    217             oled_set_cursor(anim_x, anim_y);
    218             oled_write_raw_P(sit[current_frame][0], ANIM_SIZE);
    219             oled_set_cursor(anim_x, anim_y + 1);
    220             oled_write_raw_P(sit[current_frame][1], ANIM_SIZE);
    221             oled_set_cursor(anim_x, anim_y + 2);
    222             oled_write_raw_P(sit[current_frame][2], ANIM_SIZE);
    223         } else if (current_wpm <= MIN_RUN_SPEED) {
    224             oled_set_cursor(anim_x, anim_y);
    225             oled_write_raw_P(walk[current_frame][0], ANIM_SIZE);
    226             oled_set_cursor(anim_x, anim_y + 1);
    227             oled_write_raw_P(walk[current_frame][1], ANIM_SIZE);
    228             oled_set_cursor(anim_x, anim_y + 2);
    229             oled_write_raw_P(walk[current_frame][2], ANIM_SIZE);
    230         } else {
    231             oled_set_cursor(anim_x, anim_y);
    232             oled_write_raw_P(run[current_frame][0], ANIM_SIZE);
    233             oled_set_cursor(anim_x, anim_y + 1);
    234             oled_write_raw_P(run[current_frame][1], ANIM_SIZE);
    235             oled_set_cursor(anim_x, anim_y + 2);
    236             oled_write_raw_P(run[current_frame][2], ANIM_SIZE);
    237         }
    238     }
    239 
    240 #        if OLED_TIMEOUT > 0
    241 
    242     if (last_input_activity_elapsed() > OLED_TIMEOUT && last_led_activity_elapsed() > OLED_TIMEOUT) {
    243         oled_off();
    244         return;
    245     } else {
    246         oled_on();
    247     }
    248 #        endif
    249 
    250     if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
    251         anim_timer    = timer_read32();
    252         current_frame = (current_frame + 1) % 2;
    253         animate_luna();
    254     }
    255 };
    256 
    257 static void render_caps(int CAP_X, int CAP_Y) {
    258     if (led_usb_state.caps_lock == true) {
    259         static const char PROGMEM caps[KB_STAT_SIZE] = {
    260             0x00, 0xfe, 0xff, 0x07, 0xfb, 0xfb, 0x3b, 0xdb, 0xeb, 0xdb, 0x3b, 0xfb, 0xfb, 0x07, 0xff, 0xfe, 0x00, 0x00,
    261         };
    262         static const char PROGMEM caps2[KB_STAT_SIZE] = {0x00, 0x3f, 0x7f, 0x70, 0x6f, 0x6f, 0x68, 0x6e, 0x6e, 0x6e, 0x68, 0x6f, 0x6f, 0x70, 0x7f, 0x3f, 0x00, 0x00};
    263         oled_set_cursor(CAP_X, CAP_Y);
    264         oled_write_raw_P(caps, KB_STAT_SIZE);
    265         oled_set_cursor(CAP_X, CAP_Y + 1);
    266         oled_write_raw_P(caps2, KB_STAT_SIZE);
    267     } else {
    268         static const char PROGMEM caps[KB_STAT_SIZE] = {
    269             0x00, 0x00, 0x00, 0xf8, 0x04, 0x04, 0xc4, 0x24, 0x14, 0x24, 0xc4, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00,
    270         };
    271         static const char PROGMEM caps2[KB_STAT_SIZE] = {0x00, 0x00, 0x00, 0x0f, 0x10, 0x10, 0x17, 0x11, 0x11, 0x11, 0x17, 0x10, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00};
    272         oled_set_cursor(CAP_X, CAP_Y);
    273         oled_write_raw_P(caps, KB_STAT_SIZE);
    274         oled_set_cursor(CAP_X, CAP_Y + 1);
    275         oled_write_raw_P(caps2, KB_STAT_SIZE);
    276     }
    277 }
    278 
    279 static void render_num(int NUM_X, int NUM_Y) {
    280     if (led_usb_state.num_lock == true) {
    281         static const char PROGMEM num[KB_STAT_SIZE] = {
    282             0x00, 0xfe, 0xff, 0x07, 0xfb, 0xfb, 0xfb, 0xdb, 0x0b, 0xfb, 0xfb, 0xfb, 0xfb, 0x07, 0xff, 0xfe, 0x00, 0x00,
    283         };
    284         static const char PROGMEM num2[KB_STAT_SIZE] = {0x00, 0x3f, 0x7f, 0x70, 0x6f, 0x6f, 0x6f, 0x6b, 0x68, 0x6b, 0x6f, 0x6f, 0x6f, 0x70, 0x7f, 0x3f, 0x00, 0x00};
    285         oled_set_cursor(NUM_X, NUM_Y);
    286         oled_write_raw_P(num, KB_STAT_SIZE);
    287         oled_set_cursor(NUM_X, NUM_Y + 1);
    288         oled_write_raw_P(num2, KB_STAT_SIZE);
    289     } else {
    290         static const char PROGMEM num[KB_STAT_SIZE] = {
    291             0x00, 0x00, 0x00, 0xf8, 0x04, 0x04, 0x04, 0x24, 0xf4, 0x04, 0x04, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00,
    292         };
    293         static const char PROGMEM num2[KB_STAT_SIZE] = {0x00, 0x00, 0x00, 0x0f, 0x10, 0x10, 0x10, 0x14, 0x17, 0x14, 0x10, 0x10, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00};
    294         oled_set_cursor(NUM_X, NUM_Y);
    295         oled_write_raw_P(num, KB_STAT_SIZE);
    296         oled_set_cursor(NUM_X, NUM_Y + 1);
    297         oled_write_raw_P(num2, KB_STAT_SIZE);
    298     }
    299 }
    300 
    301 static void render_scroll(int SCROLL_X, int SCROLL_Y) {
    302     if (led_usb_state.scroll_lock == true) {
    303         static const char PROGMEM scroll[KB_STAT_SIZE] = {
    304             0x00, 0xfe, 0xff, 0x07, 0xfb, 0xfb, 0x7b, 0xfb, 0x0b, 0xfb, 0x7b, 0xfb, 0xfb, 0x07, 0xff, 0xfe, 0x00, 0x00,
    305         };
    306         static const char PROGMEM scroll2[KB_STAT_SIZE] = {0x00, 0x3f, 0x7f, 0x70, 0x6f, 0x6b, 0x6b, 0x6a, 0x68, 0x6a, 0x6b, 0x6b, 0x6f, 0x70, 0x7f, 0x3f, 0x00, 0x00};
    307         oled_set_cursor(SCROLL_X, SCROLL_Y);
    308         oled_write_raw_P(scroll, KB_STAT_SIZE);
    309         oled_set_cursor(SCROLL_X, SCROLL_Y + 1);
    310         oled_write_raw_P(scroll2, KB_STAT_SIZE);
    311     } else {
    312         static const char PROGMEM scroll[KB_STAT_SIZE] = {
    313             0x00, 0x00, 0x00, 0xf8, 0x04, 0x04, 0x84, 0x04, 0xf4, 0x04, 0x84, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00,
    314         };
    315         static const char PROGMEM scroll2[KB_STAT_SIZE] = {0x00, 0x00, 0x00, 0x0f, 0x10, 0x14, 0x14, 0x15, 0x17, 0x15, 0x14, 0x14, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00};
    316         oled_set_cursor(SCROLL_X, SCROLL_Y);
    317         oled_write_raw_P(scroll, KB_STAT_SIZE);
    318         oled_set_cursor(SCROLL_X, SCROLL_Y + 1);
    319         oled_write_raw_P(scroll2, KB_STAT_SIZE);
    320     }
    321 }
    322 
    323 static void render_winstat(int WIN_X, int WIN_Y) {
    324     static const char PROGMEM winlogo[WIN_STAT_SIZE] = {
    325         0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00,
    326     };
    327     static const char PROGMEM winlogo2[WIN_STAT_SIZE] = {
    328         0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00,
    329     };
    330 
    331     oled_set_cursor(WIN_X, WIN_Y);
    332     oled_write_raw_P(winlogo, WIN_STAT_SIZE);
    333     oled_set_cursor(WIN_X, WIN_Y + 1);
    334     oled_write_raw_P(winlogo2, WIN_STAT_SIZE);
    335 
    336     oled_set_cursor(WIN_X + 2, WIN_Y);
    337     oled_write("WINKEY", false);
    338 
    339     oled_set_cursor(WIN_X + 2, WIN_Y + 1);
    340     if (keymap_config.no_gui) {
    341         oled_write("DISABLED", false);
    342     } else {
    343         oled_write("ENABLED  ", false);
    344     }
    345 }
    346 
    347 bool oled_task_kb(void) {
    348     if (!oled_task_user()) {
    349         return false;
    350     }
    351     current_wpm   = get_current_wpm();
    352     led_usb_state = host_keyboard_led_state();
    353     render_animation(13, 3);
    354     oled_set_cursor(0, 0);
    355     // Host Keyboard Layer Status
    356     switch (get_highest_layer(layer_state)) {
    357         case MAIN:
    358             oled_write("MAIN  ", false);
    359             break;
    360         case SECOND:
    361             oled_write("SECOND", false);
    362             break;
    363         case THIRD:
    364             oled_write("THIRD ", false);
    365             break;
    366         default:
    367             oled_write("FOURTH", false);
    368     }
    369     render_caps(0, 2);
    370     render_num(3, 2);
    371     render_scroll(6, 2);
    372     render_winstat(1, 5);
    373 
    374     oled_set_cursor(12, 0);
    375     oled_write("WPM: ", false);
    376     oled_write(get_u8_str(current_wpm, '0'), false);
    377     return false;
    378 }
    379 
    380 #    endif
    381 
    382 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
    383     switch (keycode) {
    384         case KC_SPC:
    385             if (record->event.pressed) {
    386                 isJumping  = true;
    387                 showedJump = false;
    388             } else {
    389                 isJumping = false;
    390             }
    391             break;
    392     }
    393     return process_record_user(keycode, record);
    394 }
    395 #endif