diff --git a/.envrc b/.envrc new file mode 100644 index 000000000000..051d09d292a8 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" diff --git a/.github/workflows/format_push.yml b/.github/workflows/format_push.yml index 26e9f4edfb02..0a34245ac0dd 100644 --- a/.github/workflows/format_push.yml +++ b/.github/workflows/format_push.yml @@ -47,7 +47,7 @@ jobs: git config user.email 'hello@qmk.fm' - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 if: ${{ github.repository == 'qmk/qmk_firmware'}} with: token: ${{ secrets.QMK_BOT_TOKEN }} diff --git a/.github/workflows/regen_push.yml b/.github/workflows/regen_push.yml index c56bc48a690c..2d77f6fdf2da 100644 --- a/.github/workflows/regen_push.yml +++ b/.github/workflows/regen_push.yml @@ -34,7 +34,7 @@ jobs: git config user.email 'hello@qmk.fm' - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 if: ${{ github.repository == 'qmk/qmk_firmware'}} with: token: ${{ secrets.QMK_BOT_TOKEN }} diff --git a/keyboards/bastardkb/charybdis/3x6/v2/splinky_3/config.h b/keyboards/bastardkb/charybdis/3x6/v2/splinky_3/config.h index e4afc5a866fb..a5ad0b3177b6 100644 --- a/keyboards/bastardkb/charybdis/3x6/v2/splinky_3/config.h +++ b/keyboards/bastardkb/charybdis/3x6/v2/splinky_3/config.h @@ -24,7 +24,7 @@ { GP27, GP28, GP21, GP6, GP7, GP8 } /* Handedness. */ -#define MASTER_RIGHT +#define MASTER_LEFT // To use the handedness pin, resistors need to be installed on the adapter PCB. // If so, uncomment the following code, and undefine MASTER_RIGHT above. diff --git a/keyboards/bastardkb/charybdis/4x6/4x6.h b/keyboards/bastardkb/charybdis/4x6/4x6.h index 0d8810266e9b..b7061ca63493 100644 --- a/keyboards/bastardkb/charybdis/4x6/4x6.h +++ b/keyboards/bastardkb/charybdis/4x6/4x6.h @@ -26,19 +26,19 @@ k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ k30, k31, k32, k33, k34, k35, k85, k84, k83, k82, k81, k80, \ - k43, k44, k41, k91, k93, \ - k45, k42, k95 \ + k93, k91, k41, k44, k43, \ + k95, k42, k45 \ ) \ { \ { k00, k01, k02, k03, k04, k05 }, \ { k10, k11, k12, k13, k14, k15 }, \ { k20, k21, k22, k23, k24, k25 }, \ { k30, k31, k32, k33, k34, k35 }, \ - { KC_NO, k41, k42, k43, k44, k45 }, \ + { KC_NO, k91, KC_NO, k93, KC_NO, k95 }, \ { k50, k51, k52, k53, k54, k55 }, \ { k60, k61, k62, k63, k64, k65 }, \ { k70, k71, k72, k73, k74, k75 }, \ { k80, k81, k82, k83, k84, k85 }, \ - { KC_NO, k91, KC_NO, k93, KC_NO, k95 }, \ + { KC_NO, k41, k42, k43, k44, k45 }, \ } // clang-format on diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/keymap.c b/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/keymap.c new file mode 100644 index 000000000000..dcec3e5ac469 --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/keymap.c @@ -0,0 +1,85 @@ +/** + * Copyright 2021 Charly Delay (@0xcharly) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +enum charybdis_keymap_layers { + LAYER_BASE = 0, + LAYER_LOWER, + LAYER_RAISE, +}; + +#define LOWER MO(LAYER_LOWER) +#define RAISE MO(LAYER_RAISE) + +// Tap Dance Declarations +enum { TD_UNDS_PIPE = 0, TD_LCBR_LBRC, TD_RCBR_RBRC, TD_NEXT_PLAY, SLSH_BSLS }; + +// Home mod row (kinda) +// Home mod row (kinda) +tap_dance_action_t tap_dance_actions[] = {[TD_UNDS_PIPE] = ACTION_TAP_DANCE_DOUBLE(KC_UNDS, KC_PIPE), [TD_LCBR_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_LBRC), [TD_RCBR_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RCBR, KC_RBRC), [TD_NEXT_PLAY] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_MPLY), [SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS)}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [LAYER_BASE] = LAYOUT_charybdis_4x6( + // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + KC_ESC,LSFT_T(KC_A),LCTL_T(KC_S),LALT_T(KC_D),KC_F,KC_G, KC_H,KC_J,LALT_T(KC_K), LCTL_T(KC_L), LSFT_T(KC_SCLN), KC_BSPC, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + TD(SLSH_BSLS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(TD_UNDS_PIPE), + // ╰──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────╯ + KC_RGUI, LOWER, RAISE, KC_RGUI, TD(TD_NEXT_PLAY), + KC_ENT, KC_SPC, KC_RALT +// ╰───────────────────────────╯ ╰──────────────────╯ + /* KC_LGUI, KC_SPC, LOWER, RAISE, KC_ENT, */ + /* KC_LALT, KC_BSPC, KC_DEL */ + /* // ╰───────────────────────────╯ ╰──────────────────╯ */ + ), + + [LAYER_LOWER] = LAYOUT_charybdis_4x6( + // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + RGB_MOD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_RBRC, XXXXXXX, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + RGB_TOG, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PPLS, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_DEL, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, EE_CLR, QK_BOOT, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, KC_PDOT, + // ╰──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────╯ + _______, XXXXXXX, _______, _______, _______, + _______, _______, KC_P0 + // ╰───────────────────────────╯ ╰──────────────────╯ + ), + + [LAYER_RAISE] = LAYOUT_charybdis_4x6( + // ╭──────────────────────────────────────────────────────╮ ╭──────────────────────────────────────────────────────╮ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, KC_VOLU, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + KC_MPLY, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_RGUI, KC_MUTE, + // ├──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────┤ + KC_MPRV, KC_HOME, KC_PGUP, KC_PGDN, KC_END, XXXXXXX, QK_BOOT, EE_CLR, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, + // ╰──────────────────────────────────────────────────────┤ ├──────────────────────────────────────────────────────╯ + _______, _______, KC_BTN3, _______, _______, + _______, KC_BTN1, KC_BTN2 + // ╰───────────────────────────╯ ╰──────────────────╯ + ), +}; +// clang-format on diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/readme.md b/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/readme.md new file mode 100644 index 000000000000..23a85e54d517 --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/readme.md @@ -0,0 +1,7 @@ +# Charybdis (4x6) default keymap + +> :bulb: Have a look at the [`via` keymap](../via) for a more feature-rich layout. + +The Charydbis (4x6) default keymap is inspired from the original [Dactyl Manuform](../../../../../handwired/dactyl_manuform) default keymap. + +This layout supports RGB matrix. However, due to space constraints on the MCU, only a limited number of effect can be enabled at once. Look at the `config.h` file and enable your favorite effect. diff --git a/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/rules.mk b/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/rules.mk new file mode 100644 index 000000000000..c84dd34fbf24 --- /dev/null +++ b/keyboards/bastardkb/charybdis/4x6/keymaps/wonderbeat/rules.mk @@ -0,0 +1,29 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output + +AUDIO_SUPPORTED = no # Audio is not supported +RGB_MATRIX_SUPPORTED = no # RGB matrix is supported and enabled by default +RGBLIGHT_SUPPORTED = no # RGB underglow is supported, but not enabled by default +RGB_MATRIX_ENABLE = no # Enable keyboard RGB matrix functionality +RGB_MATRIX_DRIVER = WS2812 + +SPLIT_KEYBOARD = yes + +POINTING_DEVICE_ENABLE = yes # Enable trackball +POINTING_DEVICE_DRIVER = pmw3360 + +SERIAL_DRIVER = vendor +WS2812_DRIVER = vendor + +TAP_DANCE_ENABLE = yes +CHARYBDIS_MINIMUM_DEFAULT_DPI = 800 diff --git a/keyboards/bastardkb/charybdis/config.h b/keyboards/bastardkb/charybdis/config.h index ced39ef4a1fa..232451acb5ea 100644 --- a/keyboards/bastardkb/charybdis/config.h +++ b/keyboards/bastardkb/charybdis/config.h @@ -18,20 +18,21 @@ #pragma once - /* Pointing device configuration. */ // Enable use of pointing device on slave split. #define SPLIT_POINTING_ENABLE -// Pointing device is on the right split. -#define POINTING_DEVICE_RIGHT +// Pointing device is on the left split. +#define POINTING_DEVICE_LEFT // Limits the frequency that the sensor is polled for motion. #define POINTING_DEVICE_TASK_THROTTLE_MS 1 // Invert X axis on mouse reports. -#define POINTING_DEVICE_INVERT_X +//#define POINTING_DEVICE_INVERT_X + +#define POINTING_DEVICE_INVERT_Y /* RGB matrix support. */ #ifdef RGB_MATRIX_ENABLE diff --git a/keyboards/sofle/keymaps/wonderbeat/config.h b/keyboards/sofle/keymaps/wonderbeat/config.h new file mode 100644 index 000000000000..2d41ca56adb5 --- /dev/null +++ b/keyboards/sofle/keymaps/wonderbeat/config.h @@ -0,0 +1,61 @@ + /* Copyright 2020 Josef Adamcik + * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #pragma once + + /* The way how "handedness" is decided (which half is which), + see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness + for more options. + */ + + /* #define EE_HANDS */ + + #define MASTER_LEFT + + #ifdef RGBLIGHT_ENABLE + # define RGBLIGHT_ANIMATIONS + # define RGBLIGHT_DEFAULT_SPD 12 + #endif + + #define TAPPING_TERM 200 + #define IGNORE_MOD_TAP_INTERRUPT + #define PERMISSIVE_HOLD + + #ifdef RGB_MATRIX_ENABLE + # define RGB_DI_PIN D3 + # define DRIVER_LED_TOTAL 74 + # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended + # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 70 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. + # define RGB_MATRIX_KEYPRESSES + # define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS + # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + # define ENABLE_RGB_MATRIX_PIXEL_FRACTAL + /* # define ENABLE_RGB_MATRIX_MULTISPLASH */ + /* #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINDROPS */ + # define RGB_MATRIX_SPLIT \ + { 37, 37 } + # define RGB_MATRIX_LED_COUNT DRIVER_LED_TOTAL + + #endif + + #define LUNA + + #if defined(OLED_FONT_H) + # undef OLED_FONT_H + #endif + + #define OLED_FONT_H "keyboards/sofle/keymaps/wonderbeat/glcdfont.c" diff --git a/keyboards/sofle/keymaps/wonderbeat/encoder.c b/keyboards/sofle/keymaps/wonderbeat/encoder.c new file mode 100644 index 000000000000..933425f5c983 --- /dev/null +++ b/keyboards/sofle/keymaps/wonderbeat/encoder.c @@ -0,0 +1,55 @@ + /* Copyright 2020 Josef Adamcik + * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +//Setting up what encoder rotation does. If your encoder can be pressed as a button, that function can be set in Via. + +#ifdef ENCODER_ENABLE + +bool encoder_update_user(uint8_t index, bool clockwise) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + bool is_shift = (temp_mod | temp_osm) & MOD_MASK_SHIFT; + bool is_gui = (temp_mod | temp_osm) & MOD_MASK_GUI; + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if(index == 1 && is_shift) { + if (clockwise) { + rgb_matrix_increase_speed(); + } else { + rgb_matrix_decrease_speed(); + } + } else if(index == 1 && is_gui) { + if (clockwise) { + rgblight_increase_val(); + } else { + rgblight_decrease_val(); + } + } else if(index == 1) { + if (clockwise) { + tap_code(KC_BRMD); + } else { + tap_code(KC_BRK); + } + } + return true; +} + +#endif diff --git a/keyboards/sofle/keymaps/wonderbeat/glcdfont.c b/keyboards/sofle/keymaps/wonderbeat/glcdfont.c new file mode 100644 index 000000000000..5596e7137a38 --- /dev/null +++ b/keyboards/sofle/keymaps/wonderbeat/glcdfont.c @@ -0,0 +1,6 @@ +#include "progmem.h" + +// clang-format off +const unsigned char font[] PROGMEM = { +0,0,0,0,0,0,62,91,79,91,62,0,62,107,79,107,62,0,28,62,124,62,28,0,24,60,126,60,24,0,28,87,125,87,28,0,28,94,127,94,28,0,0,24,60,24,0,0,255,231,195,231,255,0,0,24,36,24,0,0,255,231,219,231,255,0,48,72,58,6,14,0,38,41,121,41,38,0,64,127,5,5,7,0,64,127,5,37,63,0,90,60,231,60,90,0,127,62,28,28,8,0,8,28,28,62,127,0,20,34,127,34,20,0,95,95,0,95,95,0,6,9,127,1,127,0,0,102,137,149,106,0,96,96,96,96,96,0,148,162,255,162,148,0,8,4,126,4,8,0,16,32,126,32,16,0,8,8,42,28,8,0,8,28,42,8,8,0,30,16,16,16,16,0,12,30,12,30,12,0,48,56,62,56,48,0,6,14,62,14,6,0,0,0,0,0,0,0,0,0,95,0,0,0,0,7,0,7,0,0,20,127,20,127,20,0,36,42,127,42,18,0,35,19,8,100,98,0,54,73,86,32,80,0,0,8,7,3,0,0,0,28,34,65,0,0,0,65,34,28,0,0,42,28,127,28,42,0,8,8,62,8,8,0,0,128,112,48,0,0,8,8,8,8,8,0,0,0,96,96,0,0,32,16,8,4,2,0,62,81,73,69,62,0,0,66,127,64,0,0,114,73,73,73,70,0,33,65,73,77,51,0,24,20,18,127,16,0,39,69,69,69,57,0,60,74,73,73,49,0,65,33,17,9,7,0,54,73,73,73,54,0,70,73,73,41,30,0,0,0,20,0,0,0,0,64,52,0,0,0,0,8,20,34,65,0,20,20,20,20,20,0,0,65,34,20,8,0,2,1,89,9,6,0,62,65,93,89,78,0,124,18,17,18,124,0,127,73,73,73,54,0,62,65,65,65,34,0,127,65,65,65,62,0,127,73,73,73,65,0,127,9,9,9,1,0,62,65,65,81,115,0,127,8,8,8,127,0,0,65,127,65,0,0,32,64,65,63,1,0,127,8,20,34,65,0,127,64,64,64,64,0,127,2,28,2,127,0,127,4,8,16,127,0,62,65,65,65,62,0,127,9,9,9,6,0,62,65,81,33,94,0,127,9,25,41,70,0,38,73,73,73,50,0,3,1,127,1,3,0,63,64,64,64,63,0,31,32,64,32,31,0,63,64,56,64,63,0,99,20,8,20,99,0,3,4,120,4,3,0,97,89,73,77,67,0,0,127,65,65,65,0,2,4,8,16,32,0,0,65,65,65,127,0,4,2,1,2,4,0,64,64,64,64,64,0,0,3,7,8,0,0,32,84,84,120,64,0,127,40,68,68,56,0,56,68,68,68,40,0,56,68,68,40,127,0,56,84,84,84,24,0,0,8,126,9,2,0,24,36,36,28,120,0,127,8,4,4,120,0,0,68,125,64,0,0,32,64,64,61,0,0,127,16,40,68,0,0,0,65,127,64,0,0,124,4,120,4,120,0,124,8,4,4,120,0,56,68,68,68,56,0,124,24,36,36,24,0,24,36,36,24,124,0,124,8,4,4,8,0,72,84,84,84,36,0,4,4,63,68,36,0,60,64,64,32,124,0,28,32,64,32,28,0,60,64,48,64,60,0,68,40,16,40,68,0,76,144,144,144,124,0,68,100,84,76,68,0,0,8,54,65,0,0,0,0,119,0,0,0,0,65,54,8,0,0,2,1,2,4,2,0,60,38,35,38,60,0,0,0,0,192,192,192,0,0,0,0,128,192,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,240,240,240,224,236,238,247,243,112,32,0,124,124,124,126,0,126,126,126,127,127,127,0,0,128,192,224,126,91,79,91,254,192,0,0,192,0,220,215,222,222,222,215,220,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,15,254,252,255,7,35,252,254,142,6,6,6,254,252,248,0,254,254,128,0,0,0,254,254,254,0,0,254,254,254,6,6,6,0,0,0,0,0,0,254,254,254,6,6,6,254,252,254,6,6,6,254,254,240,0,32,252,254,142,6,6,6,254,252,248,0,254,254,254,6,6,6,254,252,254,6,6,6,254,254,240,0,0,0,0,0,0,0,252,254,6,6,6,6,254,254,254,0,0,226,242,50,50,22,150,254,252,0,2,30,126,248,192,192,248,254,30,2,0,0,15,31,63,127,127,127,127,127,63,30,12,0,31,31,31,63,0,63,63,63,127,127,127,0,48,123,127,120,48,32,32,48,120,127,59,0,3,0,15,127,15,15,15,127,15,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,0,0,1,3,3,3,3,3,3,1,0,0,1,3,3,3,3,3,3,3,3,0,0,3,3,3,0,0,0,0,0,0,0,0,0,3,3,3,0,0,0,3,3,3,0,0,0,3,3,3,0,0,1,3,3,3,3,3,3,1,0,0,3,3,3,0,0,0,3,3,3,0,0,0,3,3,3,0,0,0,0,0,0,0,1,51,51,35,51,51,63,31,7,0,0,1,3,3,3,3,3,3,3,0,0,32,32,57,63,31,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; diff --git a/keyboards/sofle/keymaps/wonderbeat/keymap.c b/keyboards/sofle/keymaps/wonderbeat/keymap.c new file mode 100644 index 000000000000..dc02062fb100 --- /dev/null +++ b/keyboards/sofle/keymaps/wonderbeat/keymap.c @@ -0,0 +1,250 @@ + /* Copyright 2020 Josef Adamcik + * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #include QMK_KEYBOARD_H + #include "oled.c" + #include "encoder.c" + + // Tap Dance Declarations + enum { TD_UNDS_PIPE = 0, TD_LCBR_LBRC, TD_RCBR_RBRC, TD_NEXT_PLAY, SLSH_BSLS }; + + // Home mod row (kinda) + tap_dance_action_t tap_dance_actions[] = {[TD_UNDS_PIPE] = ACTION_TAP_DANCE_DOUBLE(KC_UNDS, KC_PIPE), + [TD_LCBR_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_LBRC), + [TD_RCBR_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RCBR, KC_RBRC), + [TD_NEXT_PLAY] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_MPLY), + [SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS)}; + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | Q | W | E | R | T | | Y | U | I | O | P | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | Bspc | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + +[0] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, /**/ KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, /**/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + KC_ESC, LSFT_T(KC_A), LCTL_T(KC_S), LALT_T(KC_D), KC_F, KC_G, /**/ KC_H, KC_J, LALT_T(KC_K), LCTL_T(KC_L), LSFT_T(KC_SCLN), KC_BSPC, + TD(SLSH_BSLS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, /**/ TG(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSHTD(TD_UNDS_PIPE), + TD(TD_LCBR_LBRC), TD(TD_RCBR_RBRC),MO(2), KC_LGUI, KC_ENT, /**/ KC_SPC, KC_RGUI, MO(3), KC_RALT, TD(TD_NEXT_PLAY)), + /* + * COLEMAK-DH + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | Q | W | F | P | B | | J | L | U | Y | ; | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | TAB | A | R | S | T | G |-------. ,-------| M | N | E | I | O | ' | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * |LShift| Z | X | C | D | V |-------| |-------| K | H | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + [1] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, /**/ KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_Q, KC_W, KC_F, KC_P, KC_B, /**/ KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, + _______, KC_A, LSFT_T(KC_R), LCTL_T(KC_S), LALT_T(KC_T), /**/ KC_G, KC_M, KC_N, LALT_T(KC_E), LCTL_T(KC_I), LSFT_T(KC_O), _______, + _______, KC_Z, KC_X, KC_C, KC_D, KC_V, _______, /**/ _______, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, _______, _______, _______, _______, /**/ _______, _______, _______, _______, _______), + /* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * | Shift| = | - | + | { | } |-------| |-------| [ | ] | ; | : | \ | Shift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + [2] = LAYOUT(_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /**/ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, /**/ KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_UP, KC_MS_ACCEL2, KC_0, KC_F12, + _______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, /**/ KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, /**/ _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______, + _______, _______, _______, _______, _______, /**/ KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_WH_UP, KC_MS_WH_DOWN), + /* RAISE + * ,----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | Ins | Pscr | Menu | | | | | PWrd | Up | NWrd | DLine| Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | LAt | LCtl |LShift| | Caps |-------. ,-------| | Left | Down | Rigth| Del | Bspc | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * |Shift | Undo | Cut | Copy | Paste| |-------| |-------| | LStr | | LEnd | | Shift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + [3] = LAYOUT(_______, _______, _______, _______, _______, _______, /**/ _______, _______, _______, _______, _______, _______, + _______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, /**/ KC_PGUP, _______, KC_UP, _______, _______, KC_BSPC, + _______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, /**/ KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC, + _______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, XXXXXXX, _______, /**/ _______, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, _______, + _______, _______, _______, _______, KC_LPAD, /**/ _______, _______, _______, _______, _______)}; + + #ifdef RGB_MATRIX_ENABLE + // Physical Layout + // Columns + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + // ROWS + // 12 13 22 23 32 33 33 32 23 22 13 12 0 + // 02 03 04 04 03 02 + // 11 14 21 24 31 34 34 31 24 21 14 11 1 + // 01 01 + // 10 15 20 25 30 35 35 30 25 20 15 10 2 + // + // 09 16 19 26 29 36 36 29 26 19 16 09 3 + // + // 08 17 18 27 28 28 27 18 17 08 4 + // (08) 07 06 05 05 06 07 (08) + // + led_config_t g_led_config = {{{12, 13, 22, 23, 32, 33}, {11, 14, 21, 24, 31, 34}, {10, 15, 20, 25, 30, 35}, {9, 16, 19, 26, 29, 36}, {8, 17, 18, 27, 28, NO_LED}, {48, 49, 58, 59, 68, 69}, {47, 50, 57, 60, 67, 70}, {46, 51, 56, 61, 66, 71}, {45, 52, 55, 62, 65, 72}, {44, 53, 54, 63, 64, NO_LED}}, + { + // Left side underglow + {96, 40}, + {16, 20}, + {48, 10}, + {80, 18}, + {88, 60}, + {56, 57}, + {24, 60}, + {10, 60}, + // Left side Matrix + {32, 57}, + {0, 48}, + {0, 36}, + {0, 24}, + {0, 12}, + {16, 12}, + {16, 24}, + {16, 36}, + {16, 48}, + {48, 55}, + {64, 57}, + {32, 45}, + {32, 33}, + {32, 21}, + {32, 9}, + {48, 7}, + {48, 19}, + {48, 31}, + {48, 43}, + {80, 59}, + {96, 64}, + {64, 45}, + {64, 33}, + {64, 21}, + {64, 9}, + {80, 10}, + {80, 22}, + {80, 34}, + {80, 47}, + + // Right side underglow + {128, 40}, + {208, 20}, + {176, 10}, + {144, 18}, + {136, 60}, + {168, 57}, + {200, 60}, + {210, 60}, + // Right side Matrix + {192, 57}, + {224, 48}, + {224, 36}, + {224, 24}, + {224, 12}, + {208, 12}, + {208, 24}, + {208, 36}, + {208, 48}, + {176, 55}, + {160, 57}, + {192, 45}, + {192, 33}, + {192, 21}, + {192, 9}, + {176, 7}, + {176, 19}, + {176, 31}, + {176, 43}, + {144, 59}, + {128, 64}, + {160, 45}, + {160, 33}, + {160, 21}, + {160, 9}, + {144, 10}, + {144, 22}, + {144, 34}, + {144, 47}, + }, + {LED_FLAG_NONE, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, + LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT}}; + #endif + + void keyboard_post_init_rgb_light(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_sethsv_pink(); + /* rgblight_setrgb(RGB_ORANGE); */ + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 1); + #endif + + #ifdef RGB_MATRIX_ENABLE + /* rgblight_mode(RGB_MATRIX_JELLYBEAN_RAINDROPS); */ + rgb_matrix_mode(RGB_MATRIX_SOLID_MULTISPLASH); + #endif + } + + #ifdef RGB_MATRIX_ENABLE + layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case 1: + rgb_matrix_sethsv(HSV_AZURE); + break; + case 2: + rgb_matrix_sethsv(HSV_GREEN); + rgb_matrix_mode(RGB_MATRIX_PIXEL_FRACTAL); + break; + default: // for any other layers, or the default layer + rgb_matrix_mode(RGB_MATRIX_SOLID_MULTISPLASH); + break; + } + return state; + } + #endif + + void keyboard_post_init_user(void) { + keyboard_post_init_rgb_light(); + } diff --git a/keyboards/sofle/keymaps/wonderbeat/oled.c b/keyboards/sofle/keymaps/wonderbeat/oled.c new file mode 100644 index 000000000000..e21e9c29103b --- /dev/null +++ b/keyboards/sofle/keymaps/wonderbeat/oled.c @@ -0,0 +1,222 @@ + /* Copyright 2020 Josef Adamcik + * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + // Sets up what the OLED screens display. + + #ifdef OLED_ENABLE + + /* KEYBOARD PET START */ + + /* settings */ + # define MIN_WALK_SPEED 10 + # define MIN_RUN_SPEED 40 + + /* advanced settings */ + # define ANIM_FRAME_DURATION 400 // how long each frame lasts in ms + # define ANIM_SIZE 96 // number of bytes in array. If you change sprites, minimize for adequate firmware size. max is 1024 + + int current_wpm = 0; + led_t led_usb_state; + uint32_t anim_sleep = 0; + + # ifdef LUNA + /* timers */ + uint32_t anim_timer = 0; + + /* current frame */ + uint8_t current_frame = 0; + + bool isSneaking = false; + bool isJumping = false; + bool showedJump = true; + + /* logic */ + static void render_luna(int LUNA_X, int LUNA_Y) { + /* Sit */ + static const char PROGMEM sit[2][ANIM_SIZE] = {/* 'sit1', 32x22px */ + { + 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, 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, 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, + }, + + /* 'sit2', 32x22px */ + {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, 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, 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}}; + + /* Walk */ + static const char PROGMEM walk[2][ANIM_SIZE] = {/* 'walk1', 32x22px */ + { + 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, 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, 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, + }, + + /* 'walk2', 32x22px */ + { + 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, 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, 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, + }}; + + /* Run */ + static const char PROGMEM run[2][ANIM_SIZE] = {/* 'run1', 32x22px */ + { + 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, 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, 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, + }, + + /* 'run2', 32x22px */ + { + 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, 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, 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, + }}; + + /* Bark */ + static const char PROGMEM bark[2][ANIM_SIZE] = {/* 'bark1', 32x22px */ + { + 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, 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, 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, + }, + + /* 'bark2', 32x22px */ + { + 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, 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, 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, + }}; + + /* Sneak */ + static const char PROGMEM sneak[2][ANIM_SIZE] = {/* 'sneak1', 32x22px */ + { + 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, 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, 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, + }, + + /* 'sneak2', 32x22px */ + { + 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, 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, 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, + }}; + + /* animation */ + void animate_luna(void) { + /* jump */ + if (isJumping || !showedJump) { + /* clear */ + oled_set_cursor(LUNA_X, LUNA_Y + 2); + oled_write(" ", false); + + oled_set_cursor(LUNA_X, LUNA_Y - 1); + + showedJump = true; + } else { + /* clear */ + oled_set_cursor(LUNA_X, LUNA_Y - 1); + oled_write(" ", false); + + oled_set_cursor(LUNA_X, LUNA_Y); + } + + /* switch frame */ + current_frame = (current_frame + 1) % 2; + + /* current status */ + if (led_usb_state.caps_lock) { + oled_write_raw_P(bark[abs(1 - current_frame)], ANIM_SIZE); + + } else if (isSneaking) { + oled_write_raw_P(sneak[abs(1 - current_frame)], ANIM_SIZE); + + } else if (current_wpm <= MIN_WALK_SPEED) { + oled_write_raw_P(sit[abs(1 - current_frame)], ANIM_SIZE); + + } else if (current_wpm <= MIN_RUN_SPEED) { + oled_write_raw_P(walk[abs(1 - current_frame)], ANIM_SIZE); + + } else { + oled_write_raw_P(run[abs(1 - current_frame)], ANIM_SIZE); + } + } + + /* animation timer */ + if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { + anim_timer = timer_read32(); + animate_luna(); + } + } + + # endif + + static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0}; + oled_write_P(qmk_logo, false); + } + + static void print_status_narrow(void) { + /* this fixes the screen on and off bug */ + anim_sleep = timer_read32(); + if (current_wpm > 1) { + oled_on(); + // Print current mode + oled_write_P(PSTR("\n\n"), false); + + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_ln_P(PSTR("QWRT"), false); + break; + case 1: + oled_write_ln_P(PSTR("CDH"), false); + break; + case 2: + oled_write_P(PSTR("Raise"), false); + break; + case 3: + oled_write_P(PSTR("Lower"), false); + break; + default: + break; + } + oled_write_ln_P(PSTR("\n\n\nCPSLK"), led_usb_state.caps_lock); + # ifdef LUNA + render_luna(0, 13); + # endif + } else if (is_oled_on() && timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { + oled_off(); + } + } + + oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) { + return OLED_ROTATION_270; + } + return rotation; + } + + bool oled_task_user(void) { + current_wpm = get_current_wpm(); + led_usb_state = host_keyboard_led_state(); + + if (current_wpm > 110) { + rgb_matrix_sethsv(HSV_RED); + } else if (current_wpm > 75) { + rgb_matrix_sethsv(HSV_YELLOW); + } else if (current_wpm > 55) { + rgb_matrix_sethsv(HSV_PURPLE); + } else if (current_wpm > 35) { + rgb_matrix_sethsv(HSV_MAGENTA); + } else if (current_wpm > 23) { + rgb_matrix_sethsv(HSV_TEAL); + } else if (current_wpm == 0) { + rgb_matrix_sethsv(HSV_BLUE); + } + + if (is_keyboard_master()) { + print_status_narrow(); + } else { + render_logo(); + } + return true; + } + + #endif diff --git a/keyboards/sofle/keymaps/wonderbeat/rules.mk b/keyboards/sofle/keymaps/wonderbeat/rules.mk new file mode 100644 index 000000000000..57a104f8517b --- /dev/null +++ b/keyboards/sofle/keymaps/wonderbeat/rules.mk @@ -0,0 +1,11 @@ +CONSOLE_ENABLE = no +VIA_ENABLE = no +WPM_ENABLE = yes +OLED_DRIVER = SSD1306 +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 +TAP_DANCE_ENABLE = yes + +# Additional thing to reduce compiled size +LTO_ENABLE = yes +NO_USB_STARTUP_CHECK = yes