diff options
Diffstat (limited to 'keyboards/sofle/keymaps')
19 files changed, 1685 insertions, 19 deletions
diff --git a/keyboards/sofle/keymaps/default/keymap.c b/keyboards/sofle/keymaps/default/keymap.c index 94e7d8b3a6..5729d80271 100644 --- a/keyboards/sofle/keymaps/default/keymap.c +++ b/keyboards/sofle/keymaps/default/keymap.c @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | ESC | Q | W | E | R | T | | Y | U | I | O | P | Bspc | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | - * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| * `-----------------------------------------/ / \ \-----------------------------------------' * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | diff --git a/keyboards/sofle/keymaps/devdev/keymap.c b/keyboards/sofle/keymaps/devdev/keymap.c index b805f7f176..7209c2d33b 100644 --- a/keyboards/sofle/keymaps/devdev/keymap.c +++ b/keyboards/sofle/keymaps/devdev/keymap.c @@ -231,7 +231,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RESET| | | | | | | | | | | | | + * | QK_BOOT| | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * |RGB_TOG|hue^ |sat ^ | bri ^| |COLEMAK|-------. ,-------|desk <| | |desk >| | | * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| @@ -245,7 +245,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,------------------------------------------------. ,---------------------------------------------------. EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| - RESET, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + QK_BOOT, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| RGB_TOG, RGB_HUI,RGB_SAI, RGB_VAI, KC_COLEMAKDH,KC_COLEMAK, C(G(KC_LEFT)),KC_NO,KC_NO,C(G(KC_RGHT)),XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------| @@ -301,7 +301,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,------------------------------------------------. ,---------------------------------------------------. _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| - TO(0), TO(1), TO(2), TO(3), TO(4), TO(5), KC_NO, TO(7), KC_NO, KC_NO, KC_NO, RESET, + TO(0), TO(1), TO(2), TO(3), TO(4), TO(5), KC_NO, TO(7), KC_NO, KC_NO, KC_NO, QK_BOOT, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| KC_NO, KC_NO, KC_BRIU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, EEP_RST, //|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------| diff --git a/keyboards/sofle/keymaps/flare576/keymap.c b/keyboards/sofle/keymaps/flare576/keymap.c index 68f611a1b5..720232ad48 100644 --- a/keyboards/sofle/keymaps/flare576/keymap.c +++ b/keyboards/sofle/keymaps/flare576/keymap.c @@ -78,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* SYMS * ,-----------------------------------------. ,-----------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | { | } | | RESET| + * | | F1 | F2 | F3 | F4 | F5 | | | | { | } | | QK_BOOT| * |------+------+------+------+------+------| |------+------+------+------+------+------| * | TRNS | F6 | F7 | F8 | F9 | F10 | | | | ( | ) | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----------------------------------' '------''---------------------------' */ [_SYMS] = LAYOUT( - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, XXXXXXX, RESET, + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, XXXXXXX, QK_BOOT, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, XXXXXXX, XXXXXXX, _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), KC_F20, _______, _______, XXXXXXX, XXXXXXX, KC_LT, KC_GT, XXXXXXX, XXXXXXX, diff --git a/keyboards/sofle/keymaps/foureight84/config.h b/keyboards/sofle/keymaps/foureight84/config.h new file mode 100644 index 0000000000..2104124f3a --- /dev/null +++ b/keyboards/sofle/keymaps/foureight84/config.h @@ -0,0 +1,33 @@ +/* Copyright 2022 Khoa Truong <foureight84@gmail.com> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#define EE_HANDS + +/* clear default encoder def */ +#undef TAP_CODE_DELAY + +/* encoder support */ +#define TAP_CODE_DELAY 100 + +#define SPLIT_WPM_ENABLE +#define SPLIT_OLED_ENABLE + +#define POINTING_DEVICE_ROTATION_90 +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_RIGHT +#define POINTING_DEVICE_TASK_THROTTLE_MS 8
\ No newline at end of file diff --git a/keyboards/sofle/keymaps/foureight84/keymap.c b/keyboards/sofle/keymaps/foureight84/keymap.c new file mode 100644 index 0000000000..b2dd6a3cd6 --- /dev/null +++ b/keyboards/sofle/keymaps/foureight84/keymap.c @@ -0,0 +1,616 @@ +/* Copyright 2022 Khoa Truong <foureight84@gmail.com> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include QMK_KEYBOARD_H +#include <string.h> +#include "lib/lib8tion/lib8tion.h" + + +enum sofle_layers { + /* _M_XYZ = Mac Os, _W_XYZ = Win/Linux */ + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST, + _MOUSE, +}; + +enum custom_keycodes { + KC_QWERTY = SAFE_RANGE, + KC_COLEMAK, + KC_LOWER, + KC_RAISE, + KC_ADJUST, + KC_PRVWD, + KC_NXTWD, + KC_LSTRT, + KC_LEND, + KC_DLINE, + KC_MOUSE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCtrl | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | [ | LGUI | LAlt |LOWER | /Space / \Enter \ |RAISE | RCTR | RAlt | ] | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + +[_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + 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_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LBRC ,KC_LGUI, KC_LALT, KC_LOWER, KC_SPC, KC_ENT, KC_RAISE, KC_RCTRL, KC_RALT, KC_RBRC \ +), +/* + * COLEMAK + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | TAB | A | R | S | T | D |-------. ,-------| H | N | E | I | O | ' | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| K | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + +[_COLEMAK] = 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_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LGUI,KC_LALT,KC_LCTRL,KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI \ +), +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | MOUSE| ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * | Shift| = | - | + | { | } |-------| |-------| [ | ] | ; | : | \ | Shift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + KC_MOUSE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + _______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ +), +/* RAISE + * ,----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | Ins | Pscr | Menu | | | | | PWrd | Up | NWrd | DLine| Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | LAt | LCtl |LShift| | Caps |-------. ,-------| | Left | Down | Rigth| Del | Bspc | + * |------+------+------+------+------+------| MPLY | | |------+------+------+------+------+------| + * |Shift | Undo | Cut | Copy | Paste| |-------| |-------| | LStr | | LEnd | | Shift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_RAISE] = LAYOUT( \ + _______, _______ , _______ , _______ , _______ , _______, _______, _______ , _______, _______ , _______ ,_______, \ + _______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, KC_PGUP, KC_PRVWD, KC_UP, KC_NXTWD,KC_DLINE, 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, KC_MPLY, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +/* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | QK_BOOT| |QWERTY|COLEMAK| | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | |MACWIN| | | |-------. ,-------| | VOLDO| MUTE | VOLUP| | | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | PREV | PLAY | NEXT | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + [_ADJUST] = LAYOUT( \ + XXXXXXX , XXXXXXX, XXXXXXX , XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + QK_BOOT, XXXXXXX,KC_QWERTY,KC_COLEMAK,CG_TOGG,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX , XXXXXXX,CG_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, \ + XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /* MOUSE + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------|MS_BT1|MS_BT2| | | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + [_MOUSE] = LAYOUT( \ + XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#ifdef OLED_ENABLE + +static void print_status_narrow(void) { + // Print current mode + oled_write_P(PSTR("\n\n"), false); + oled_write_ln_P(PSTR("MODE"), false); + oled_write_ln_P(PSTR(""), false); + if (keymap_config.swap_lctl_lgui) { + oled_write_ln_P(PSTR("MAC"), false); + } else { + oled_write_ln_P(PSTR("WIN"), false); + } + + switch (get_highest_layer(default_layer_state)) { + case _QWERTY: + oled_write_ln_P(PSTR("Qwrt"), false); + break; + case _COLEMAK: + oled_write_ln_P(PSTR("Clmk"), false); + break; + default: + oled_write_P(PSTR("Undef"), false); + } + oled_write_P(PSTR("\n\n"), false); + // Print current layer + oled_write_ln_P(PSTR("LAYER"), false); + switch (get_highest_layer(layer_state)) { + case _COLEMAK: + case _QWERTY: + oled_write_P(PSTR("Base\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adj\n"), false); + break; + case _MOUSE: + oled_write_P(PSTR("Mouse\n"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } + oled_write_P(PSTR("\n\n"), false); + led_t led_usb_state = host_keyboard_led_state(); + oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock); +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) { + return OLED_ROTATION_270; + } + + if (!is_keyboard_master()) { + return OLED_ROTATION_270; + } + return rotation; +} + + +/* Animation bit by j-inc https://github.com/qmk/qmk_firmware/tree/master/keyboards/kyria/keymaps/j-inc */ +// WPM-responsive animation stuff here +#define IDLE_FRAMES 5 +#define IDLE_SPEED 40 // below this wpm value your animation will idle + +// #define PREP_FRAMES 1 // uncomment if >1 + +#define TAP_FRAMES 2 +#define TAP_SPEED 60 // above this wpm value typing animation to triggere + +#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms +// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing +#define ANIM_SIZE 320 // number of bytes in array, minimize for adequate firmware size, max is 1024 + +uint32_t anim_timer = 0; +uint32_t anim_sleep = 0; +uint8_t current_idle_frame = 0; +// uint8_t current_prep_frame = 0; // uncomment if PREP_FRAMES >1 +uint8_t current_tap_frame = 0; + +// Implementation credit j-inc(/James Incandenza), pixelbenny, and obosob. +// Bongo cat images changed and adapted for sofle keyboard oled size. +// Original gif can be found here: https://www.pixilart.com/art/bongo-cat-bd2a8e9323aa705 +static void render_anim(void) { + static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = { + { + 0x00, 0xc0, 0x3e, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0x03, 0x00, 0x03, 0x0c, 0x30, 0xc0, 0x00, + 0xe1, 0x1e, 0x00, 0xc0, 0xbc, 0x83, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x03, 0x00, 0x00, 0x00, 0x80, 0x78, 0x87, 0x00, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0xe0, 0x1f, + 0x01, 0xc0, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x31, 0x05, 0x41, 0x12, 0x04, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x87, 0x00, 0x01, 0x06, 0x18, 0x60, 0x80, 0xc0, 0x3f, 0x03, 0x80, + 0x78, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x03, 0x05, + 0x00, 0x00, 0xf0, 0xcf, 0x00, 0x01, 0x06, 0x18, 0x60, 0x80, 0x80, 0x79, 0x07, 0x80, 0x78, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x1e, 0x01, 0x00, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0xf9, 0x07, 0x80, 0x78, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x2c, 0x32, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0x00, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x60, 0x80, 0x00, 0x00, 0xe1, 0x1e, 0x01, 0xf0, 0x8f, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x0e, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x09, 0x0e, 0x0e, 0x01, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x19, + 0x19, 0x41, 0x0a, 0x22, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x70, 0x80, + 0x00, 0x00, 0xf0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x02, 0x01, + } + }; + static const char PROGMEM tap[TAP_FRAMES][ANIM_SIZE] = { + { + 0x00, 0xc0, 0x3e, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0xff, 0xff, 0x7c, 0x70, 0x40, 0x40, + 0x61, 0x5e, 0x80, 0xc0, 0xbc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x03, 0x00, 0x00, 0x00, 0x80, 0x78, 0x87, 0x00, 0x03, 0x0f, 0x3f, 0xf8, 0xf0, 0xf0, 0x20, + 0x40, 0x80, 0x80, 0x00, 0x00, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x87, 0x00, 0x01, 0x06, 0x18, 0x60, 0x80, 0xc0, 0x3f, 0x03, 0x80, + 0x78, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, + 0x00, 0x00, 0xf0, 0xcf, 0x00, 0x01, 0x06, 0x18, 0x60, 0x80, 0x80, 0x79, 0x07, 0x80, 0x78, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x1e, 0x01, 0x00, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0xf9, 0x07, 0x80, 0x78, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x2c, 0x32, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0x00, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x60, 0x80, 0x00, 0x00, 0xe1, 0x1e, 0x01, 0xf0, 0x8f, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x0e, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x09, 0x0e, 0x0e, 0x01, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x19, + 0x19, 0x41, 0x0a, 0x22, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x70, 0x80, + 0x00, 0x00, 0xf0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x02, 0x01, + }, + { + 0x00, 0xc0, 0x3e, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0x03, 0x00, 0x03, 0x0c, 0x30, 0xc0, 0x00, + 0xe1, 0x1e, 0x00, 0xc0, 0xbc, 0x83, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x03, 0x00, 0x00, 0x00, 0x80, 0x78, 0x87, 0x00, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0xe0, 0x1f, + 0x01, 0xc0, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x31, 0x05, 0x41, 0x12, 0x04, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x87, 0x00, 0x01, 0x06, 0x18, 0x60, 0x80, 0xc0, 0x3f, 0x03, 0x80, + 0x78, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x03, 0x05, + 0x00, 0x00, 0xf0, 0xcf, 0x00, 0x01, 0x06, 0x18, 0x60, 0x80, 0x80, 0x79, 0x07, 0x80, 0x78, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0xfe, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0xf9, 0x07, 0x80, 0x78, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x2c, 0x32, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x03, 0x0f, 0x3f, 0xff, 0x03, 0x01, 0x03, 0x07, 0x18, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x60, 0x80, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x0e, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x09, 0x0e, 0x0e, 0x01, 0xf3, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x70, 0x80, + 0x00, 0x00, 0xf0, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x02, 0x01 + }, + }; + + //assumes 1 frame prep stage + void animation_phase(void) { + if(get_current_wpm() <=IDLE_SPEED){ + oled_write_raw_P(idle[0], ANIM_SIZE); + } + if(get_current_wpm() >=TAP_SPEED){ + current_tap_frame = (current_tap_frame + 1) % TAP_FRAMES; + oled_write_raw_P(tap[abs((TAP_FRAMES-1)-current_tap_frame)], ANIM_SIZE); + } + } + if(get_current_wpm() != 000) { + oled_on(); // not essential but turns on animation OLED with any alpha keypress + if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { + anim_timer = timer_read32(); + animation_phase(); + } + anim_sleep = timer_read32(); + } else { + if(timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { + oled_off(); + } else { + if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { + anim_timer = timer_read32(); + animation_phase(); + } + } + } +} + +bool oled_task_user(void) { + if (is_keyboard_master()) { + print_status_narrow(); + } else { + render_anim(); + oled_set_cursor(1,12); + oled_write_P(PSTR("WPM"), false); + oled_set_cursor(1,13); + oled_write(get_u8_str(get_current_wpm(), '0'), false); + } + return false; +} +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case KC_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case KC_COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case KC_LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case KC_RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case KC_ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + case KC_PRVWD: + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_LEFT); + } else { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_LEFT); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_LEFT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_LEFT); + } + } + break; + case KC_NXTWD: + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_RIGHT); + } else { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_RIGHT); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_RIGHT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } + } + break; + case KC_LSTRT: + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + //CMD-arrow on Mac, but we have CTL and GUI swapped + register_mods(mod_config(MOD_LCTL)); + register_code(KC_LEFT); + } else { + register_code(KC_HOME); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_LEFT); + } else { + unregister_code(KC_HOME); + } + } + break; + case KC_LEND: + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + //CMD-arrow on Mac, but we have CTL and GUI swapped + register_mods(mod_config(MOD_LCTL)); + register_code(KC_RIGHT); + } else { + register_code(KC_END); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } else { + unregister_code(KC_END); + } + } + break; + case KC_DLINE: + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_BSPC); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_BSPC); + } + break; + case KC_COPY: + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_C); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_C); + } + return false; + case KC_PASTE: + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_V); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_V); + } + return false; + case KC_CUT: + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_X); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_X); + } + return false; + break; + case KC_UNDO: + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_Z); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_Z); + } + return false; + case KC_MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } else { + layer_off(_MOUSE); + } + return false; + } + return true; +} + +#ifdef ENCODER_ENABLE + +bool encoder_update_user(uint8_t index, bool clockwise) { + switch (get_highest_layer(layer_state)) { + case _COLEMAK: + case _QWERTY: + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + break; + + case _RAISE: + if (index == 0) { + if (clockwise) { + tap_code(KC_MPRV); + } else { + tap_code(KC_MNXT); + } + } + break; + } + return true; +} + +#endif + +static uint32_t last_mouse_activity = 0; +static report_mouse_t last_mouse_report = {0}; +static bool is_scrolling = false; + +report_mouse_t smooth_mouse_movement(report_mouse_t mouse_report) { + // Linear interpolation and ease-in-out + static fract8 fract = 0.5; + int8_t x = 0; + int8_t y = 0; + int8_t h = 0; + int8_t v = 0; + + if (!is_scrolling) { + x = ease8InOutApprox(lerp8by8(last_mouse_report.x, mouse_report.x, fract)); + y = ease8InOutApprox(lerp8by8(last_mouse_report.y, mouse_report.y, fract)); + } else { + h = ease8InOutApprox(lerp8by8(last_mouse_report.x, mouse_report.x, fract)); + v = ease8InOutApprox(lerp8by8(last_mouse_report.y, mouse_report.y, fract)); + } + + // update the new smoothed report + mouse_report.x = x; + mouse_report.y = y; + mouse_report.h = h; + mouse_report.v = v; + + return mouse_report; +} + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + + if (has_mouse_report_changed(&last_mouse_report, &mouse_report)) { + last_mouse_activity = timer_read32(); + memcpy(&last_mouse_report, &mouse_report, sizeof(mouse_report)); + } + + return smooth_mouse_movement(mouse_report); +}
\ No newline at end of file diff --git a/keyboards/sofle/keymaps/foureight84/readme.md b/keyboards/sofle/keymaps/foureight84/readme.md new file mode 100644 index 0000000000..e88b0e04f6 --- /dev/null +++ b/keyboards/sofle/keymaps/foureight84/readme.md @@ -0,0 +1 @@ +For more information on integrating the Pimoroni Trackball, please see: https://github.com/foureight84/sofle-keyboard-pimoroni diff --git a/keyboards/sofle/keymaps/foureight84/rules.mk b/keyboards/sofle/keymaps/foureight84/rules.mk new file mode 100644 index 0000000000..102742ab1c --- /dev/null +++ b/keyboards/sofle/keymaps/foureight84/rules.mk @@ -0,0 +1,24 @@ +OLED_ENABLE = yes +ENCODER_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +WPM_ENABLE = yes + +#Debug options +VERBOSE = no +CONSOLE_ENABLE = no +COMMAND_ENABLE = no + +LTO_ENABLE = yes + +SPLIT_KEYBOARD = yes + +VIA_ENABLE = no + +POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = pimoroni_trackball + +SPACE_CADET_ENABLE = no +GRAVE_ESC_ENABLE = no +MAGIC_ENABLE = no +MUSIC_ENABLE = no
\ No newline at end of file diff --git a/keyboards/sofle/keymaps/helltm/keymap.c b/keyboards/sofle/keymaps/helltm/keymap.c index 8d6289af42..c0fd5edb5e 100644 --- a/keyboards/sofle/keymaps/helltm/keymap.c +++ b/keyboards/sofle/keymaps/helltm/keymap.c @@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | Esc | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | | Up | | RESET| | | PWrd | NWrd | Pscr |Scroll| Pause| F12 | + * | Tab | | Up | | QK_BOOT| | | PWrd | NWrd | Pscr |Scroll| Pause| F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Caps | Left | Down | Rigth| | |-------. ,-------| | | Ins | Home | PUp | | * |------+------+------+------+------+------| play | | mute |------+------+------+------+------+------| @@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_LOWER] = LAYOUT( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, XXXXXXX, KC_UP, XXXXXXX, RESET, XXXXXXX, KC_PRVWD, KC_NXTWD, KC_PSCR, KC_SLCK, KC_PAUS, KC_F12, + _______, XXXXXXX, KC_UP, XXXXXXX, QK_BOOT, XXXXXXX, KC_PRVWD, KC_NXTWD, KC_PSCR, KC_SLCK, KC_PAUS, KC_F12, _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_HOME, KC_PGUP, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, KC_APP, KC_DEL, KC_END, KC_PGDN, XXXXXXX, CG_TOGG, KC_RALT, _______, KC_RCTL, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX @@ -137,7 +137,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RESET| |QWERTY| | | | | | | | | | | + * | QK_BOOT| |QWERTY| | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | |MACWIN| | | |-------. ,-------| | VOLDO| MUTE | VOLUP| | | * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| @@ -149,7 +149,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( XXXXXXX , XXXXXXX, XXXXXXX , XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RESET , XXXXXXX,KC_QWERTY,XXXXXXX,CG_TOGG,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + QK_BOOT, XXXXXXX,KC_QWERTY,XXXXXXX,CG_TOGG,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX , XXXXXXX,CG_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/sofle/keymaps/killmaster/config.h b/keyboards/sofle/keymaps/killmaster/config.h index 2e6abe84e3..9d1de12d5a 100644 --- a/keyboards/sofle/keymaps/killmaster/config.h +++ b/keyboards/sofle/keymaps/killmaster/config.h @@ -61,4 +61,3 @@ for more options. #define MEDIA_KEY_DELAY 2 #define USB_POLLING_INTERVAL_MS 1 -#define QMK_KEYS_PER_SCAN 12 diff --git a/keyboards/sofle/keymaps/killmaster/keymap.c b/keyboards/sofle/keymaps/killmaster/keymap.c index 71db0fc853..5db76bbb72 100644 --- a/keyboards/sofle/keymaps/killmaster/keymap.c +++ b/keyboards/sofle/keymaps/killmaster/keymap.c @@ -108,7 +108,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RESET| |QWERTY|COLEMAK| | | | | | | | | | + * | QK_BOOT| |QWERTY|COLEMAK| | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | |MACWIN| | | |-------. ,-------| | VOLDO| MUTE | VOLUP| | | * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| @@ -120,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( XXXXXXX , XXXXXXX, XXXXXXX , XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RESET , XXXXXXX, KC_QWERTY, XXXXXXX , CG_TOGG,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + QK_BOOT, XXXXXXX, KC_QWERTY, XXXXXXX , CG_TOGG,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX , XXXXXXX,CG_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/sofle/keymaps/manna-harbour_miryoku/config.h b/keyboards/sofle/keymaps/manna-harbour_miryoku/config.h index 8372e10168..e335d5d8b8 100644 --- a/keyboards/sofle/keymaps/manna-harbour_miryoku/config.h +++ b/keyboards/sofle/keymaps/manna-harbour_miryoku/config.h @@ -1,6 +1,5 @@ // Copyright 2019 Manna Harbour // https://github.com/manna-harbour/miryoku -// generated -*- buffer-read-only: t -*- // 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 <http://www.gnu.org/licenses/>. diff --git a/keyboards/sofle/keymaps/manna-harbour_miryoku/keymap.c b/keyboards/sofle/keymaps/manna-harbour_miryoku/keymap.c index 7c5717a0fe..dbab7f9820 100644 --- a/keyboards/sofle/keymaps/manna-harbour_miryoku/keymap.c +++ b/keyboards/sofle/keymaps/manna-harbour_miryoku/keymap.c @@ -1,5 +1,4 @@ // Copyright 2019 Manna Harbour // https://github.com/manna-harbour/miryoku -// generated -*- buffer-read-only: t -*- // 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 <http://www.gnu.org/licenses/>. diff --git a/keyboards/sofle/keymaps/michal/config.h b/keyboards/sofle/keymaps/michal/config.h new file mode 100644 index 0000000000..6ab3602dfd --- /dev/null +++ b/keyboards/sofle/keymaps/michal/config.h @@ -0,0 +1,23 @@ +// Copyright 2022 Michal S. (@ihatethefrench) +// SPDX-License-Identifier: GPL-2.0-only + +#pragma once + +// Enables features such as octave changer, suspend, etc. +#define MIDI_ADVANCED + +// This autoshift delay feels most natural for me I think +#define AUTO_SHIFT_TIMEOUT 165 + +// I don't use too many layers, so this is more than enough +#define LAYER_STATE_8BIT + +// Saving space +#define NO_ACTION_ONESHOT +#define NO_ACTION_TAPPING +#define NO_MUSIC_MODE + +// If I recall correctly, these aren't necessary for the sofle +// so i disable them to save more space. +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE
\ No newline at end of file diff --git a/keyboards/sofle/keymaps/michal/keymap.c b/keyboards/sofle/keymaps/michal/keymap.c new file mode 100644 index 0000000000..1e0d16eab9 --- /dev/null +++ b/keyboards/sofle/keymaps/michal/keymap.c @@ -0,0 +1,230 @@ +// Copyright 2022 Michal S. (@ihatethefrench) +// SPDX-License-Identifier: GPL-2.0-only + +#include QMK_KEYBOARD_H + +// This specifies the layers that will be used +enum sofle_layers { + _WORKMAN, + _QWERTY, + _MIDI, + _LOWER, + _RAISE, + _ADJUST +}; + +// This specifies any custom keycodes I might have set +enum custom_keycodes { + KC_WORKMAN = SAFE_RANGE, + KC_QWERTY, + KC_MIDI, + KC_LOWER, + KC_RAISE, + KC_ADJUST +}; + +// Here the keymaps are defined in matrix form using KC_XYZ form keycodes +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * WORKMAN + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Prnt | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | Q | D | R | W | B | | J | F | U | P | ; | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | A | S | H | T | G |-------. ,-------| Y | N | E | O | I | ' | + * |------+------+------+------+------+------| | | MUTE |------+------+------+------+------+------| + * |LShift| Z | X | M | C | V |-------| |-------| K | L | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_WORKMAN] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, + KC_ESC, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, XXXXXXX, KC_MUTE, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, KC_LALT, KC_LCTRL, KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI +), + +/* + * QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Prnt | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | Q | W | E | R | T | | Y | U | I | O | P | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | + * |------+------+------+------+------+------| | | MUTE |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Space / \Enter \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_QWERTY] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, KC_MUTE, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, KC_LALT, KC_LCTRL, KC_LOWER, KC_SPC, KC_ENT, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI +), + +/* MIDI + * ,-----------------------------------------. ,-----------------------------------------. + * | Pnic | OCT0 | OCT1 | OCT2 | OCT3 | OCT4 | | OCT5 | OCT6 | OCT7 | | | MTOG | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |G#/Ab |Bb/A# | |C#/Db |D#/Eb | | |F#/Gb |G#/Ab |Bb/A# | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | A | B | C | D | E |-------. ,-------| F | G | A | B | C | Wkmn | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | TNSD | TNSU |-------| |-------| BNDD | BNDU | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | | | | Susd | /OCTDN / \OCTUP \ | | | | | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_MIDI] = LAYOUT( + MI_ALLOFF, MI_OCT_0, MI_OCT_1, MI_OCT_2, MI_OCT_3, MI_OCT_4, MI_OCT_5, MI_OCT_6, MI_OCT_7, _______, _______, MI_TOG, + _______, MI_Gs, MI_As, _______, MI_Cs_1, MI_Ds_1, _______, MI_Fs_1, MI_Gs_1, MI_As_1, _______, _______, + _______, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, MI_G_1, MI_A_1, MI_B_1, MI_C_2, KC_WORKMAN, + _______, _______, _______, _______, MI_TRNSD, MI_TRNSU, _______, _______, MI_BENDD, MI_BENDU, _______, _______, _______, _______, + _______, _______, _______, MI_SUS, MI_OCTD, MI_OCTU, _______, _______, _______, _______ +), + +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | | | | | | | + * |------+------+------+------+------+------| | | Run |------+------+------+------+------+------| + * | | = | - | + | { | } |-------| |-------| [ | ] | | | \ | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | | | |LOWER | / / \ \ | | | | | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_LOWER] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, + _______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, LALT(KC_F2), KC_LBRC, KC_RBRC, _______, _______, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* RAISE + * ,----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | ASTG | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Up | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | Left | Down | Rght | | Wkmn | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | Midi | | |-------| |-------| | | Home | End | | Qwrt | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | | | | | / / \ \ |RAISE | | | | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ASTG, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_WORKMAN, + _______, _______, _______, KC_MIDI, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, KC_QWERTY, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +)}; + +// This section only compiles if OLED_ENABLE is set to `yes` in rules.mk +#ifdef OLED_ENABLE + +// Defining my custom text to draw to the screen :) +static void oled_screen(void) { + oled_write_ln_P(PSTR(""), false); + oled_write_ln_P(PSTR(">nix "), false); + oled_write_ln_P(PSTR(">rust"), false); + oled_write_ln_P(PSTR(">hs &"), false); + oled_write_ln_P(PSTR(">rum"), false); + oled_write_ln_P(PSTR(""), false); + oled_write_ln_P(PSTR(" . ."), false); + oled_write_ln_P(PSTR(" u "), false); + oled_write_ln_P(PSTR(" d"), false); + oled_write_ln_P(PSTR(""), false); + oled_write_ln_P(PSTR("mchal"), false); +} + +// Set correct rotation so the text doesn't end up sideways +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_270; + } + return rotation; +} + +// I only draw to the right screen because I accidentally +// burned the left one with a soldering iron. Oops. +bool oled_task_user(void) { + if (!is_keyboard_master()) { + oled_screen(); + } + return false; +} + +#endif + +// This section defines custom keycodes, which I use to manage layers +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case KC_WORKMAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + } + return false; + case KC_MIDI: + if (record->event.pressed) { + set_single_persistent_default_layer(_MIDI); + } + return false; + case KC_LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case KC_RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + } + return true; +} + +// This section only compiles if ENCODER_ENABLE is set to `yes` in rules.mk +#ifdef ENCODER_ENABLE + +// This section is like the keymap matrix, but for rotary encoders +// My left encoder is currently not working, so I'm using Layers to cope :') +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_WORKMAN] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLD, KC_VOLU )}, + [_QWERTY] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLD, KC_VOLU )}, + [_LOWER] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN)}, + [_RAISE] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______ )}, + [_ADJUST] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______ )}, +}; + +#endif diff --git a/keyboards/sofle/keymaps/michal/rules.mk b/keyboards/sofle/keymaps/michal/rules.mk new file mode 100644 index 0000000000..63f587fd30 --- /dev/null +++ b/keyboards/sofle/keymaps/michal/rules.mk @@ -0,0 +1,22 @@ +BOOTLOADER = atmel-dfu + +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 + +# These are turned off to save space +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +GRAVE_ESC_ENABLE = no +MAGIC_ENABLE = no +SPACE_CADET_ENABLE = no + +# I actually use these features +AUTO_SHIFT_ENABLE = yes +ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes +EXTRAKEY_ENABLE = yes +MIDI_ENABLE = yes +MOUSEKEY_ENABLE = yes + +# More space-saving +LTO_ENABLE = yes
\ No newline at end of file diff --git a/keyboards/sofle/keymaps/noqmk/keymap.c b/keyboards/sofle/keymaps/noqmk/keymap.c new file mode 100644 index 0000000000..ae92a7ec7f --- /dev/null +++ b/keyboards/sofle/keymaps/noqmk/keymap.c @@ -0,0 +1,686 @@ +// Copyright 2022 axtlos (@axtloss) +// SPDX-License-Identifier: GPL-2.0-only +#include QMK_KEYBOARD_H + + +enum sofle_layers { + /* _M_XYZ = Mac Os, _W_XYZ = Win/Linux */ + _QWERTY, + _COLEMAK, + _GAME, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + KC_COLEMAK = SAFE_RANGE, + KC_QWERTY, + KC_LOWER, + KC_RAISE, + KC_ADJUST, + KC_GAME, + KC_PRVWD, + KC_NXTWD, + KC_LSTRT, + KC_LEND, + KC_DLINE, + KC_UNLOCK, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * COLEMAK + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | TAB | A | R | S | T | D |-------. ,-------| H | N | E | I | O | ' | + * |------+------+------+------+------+------| MUTE | |ADJUST |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| K | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Space / \Enter \ |RAISE | RCTR | RAlt | MOUSE | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + +[_COLEMAK] = 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_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, KC_CAPS ,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI,KC_LALT,KC_LCTRL,KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_PSCR +), +/* + * QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | Q | W | E | R | T | | Y | U | I | O | P | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | Print| + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + +[_QWERTY] = 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_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, KC_MPLY,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI,KC_LALT,KC_LCTRL, KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_PSCR +), +/* 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 | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_LOWER] = 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F12, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +/* RAISE + * ,----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | Ins | Pscr | Menu | | | | | PWrd | Up | NWrd | DLine| Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ae | ue | oe | ss | euro |-------. ,-------| | Left | Down | Rigth| Del | Bspc | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * |Shift | Undo | Cut | Copy | Paste| caps |-------| |-------| | LStr | | LEnd | | Shift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ +[_RAISE] = LAYOUT( + _______, _______ , _______ , _______ , _______ , _______, _______, _______ , _______, _______ , _______ ,_______, + _______, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), LGUI(KC_6), LGUI(KC_7), KC_UP, LGUI(KC_9),LGUI(KC_0), KC_BSPC, + _______, RALT(KC_Q), RALT(KC_Y), RALT(KC_P), RALT(KC_S) , RALT(KC_5), KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC, + _______,KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_CAPS, _______, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______, + _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______ +), +/* + * QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | Q | W | E | R | T | | Y | U | I | O | P | Bspc | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Space / \Enter \ |RAISE | RCTR | RAlt | Print| + * | | | | |/ / \ \ | | | | | + * `----------------------------------' '------''---------------------------' + */ + +[_GAME] = LAYOUT( + KC_ESC, 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_BSPC, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, KC_MPLY,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI,KC_LALT,KC_SPC, KC_LOWER, KC_SPC, KC_ENT, KC_RAISE, KC_RCTRL, KC_RALT, KC_PSCR +), +/* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | QK_BOOT| |QWERTY|COLEMAK| | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | |MACWIN|GAMING| | |-------. ,-------| | VOLDO| MUTE | VOLUP| | | + * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| + * |UNLOCK| | | | | |-------| |-------| | PREV | PLAY | NEXT | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | + * | | | | |/ / \ \ | | | | | + * `---------------------------''------' '------''---------------------------' + */ +[_ADJUST] = LAYOUT( + XXXXXXX , XXXXXXX, XXXXXXX , XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + QK_BOOT , XXXXXXX,KC_QWERTY,KC_COLEMAK,CG_TOGG,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX , XXXXXXX,CG_TOGG, KC_GAME, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, + KC_UNLOCK , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; + +#ifdef OLED_ENABLE + +bool show_lock = true; // this is used to display the lock icon and disable keypresses when the keyboard is locked +bool animate = true; // this variable is used to fix the flickering bug + +static void render_logo(void) { + static const char PROGMEM no_qmk[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x80, 0x80, 0x80, + 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0xe0, 0xf0, + 0xf8, 0xf8, 0xe0, 0x00, 0x00, 0x0e, 0xfe, 0xfe, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, + 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x08, 0x88, 0x88, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x08, 0x88, 0x88, 0x88, 0x48, 0x48, 0x48, 0x28, 0x28, 0x18, 0x18, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xf0, 0xfc, 0xf8, 0x03, 0xf3, 0xe7, 0xdf, 0x9f, 0x3f, 0xfe, 0xfe, 0xfc, 0xf9, + 0xfb, 0xf3, 0xf7, 0xf7, 0xe7, 0xef, 0xcf, 0x90, 0xa1, 0x81, 0x81, 0x81, 0xa0, 0xbd, 0xff, 0xff, + 0xff, 0xff, 0x7f, 0x3f, 0x9c, 0xdc, 0xf8, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x60, 0x00, 0x00, 0x20, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x4c, 0x4f, + 0x47, 0x43, 0x43, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0xc2, 0xc2, 0x41, 0x00, 0x00, 0x00, 0x00, + 0xe3, 0x13, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0xe2, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x79, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x79, 0x03, 0xff, 0xff, 0xff, 0xff, 0x1f, + 0x03, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x44, 0x4a, 0x4a, 0x51, 0x51, 0x60, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x0f, 0x1f, + 0x3f, 0x3f, 0x7f, 0x7c, 0x78, 0x78, 0x78, 0x78, 0x7c, 0x7e, 0x7f, 0x7f, 0x4f, 0x43, 0x40, 0x60, + 0x60, 0x78, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, + 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x21, + 0x11, 0x11, 0x09, 0x09, 0x05, 0x05, 0x03, 0x03, 0x05, 0x09, 0x11, 0x21, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + oled_write_raw_P(no_qmk, sizeof(no_qmk)); +} + +static const char PROGMEM locked_logo[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xce, 0xc6, + 0xc6, 0xce, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +/* 32 * 14 os logos */ +static const char PROGMEM linux_logo[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x27, 0x27, 0x8f, 0x9f, 0x03, + 0x73, 0xff, 0x03, 0xf2, 0xfe, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1f, 0x19, 0x19, 0x1b, 0x1b, 0x1b, + 0x1a, 0x18, 0x18, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +static const char PROGMEM mac_logo[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf0, 0xf6, 0xfb, 0xfb, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0f, 0x1f, 0x1f, 0x0f, 0x0f, 0x1f, 0x1f, 0x0f, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + + +/* KEYBOARD PET START */ + +/* settings */ +# define MIN_WALK_SPEED 10 +# define MIN_RUN_SPEED 40 + +/* advanced settings */ +# define ANIM_FRAME_DURATION 200 // 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 + +/* timers */ +uint32_t anim_timer = 0; +uint32_t anim_sleep = 0; + +/* current frame */ +uint8_t current_frame = 0; + +/* status variables */ +int current_wpm = 0; +led_t led_usb_state; + +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, stops the animation logic when the oled is turned off */ + if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION && animate == true) { + anim_timer = timer_read32(); + animate_luna(); + } + + /* this fixes the screen on and off bug by disabling the animation logic when the oled is off */ + if (current_wpm > 0) { + oled_on(); + anim_sleep = timer_read32(); + animate = true; + } else if (timer_elapsed32(anim_sleep) > OLED_TIMEOUT) { + oled_off(); + animate = false; + } +} + +/* KEYBOARD PET END */ +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) { + return OLED_ROTATION_270; + } + return rotation; +} + +static void print_logo_narrow(void) { + render_logo(); +} + +static void print_status_narrow(void) { + /* Print current mode */ + oled_set_cursor(0, 0); + if (show_lock == true) { + oled_write_raw_P(locked_logo, sizeof(locked_logo)); + } else if (keymap_config.swap_lctl_lgui) { + oled_write_raw_P(mac_logo, sizeof(mac_logo)); + } else { + oled_write_raw_P(linux_logo, sizeof(linux_logo)); + } + + oled_set_cursor(0, 3); + + switch (get_highest_layer(default_layer_state)) { + case _COLEMAK: + oled_write_P(PSTR(" CLMK "), false); + break; + case _GAME: + oled_write_P(PSTR(" GAME "), false); + break; + case _QWERTY: + oled_write_P(PSTR("QWERT"), false); + break; + default: + oled_write_P(PSTR("UNDEF"), false); + } + + oled_set_cursor(0, 5); + + /* Print current layer */ + oled_write_P(PSTR("LAYER"), false); + + oled_set_cursor(0, 6); + + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Base "), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case _ADJUST: + oled_write_P(PSTR(" Adj "), false); + break; + default: + oled_write_P(PSTR("Undef"), false); + } + + /* caps lock */ + oled_set_cursor(0, 8); + oled_write_P(PSTR("CPSLK"), led_usb_state.caps_lock); + + /* KEYBOARD PET RENDER START */ + + render_luna(0, 13); + + /* KEYBOARD PET RENDER END */ +} + +bool oled_task_user(void) { + /* KEYBOARD PET VARIABLES START */ + + current_wpm = get_current_wpm(); + led_usb_state = host_keyboard_led_state(); + + /* KEYBOARD PET VARIABLES END */ + + if (is_keyboard_master()) { + print_status_narrow(); + } else { + print_logo_narrow(); + } + return false; +} + +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_QWERTY: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case KC_COLEMAK: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case KC_GAME: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + set_single_persistent_default_layer(_GAME); + } + return false; + case KC_LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case KC_RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + case KC_ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + case KC_PRVWD: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_LEFT); + } else { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_LEFT); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_LEFT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_LEFT); + } + } + break; + case KC_NXTWD: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + register_mods(mod_config(MOD_LALT)); + register_code(KC_RIGHT); + } else { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_RIGHT); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LALT)); + unregister_code(KC_RIGHT); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } + } + break; + case KC_LSTRT: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + //CMD-arrow on Mac, but we have CTL and GUI swapped + register_mods(mod_config(MOD_LCTL)); + register_code(KC_LEFT); + } else { + register_code(KC_HOME); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_LEFT); + } else { + unregister_code(KC_HOME); + } + } + break; + case KC_LEND: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + if (keymap_config.swap_lctl_lgui) { + //CMD-arrow on Mac, but we have CTL and GUI swapped + register_mods(mod_config(MOD_LCTL)); + register_code(KC_RIGHT); + } else { + register_code(KC_END); + } + } else { + if (keymap_config.swap_lctl_lgui) { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_RIGHT); + } else { + unregister_code(KC_END); + } + } + break; + case KC_DLINE: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + register_mods(mod_config(MOD_RCTL)); + register_code(KC_BSPC); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_BSPC); + } + break; + case KC_COPY: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_C); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_C); + } + return false; + case KC_PASTE: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_V); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_V); + } + return false; + case KC_CUT: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_X); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_X); + } + return false; + break; + case KC_UNDO: + if (show_lock == true) { + return false; + } + if (record->event.pressed) { + register_mods(mod_config(MOD_LCTL)); + register_code(KC_Z); + } else { + unregister_mods(mod_config(MOD_LCTL)); + unregister_code(KC_Z); + } + return false; + case KC_UNLOCK: + if (record->event.pressed) { + if (show_lock == true) { + show_lock = false; + print_status_narrow(); + } else { + show_lock = true; + print_status_narrow(); + } + } + } + /* This stops any keypress to be sent to the computer when the keyboard is locked */ + if (show_lock == false) { + return true; + } else { + return false; + } +} + +#ifdef ENCODER_ENABLE + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); + } + } + return true; +} + +#endif diff --git a/keyboards/sofle/keymaps/noqmk/readme.md b/keyboards/sofle/keymaps/noqmk/readme.md new file mode 100644 index 0000000000..8fce20ad0c --- /dev/null +++ b/keyboards/sofle/keymaps/noqmk/readme.md @@ -0,0 +1,28 @@ +![no qmk?](https://user-images.githubusercontent.com/60044824/181124856-0ebe0cc9-4b91-4fa2-89df-4e0841a61b9d.png) + + +# Custom keymap for Sofle Keyboard, based on [Helltm](https://github.com/qmk/qmk_firmware/tree/master/keyboards/sofle/keymaps/helltm) + +Features: + +- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift) +- Various modes, can be switched (using Adjust layer and the selected one is stored in EEPROM). +- Modes for Qwerty and Colemak support +- Modes for Mac vs Linux/Win support -> different order of modifiers and different action shortcuts on the "UPPER" layer. Designed to simplify transtions when switching between operating systems often. +- The OLED on master half shows selected mode and caps lock state and is rotated. +- Left encoder controls volume up/down/mute. Right encoder PREV/NEXT media controls. +- Keyboard lock, change to the adjust layer (up and down pressed at the same time) and press the left shift to lock/unlock, current lock state is displayed on oled +- Apple logo for Mac mode, Fedora Silverblue logo for Linux/Win mode, Lock icon for locked +- Fixed flickering on main OLED +- Gaming layout, switches space to the left half of the keyboard and raises the most left column up by one key + +#Luna, the keyboard pet + +Features: +- Luna reacts to your wpm counter + - under 10 wpm she sits + - between 10 and 40 wpm she walks + - over 40 wpm she runs +- She will move sneakily if you hold down Ctrl +- Will bark at people on the internet if you activate Caps Lock! +- Luna jumps every time you hit Space diff --git a/keyboards/sofle/keymaps/noqmk/rules.mk b/keyboards/sofle/keymaps/noqmk/rules.mk new file mode 100644 index 0000000000..6685b8492c --- /dev/null +++ b/keyboards/sofle/keymaps/noqmk/rules.mk @@ -0,0 +1,6 @@ +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 +ENCODER_ENABLE = yes +CONSOLE_ENABLE = no +EXTRAKEY_ENABLE = yes +WPM_ENABLE = yes diff --git a/keyboards/sofle/keymaps/rgb_default/keymap.c b/keyboards/sofle/keymaps/rgb_default/keymap.c index 30f374f296..b6608b86a3 100644 --- a/keyboards/sofle/keymaps/rgb_default/keymap.c +++ b/keyboards/sofle/keymaps/rgb_default/keymap.c @@ -231,7 +231,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RESET| | | | | | | | | | | | | + * | QK_BOOT| | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * |RGB_TOG|hue^ |sat ^ | bri ^| |COLEMAK|-------. ,-------|desk <| | |desk >| | | * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| @@ -245,7 +245,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,------------------------------------------------. ,---------------------------------------------------. EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| - RESET, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + QK_BOOT, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| RGB_TOG, RGB_HUI,RGB_SAI, RGB_VAI, KC_COLEMAKDH,KC_COLEMAK, C(G(KC_LEFT)),KC_NO,KC_NO,C(G(KC_RGHT)),XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------| @@ -286,7 +286,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | qwer | cole |col_dh| low | raise| adj | |numpad| | | | |RESET | + * | qwer | cole |col_dh| low | raise| adj | |numpad| | | | |QK_BOOT | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | |-------. ,-------| | | | | |EEP_RST| * |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------| @@ -301,7 +301,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,------------------------------------------------. ,---------------------------------------------------. _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| - TO(0), TO(1), TO(2), TO(3), TO(4), TO(5), TO(6), KC_NO, KC_NO, KC_NO, KC_NO, RESET, + TO(0), TO(1), TO(2), TO(3), TO(4), TO(5), TO(6), KC_NO, KC_NO, KC_NO, KC_NO, QK_BOOT, //|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------| KC_NO, KC_NO, KC_BRIU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, EEP_RST, //|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------| |