From e8978a05c4991709ed607d47ea23967212e98f6b Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Thu, 27 Aug 2020 23:18:44 -0500 Subject: [PATCH 01/46] Adding my keymap --- .../rgbkb/zen/rev1/keymaps/cwebster2/config.h | 38 +++++++++++++ .../rgbkb/zen/rev1/keymaps/cwebster2/keymap.c | 55 +++++++++++++++++++ .../cwebster2/rgbkb_zen_rev1_layout_mine.json | 1 + .../rgbkb/zen/rev1/keymaps/cwebster2/rules.mk | 1 + 4 files changed, 95 insertions(+) create mode 100644 keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h create mode 100644 keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c create mode 100644 keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json create mode 100644 keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h new file mode 100644 index 000000000000..4a549c5b1f75 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Danny Nguyen + +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 + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c new file mode 100644 index 000000000000..da2a21586880 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c @@ -0,0 +1,55 @@ +#include QMK_KEYBOARD_H + + +enum layer_number { + _QWERTY = 0, + _SYMBOLS, + _NAV +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMBOLS, + NAV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + /* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GRV | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Bksp | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | MO2 | GUI | Alt |RGBTOG| ESC |Space | CTRL || GUI |Enter | left | down | up | right| MO1 | + * `------------------------------------------------''-----------------------------------------------' + */ + + + [_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_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_BSPC, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + MO(2), KC_LGUI, KC_LALT, RGB_TOG, KC_ESC, KC_SPC, KC_LCTL, KC_LGUI, KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MO(1) \ + ), + + + + + [_SYMBOLS] = 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_TRNS, RGB_RMOD, RGB_VAI, KC_TRNS, KC_LBRC, KC_RBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ + KC_TRNS, RGB_RMOD, RGB_VAD, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ + KC_LSFT, RGB_SPD, RGB_SPI, KC_TRNS, KC_MINS, KC_EQL, NK_TOGG, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_TRNS \ + ), + + + [_NAV] = LAYOUT(KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) +}; diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json new file mode 100644 index 000000000000..248360c6e753 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json @@ -0,0 +1 @@ +{"version":1,"notes":"","documentation":"\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"rgbkb/zen/rev1","keymap":"rgbkb_zen_rev1_layout_mine","layout":"LAYOUT","layers":[["KC_GRV","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_BSPC","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_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","MO(2)","KC_LGUI","KC_LALT","RGB_TOG","KC_ESC","KC_SPC","KC_LCTL","KC_LGUI","KC_ENT","KC_LEFT","KC_DOWN","KC_UP","KC_RGHT","MO(1)"],["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_TRNS","RGB_RMOD","RGB_VAI","KC_TRNS","KC_LBRC","KC_RBRC","KC_RBRC","KC_PGUP","KC_UP","KC_PGDN","KC_INS","KC_HOME","KC_TRNS","RGB_RMOD","RGB_VAD","KC_TRNS","KC_LCBR","KC_RCBR","KC_TRNS","KC_LEFT","KC_DOWN","KC_RGHT","KC_DEL","KC_END","KC_LSFT","RGB_SPD","RGB_SPI","KC_TRNS","KC_TRNS","KC_TRNS","NK_TOGG","KC_TRNS","KC_TRNS","KC_MPLY","KC_MPRV","KC_MNXT","KC_LCTL","KC_LGUI","KC_LALT","RGB_MOD","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MUTE","KC_VOLU","KC_TRNS"],["KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO"]],"author":""} \ No newline at end of file diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk new file mode 100644 index 000000000000..1e3cebb14515 --- /dev/null +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes From 24d0d8a6887fbb0357e0935d4176c758aaf4034e Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Thu, 27 Aug 2020 23:31:58 -0500 Subject: [PATCH 02/46] Add a starter keymap for kyria --- keyboards/kyria/keymaps/cwebster2/config.h | 33 ++++ keyboards/kyria/keymaps/cwebster2/keymap.c | 219 +++++++++++++++++++++ keyboards/kyria/keymaps/cwebster2/rules.mk | 3 + 3 files changed, 255 insertions(+) create mode 100644 keyboards/kyria/keymaps/cwebster2/config.h create mode 100644 keyboards/kyria/keymaps/cwebster2/keymap.c create mode 100644 keyboards/kyria/keymaps/cwebster2/rules.mk diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h new file mode 100644 index 000000000000..c3f9f6078ca8 --- /dev/null +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -0,0 +1,33 @@ +/* Copyright 2019 Thomas Baart + * + * 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 + +#ifdef OLED_DRIVER_ENABLE + #define OLED_DISPLAY_128X64 +#endif + +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 +#endif + +#define EE_HANDS +// If you are using an Elite C rev3 on the slave side, uncomment the lines below: +// #define SPLIT_USB_DETECT +// #define NO_USB_STARTUP_CHECK diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c new file mode 100644 index 000000000000..028d335d9cbb --- /dev/null +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -0,0 +1,219 @@ +/* Copyright 2019 Thomas Baart + * + * 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 layers { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * Base Layer: QWERTY + * + * ,-------------------------------------------. ,-------------------------------------------. + * |RAIS/ESC| Q | W | E | R | T | | Y | U | I | O | P | | \ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * |Ctrl/BS | A | S | D | F | G | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B |LShift|LShift| |LShift|LShift| N | M | , < | . > | / ? | - _ | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | GUI | Del | Enter| Space| Esc | | Enter| Space| Tab | Bksp | AltGr| + * | | | Alt | Lower| Raise| | Lower| Raise| | | | + * `----------------------------------' `----------------------------------' + */ + [_QWERTY] = LAYOUT( + LT(_RAISE, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), 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_LSFT, KC_LSFT, KC_LSFT, KC_LSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_LGUI, KC_DEL, MT(MOD_LALT, KC_ENT), LT(_LOWER, KC_SPC), LT(_RAISE, KC_ESC), LT(_LOWER, KC_ENT), LT(_RAISE, KC_SPC), KC_TAB, KC_BSPC, KC_RALT + ), +/* + * Lower Layer: Symbols + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | { | } | | | | | | | | | | \ | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` | | + | - | / | * | % | ' " | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | | & | = | , | . | / ? | - _ | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | ; | = | | = | ; | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [_LOWER] = LAYOUT( + _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, KC_BSLS, + _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + _______, _______, _______, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, _______, _______, _______ + ), +/* + * Raise Layer: Number keys, media, navigation + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | | Prev | Play | Next | VolUp| | Left | Down | Up | Right| | | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | | | Mute | VolDn| | | | | | MLeft| Mdown| MUp |MRight| | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [_RAISE] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +/* + * Adjust Layer: Function keys, RGB + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+------| |------+------+------+------+------+--------| + * | | TOG | SAI | HUI | VAI | MOD | | | | | F11 | F12 | | + * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| + * | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | | + * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + * | | | | | | | | | | | | + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______, _______, _______, KC_F11, KC_F12, _______, + _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +// /* +// * Layer template +// * +// * ,-------------------------------------------. ,-------------------------------------------. +// * | | | | | | | | | | | | | | +// * |--------+------+------+------+------+------| |------+------+------+------+------+--------| +// * | | | | | | | | | | | | | | +// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| +// * | | | | | | | | | | | | | | | | | | +// * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' +// * | | | | | | | | | | | | +// * | | | | | | | | | | | | +// * `----------------------------------' `----------------------------------' +// */ +// [_LAYERINDEX] = LAYOUT( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ), +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +static void render_kyria_logo(void) { + static const char PROGMEM kyria_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 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,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 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,240,252,255, 31, 7, 1, 0, 0,192,240,252,254,255,247,243,177,176, 48, 48, 48, 48, 48, 48, 48,120,254,135, 1, 0, 0,255,255, 0, 0, 1,135,254,120, 48, 48, 48, 48, 48, 48, 48,176,177,243,247,255,254,252,240,192, 0, 0, 1, 7, 31,255,252,240, 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,255,255,255, 0, 0, 0, 0, 0,254,255,255, 1, 1, 7, 30,120,225,129,131,131,134,134,140,140,152,152,177,183,254,248,224,255,255,224,248,254,183,177,152,152,140,140,134,134,131,131,129,225,120, 30, 7, 1, 1,255,255,254, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,255,255, 0, 0,192,192, 48, 48, 0, 0,240,240, 0, 0, 0, 0, 0, 0,240,240, 0, 0,240,240,192,192, 48, 48, 48, 48,192,192, 0, 0, 48, 48,243,243, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,192,192, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,127,255,255,128,128,224,120, 30,135,129,193,193, 97, 97, 49, 49, 25, 25,141,237,127, 31, 7,255,255, 7, 31,127,237,141, 25, 25, 49, 49, 97, 97,193,193,129,135, 30,120,224,128,128,255,255,127, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 63, 63, 3, 3, 12, 12, 48, 48, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 15, 15, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 63, 63, 48, 48, 0, 0, 12, 12, 51, 51, 51, 51, 51, 51, 63, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 63,255,248,224,128, 0, 0, 3, 15, 63,127,255,239,207,141, 13, 12, 12, 12, 12, 12, 12, 12, 30,127,225,128, 0, 0,255,255, 0, 0,128,225,127, 30, 12, 12, 12, 12, 12, 12, 12, 13,141,207,239,255,127, 63, 15, 3, 0, 0,128,224,248,255, 63, 15, 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, 3, 7, 15, 62,124,248,240,224,192,128, 1, 3, 7, 15, 30, 28, 60, 56,120,112,112,224,224,225,231,254,248,255,255,248,254,231,225,224,224,112,112,120, 56, 60, 28, 30, 15, 7, 3, 1,128,192,224,240,248,124, 62, 15, 7, 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, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 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 + }; + oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); +} + +static void render_qmk_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 render_status(void) { + // QMK Logo and version information + render_qmk_logo(); + oled_write_P(PSTR("Kyria rev1.0\n\n"), false); + + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + default: + oled_write_P(PSTR("Undefined\n"), false); + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); + oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_kyria_logo(); + } +} +#endif + +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + // Volume control + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + // Page up/Page down + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } +} +#endif diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk new file mode 100644 index 000000000000..60fa2ead585f --- /dev/null +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -0,0 +1,3 @@ +OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays +#ENCODER_ENABLE = yes # Enables the use of one or more encoders +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow From ef01670d53a67c8ba0e7491ee59061ba78cfe338 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 28 Aug 2020 22:56:18 -0500 Subject: [PATCH 03/46] Updated keymap --- keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c index da2a21586880..3481ddc8687e 100644 --- a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_BSPC, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - MO(2), KC_LGUI, KC_LALT, RGB_TOG, KC_ESC, KC_SPC, KC_LCTL, KC_LGUI, KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MO(1) \ + MO(2), KC_LGUI, KC_LALT, RGB_TOG, TT(2), KC_SPC, LCTL_T(KC_ESC), LGUI_T(KC_BSPC), KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MO(1) \ ), From 66cf686662673922377ec28d6a59aef812ab38ee Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Thu, 3 Sep 2020 18:29:58 -0500 Subject: [PATCH 04/46] Add auto shift, tapping modifications and gravatar oled bitmap --- keyboards/kyria/keymaps/cwebster2/config.h | 8 +++++++ keyboards/kyria/keymaps/cwebster2/gravatar.c | 23 ++++++++++++++++++++ keyboards/kyria/keymaps/cwebster2/rules.mk | 1 + 3 files changed, 32 insertions(+) create mode 100644 keyboards/kyria/keymaps/cwebster2/gravatar.c diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index c3f9f6078ca8..4a8537d851ea 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -27,6 +27,14 @@ #define RGBLIGHT_VAL_STEP 8 #endif +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT + +#define AUTO_SHIFT_TIMEOUT 150 +#define NO_AUTO_SHIFT_SPECIAL +#define NO_AUTO_SHIFT_ALPHA + #define EE_HANDS // If you are using an Elite C rev3 on the slave side, uncomment the lines below: // #define SPLIT_USB_DETECT diff --git a/keyboards/kyria/keymaps/cwebster2/gravatar.c b/keyboards/kyria/keymaps/cwebster2/gravatar.c new file mode 100644 index 000000000000..46b9ef9205df --- /dev/null +++ b/keyboards/kyria/keymaps/cwebster2/gravatar.c @@ -0,0 +1,23 @@ +const unsigned char NaN [] PROGMEM = { + // 'gravatar, 80x32px +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0xe0, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x07, 0x30, +0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x06, 0x18, 0x3f, 0xff, 0x00, 0x00, 0x7f, 0xff, +0xff, 0xff, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0x3e, 0x1e, 0x7f, 0xff, +0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xf8, 0x07, 0xff, 0xff, 0xff, +0xc0, 0x0c, 0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xff, 0xff, 0x80, 0x38, 0x7f, 0xff, 0xff, 0xe0, +0x01, 0xff, 0xff, 0xff, 0x03, 0xe0, 0x3f, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0x13, 0x88, +0x3f, 0xff, 0xff, 0x80, 0x00, 0x1f, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, 0x00, 0x00, 0x00, +0x7f, 0xff, 0x10, 0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0x1f, 0xfe, 0x7f, 0xf0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xae, 0x04, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +0x80, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x03, 0xf0, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x1c, 0x09, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, +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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 60fa2ead585f..22fbcb4653ab 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -1,3 +1,4 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays #ENCODER_ENABLE = yes # Enables the use of one or more encoders RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUTO_SHIFT_ENABLE = yes # Enable autoshift From 77a8fef6c21db4bb5a3e7ffd417e6a4c0dfc9d9b Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 4 Sep 2020 10:42:37 -0500 Subject: [PATCH 05/46] Add flashing helper scripts --- flash_kyria.sh | 3 +++ flash_zenr1.sh | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 flash_kyria.sh create mode 100755 flash_zenr1.sh diff --git a/flash_kyria.sh b/flash_kyria.sh new file mode 100755 index 000000000000..514e559f9184 --- /dev/null +++ b/flash_kyria.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +bin/qmk flash -kb kyria/rev1 -km cwebster2 diff --git a/flash_zenr1.sh b/flash_zenr1.sh new file mode 100755 index 000000000000..34ed474c6b3b --- /dev/null +++ b/flash_zenr1.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +bin/qmk flash -kb rgbkb/zen/rev1 -km cwebster2 From 7503f3c3e88e9964b4373135fb783fc2d528c77c Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 18 Sep 2020 10:49:26 -0500 Subject: [PATCH 06/46] Updates to my keymap --- keyboards/kyria/keymaps/cwebster2/keymap.c | 77 ++++++++++++++++------ 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 028d335d9cbb..81cdffa4fb6d 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ #include QMK_KEYBOARD_H +#include enum layers { _QWERTY = 0, @@ -37,11 +38,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | Alt | Lower| Raise| | Lower| Raise| | | | * `----------------------------------' `----------------------------------' */ + // TODO: i3, kitty keys, = somewhere on layer, what on the raise/lower taps, mod on sysreq? [_QWERTY] = LAYOUT( - LT(_RAISE, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, - MT(MOD_LCTL, KC_BSPC), 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_LSFT, KC_LSFT, KC_LSFT, KC_LSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - KC_LGUI, KC_DEL, MT(MOD_LALT, KC_ENT), LT(_LOWER, KC_SPC), LT(_RAISE, KC_ESC), LT(_LOWER, KC_ENT), LT(_RAISE, KC_SPC), KC_TAB, KC_BSPC, KC_RALT + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LSPO, KC_LALT, KC_RALT, KC_RSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + S(KC_LGUI), S(KC_LCTL), LT(_RAISE, KC_TAB), KC_SPC, MT(MOD_LCTL, KC_ESC), MT(MOD_LGUI, KC_BSPC), KC_ENT, LT(_LOWER, KC_TAB), KC_SPC, KC_SYSREQ ), /* * Lower Layer: Symbols @@ -61,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, KC_BSLS, _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - _______, _______, _______, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* * Raise Layer: Number keys, media, navigation @@ -125,8 +127,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ), }; +static void send_layer_via_hid(char *layer) { + raw_hid_send((uint8_t*)layer, sizeof(layer)); +} + layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + layer_state_t new_state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + switch (get_highest_layer(new_state)) { + case _QWERTY: + send_layer_via_hid("Default"); + //rgblight_sethsv_noeeprom(0, 0, 255); + break; + case _LOWER: + send_layer_via_hid("Lower"); + //rgblight_sethsv_noeeprom(255, 0, 0); + break; + case _RAISE: + send_layer_via_hid("Raise"); + break; + case _ADJUST: + send_layer_via_hid("Adjust"); + break; + default: + send_layer_via_hid("Undefined"); + } + return new_state; } #ifdef OLED_DRIVER_ENABLE @@ -134,18 +159,24 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -static void render_kyria_logo(void) { - static const char PROGMEM kyria_logo[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,224,240,112,120, 56, 60, 28, 30, 14, 14, 14, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 30, 28, 60, 56,120,112,240,224,192,128,128, 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,192,224,240,124, 62, 31, 15, 7, 3, 1,128,192,224,240,120, 56, 60, 28, 30, 14, 14, 7, 7,135,231,127, 31,255,255, 31,127,231,135, 7, 7, 14, 14, 30, 28, 60, 56,120,240,224,192,128, 1, 3, 7, 15, 31, 62,124,240,224,192, 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,240,252,255, 31, 7, 1, 0, 0,192,240,252,254,255,247,243,177,176, 48, 48, 48, 48, 48, 48, 48,120,254,135, 1, 0, 0,255,255, 0, 0, 1,135,254,120, 48, 48, 48, 48, 48, 48, 48,176,177,243,247,255,254,252,240,192, 0, 0, 1, 7, 31,255,252,240, 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,255,255,255, 0, 0, 0, 0, 0,254,255,255, 1, 1, 7, 30,120,225,129,131,131,134,134,140,140,152,152,177,183,254,248,224,255,255,224,248,254,183,177,152,152,140,140,134,134,131,131,129,225,120, 30, 7, 1, 1,255,255,254, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0,255,255, 0, 0,192,192, 48, 48, 0, 0,240,240, 0, 0, 0, 0, 0, 0,240,240, 0, 0,240,240,192,192, 48, 48, 48, 48,192,192, 0, 0, 48, 48,243,243, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,192,192, 0, 0, 0, 0, 0, - 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,127,255,255,128,128,224,120, 30,135,129,193,193, 97, 97, 49, 49, 25, 25,141,237,127, 31, 7,255,255, 7, 31,127,237,141, 25, 25, 49, 49, 97, 97,193,193,129,135, 30,120,224,128,128,255,255,127, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 63, 63, 3, 3, 12, 12, 48, 48, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 15, 15, 0, 0, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 63, 63, 48, 48, 0, 0, 12, 12, 51, 51, 51, 51, 51, 51, 63, 63, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 15, 63,255,248,224,128, 0, 0, 3, 15, 63,127,255,239,207,141, 13, 12, 12, 12, 12, 12, 12, 12, 30,127,225,128, 0, 0,255,255, 0, 0,128,225,127, 30, 12, 12, 12, 12, 12, 12, 12, 13,141,207,239,255,127, 63, 15, 3, 0, 0,128,224,248,255, 63, 15, 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, 3, 7, 15, 62,124,248,240,224,192,128, 1, 3, 7, 15, 30, 28, 60, 56,120,112,112,224,224,225,231,254,248,255,255,248,254,231,225,224,224,112,112,120, 56, 60, 28, 30, 15, 7, 3, 1,128,192,224,240,248,124, 62, 15, 7, 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, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 15, 14, 30, 28, 60, 56,120,112,112,112,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,112,112,112,120, 56, 60, 28, 30, 14, 15, 7, 3, 1, 1, 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 +static void render_logo(void) { + static const char PROGMEM logo[] = { + // canvas is 128x64. need 16 padding + // 80x32 + 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x60, 0xe0, 0xf0, 0xfe, 0xfe, 0xf0, 0x60, 0x20, 0x20, 0x20, 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, 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, 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, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x7c, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0x7c, 0xf8, 0xe0, 0x60, 0x20, 0x10, 0x10, 0x0c, 0x0f, 0x09, 0x08, 0x00, 0x09, 0x9b, 0x5c, 0x50, 0x10, 0x20, 0x40, 0xe0, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x78, 0x38, 0x38, 0x10, 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, + 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x17, 0x15, 0x3d, 0xef, 0xaf, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x40, 0xa0, 0xbf, 0xff, 0x3f, 0x3f, 0x3f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, 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, 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, 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, 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, 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, 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, 0x00, 0x00 }; - oled_write_raw_P(kyria_logo, sizeof(kyria_logo)); + oled_write_raw_P(logo, sizeof(logo)); } static void render_qmk_logo(void) { @@ -160,7 +191,7 @@ static void render_qmk_logo(void) { static void render_status(void) { // QMK Logo and version information render_qmk_logo(); - oled_write_P(PSTR("Kyria rev1.0\n\n"), false); + oled_write_P(PSTR("Kyria rev1.3\n\n"), false); // Host Keyboard Layer Status oled_write_P(PSTR("Layer: "), false); @@ -192,11 +223,19 @@ void oled_task_user(void) { if (is_keyboard_master()) { render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) } else { - render_kyria_logo(); + render_logo(); } } #endif + +#ifdef RAW_ENABLE +void raw_hid_receive(uint8_t *data, uint8_t length) { + // messages from host + // add ability to set color +} +#endif + #ifdef ENCODER_ENABLE void encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { From f735afd37c5e5b27db078b1c471914d89cb9ed7c Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 18 Sep 2020 10:49:45 -0500 Subject: [PATCH 07/46] Enable raw hid and rgblight sleep --- keyboards/kyria/keymaps/cwebster2/config.h | 3 ++- keyboards/kyria/keymaps/cwebster2/rules.mk | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 4a8537d851ea..4fe977c64c19 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -25,13 +25,14 @@ #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_SLEEP #endif #define TAPPING_TERM 200 #define PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT -#define AUTO_SHIFT_TIMEOUT 150 +#define AUTO_SHIFT_TIMEOUT 200 #define NO_AUTO_SHIFT_SPECIAL #define NO_AUTO_SHIFT_ALPHA diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 22fbcb4653ab..76790a5da04d 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -2,3 +2,4 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays #ENCODER_ENABLE = yes # Enables the use of one or more encoders RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUTO_SHIFT_ENABLE = yes # Enable autoshift +RAW_ENABLE = yes From 412d8a8acefa8bf09ae535f36494e80e6c5f4333 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 18 Sep 2020 14:32:12 -0500 Subject: [PATCH 08/46] Cleanup --- flash_kyria.sh | 3 --- keyboards/kyria/keymaps/cwebster2/gravatar.c | 23 -------------------- 2 files changed, 26 deletions(-) delete mode 100755 flash_kyria.sh delete mode 100644 keyboards/kyria/keymaps/cwebster2/gravatar.c diff --git a/flash_kyria.sh b/flash_kyria.sh deleted file mode 100755 index 514e559f9184..000000000000 --- a/flash_kyria.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -bin/qmk flash -kb kyria/rev1 -km cwebster2 diff --git a/keyboards/kyria/keymaps/cwebster2/gravatar.c b/keyboards/kyria/keymaps/cwebster2/gravatar.c deleted file mode 100644 index 46b9ef9205df..000000000000 --- a/keyboards/kyria/keymaps/cwebster2/gravatar.c +++ /dev/null @@ -1,23 +0,0 @@ -const unsigned char NaN [] PROGMEM = { - // 'gravatar, 80x32px -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0xe0, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x07, 0x30, -0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x06, 0x18, 0x3f, 0xff, 0x00, 0x00, 0x7f, 0xff, -0xff, 0xff, 0x07, 0xf8, 0x3f, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0x3e, 0x1e, 0x7f, 0xff, -0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xf8, 0x07, 0xff, 0xff, 0xff, -0xc0, 0x0c, 0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xff, 0xff, 0x80, 0x38, 0x7f, 0xff, 0xff, 0xe0, -0x01, 0xff, 0xff, 0xff, 0x03, 0xe0, 0x3f, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0x13, 0x88, -0x3f, 0xff, 0xff, 0x80, 0x00, 0x1f, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xff, 0x00, 0x00, 0x00, -0x7f, 0xff, 0x10, 0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0x1f, 0xfe, 0x7f, 0xf0, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xae, 0x04, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -0x80, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x03, 0xf0, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1c, 0x09, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, -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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; From 832de97c19ef9d9f2a59ddbf4842ab9348a42d37 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 18 Sep 2020 23:15:29 -0500 Subject: [PATCH 09/46] Updated keymap and board features --- keyboards/kyria/keymaps/cwebster2/config.h | 37 ++++- keyboards/kyria/keymaps/cwebster2/keymap.c | 173 +++++++++++++-------- keyboards/kyria/keymaps/cwebster2/rules.mk | 6 +- 3 files changed, 148 insertions(+), 68 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 4fe977c64c19..61b991901e92 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -22,12 +22,23 @@ #ifdef RGBLIGHT_ENABLE #define RGBLIGHT_ANIMATIONS +//#define RGBLIGHT_EFFECT_ALTERNATING +//#define RGBLIGHT_EFFECT_BREATHING +//#define RGBLIGHT_EFFECT_CHRISTMAS +//#define RGBLIGHT_EFFECT_KNIGHT +//#define RGBLIGHT_EFFECT_RAINBOW_MOOD +//#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +//#define RGBLIGHT_EFFECT_RGB_TEST +//#define RGBLIGHT_EFFECT_SNAKE +//#define RGBLIGHT_EFFECT_STATIC_GRADIENT +//#define RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_SLEEP #endif +#define TAPPING_TOGGLE 1 #define TAPPING_TERM 200 #define PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT @@ -37,6 +48,26 @@ #define NO_AUTO_SHIFT_ALPHA #define EE_HANDS -// If you are using an Elite C rev3 on the slave side, uncomment the lines below: -// #define SPLIT_USB_DETECT -// #define NO_USB_STARTUP_CHECK + + +/* Disable unused and unneeded features to reduce on firmware size */ +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif + +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, L25, L26, L27, R27, R26, R25, R24, R23, R22, R21, R20, \ + L33, L34, L35, L36, L37, R37, R36, R35, R34, R33 \ + ) \ + LAYOUT ( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R05, KC_##R04, KC_##R03, KC_##R02, KC_##R01, KC_##R00, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R15, KC_##R14, KC_##R13, KC_##R12, KC_##R11, KC_##R10, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R27, KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, \ + KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ + ) + diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 81cdffa4fb6d..9b3e583bbe02 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include +#include "raw_hid.h" enum layers { _QWERTY = 0, @@ -23,47 +23,63 @@ enum layers { _ADJUST }; +#define KC_RAISE TT(_RAISE) +#define KC_LOWER TT(_LOWER) +#define KC_KITTY S(KC_LCTL) +#define KC_I3 S(KC_LGUI) +#define KC_CTLESC MT(MOD_LCTL, KC_ESC) +#define KC_GUIBS MT(MOD_LGUI, KC_BSPC) +#define KC_ALTCLN MT(MOD_LALT, KC_COLON) +#define KC_RTOG RGB_TOG +#define KC_RSAI RGB_SAI +#define KC_RHUI RGB_HUI +#define KC_RVAI RGB_VAI +#define KC_RMOD RGB_MOD +#define KC_RSAD RGB_SAD +#define KC_RHUD RGB_HUD +#define KC_RVAD RGB_VAD +#define KC_RRMD RGB_RMOD + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * Base Layer: QWERTY - * - * ,-------------------------------------------. ,-------------------------------------------. - * |RAIS/ESC| Q | W | E | R | T | | Y | U | I | O | P | | \ | - * |--------+------+------+------+------+------| |------+------+------+------+------+--------| - * |Ctrl/BS | A | S | D | F | G | | H | J | K | L | ; : | ' " | - * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B |LShift|LShift| |LShift|LShift| N | M | , < | . > | / ? | - _ | - * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - * | GUI | Del | Enter| Space| Esc | | Enter| Space| Tab | Bksp | AltGr| - * | | | Alt | Lower| Raise| | Lower| Raise| | | | - * `----------------------------------' `----------------------------------' */ - // TODO: i3, kitty keys, = somewhere on layer, what on the raise/lower taps, mod on sysreq? - [_QWERTY] = LAYOUT( - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, - 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LSPO, KC_LALT, KC_RALT, KC_RSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - S(KC_LGUI), S(KC_LCTL), LT(_RAISE, KC_TAB), KC_SPC, MT(MOD_LCTL, KC_ESC), MT(MOD_LGUI, KC_BSPC), KC_ENT, LT(_LOWER, KC_TAB), KC_SPC, KC_SYSREQ + [_QWERTY] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + I3, KITTY, RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, SPC, PSCR + // `----------------------------------' `----------------------------------' ), /* * Lower Layer: Symbols * * ,-------------------------------------------. ,-------------------------------------------. - * | | ! | @ | { | } | | | | | | | | | | \ | + * | | ! | @ | | | [ | ] | | | | | | | | \ | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` | | + | - | / | * | % | ' " | + * | | # | $ | ` | { | } | | + | - | / | * | % | ' " | * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | | | & | = | , | . | / ? | - _ | + * | | % | ^ | ~ | ( | ) | | | | | | & | = | , | . | / ? | - _ | * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - * | | | | ; | = | | = | ; | | | | + * | | | | | | | | | | | | * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' */ - [_LOWER] = LAYOUT( - _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, KC_BSLS, - _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, - _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, _______, _______, _______, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + [_LOWER] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, EXLM, AT, PIPE, LBRC, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, HASH, DLR, GRV, LCBR, RCBR, PLUS, MINS, SLSH, ASTR, PERC, QUOT, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, PERC, CIRC, TILD, LPRN, RPRN, TRNS, TRNS, TRNS, TRNS, AMPR, EQL, COMM, DOT, SLSH, MINS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' ), /* * Raise Layer: Number keys, media, navigation @@ -79,12 +95,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' */ - [_RAISE] = LAYOUT( - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, - _______, _______, _______, _______, KC_MUTE, KC_VOLD, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), + [_RAISE] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, TRNS, MPRV, MPLY, MNXT, VOLU, LEFT, DOWN, UP, RGHT, TRNS, TRNS, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, TRNS, TRNS, TRNS, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' + ), /* * Adjust Layer: Function keys, RGB * @@ -99,54 +120,77 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' */ - [_ADJUST] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______, _______, _______, KC_F11, KC_F12, _______, - _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), -// /* -// * Layer template -// * -// * ,-------------------------------------------. ,-------------------------------------------. -// * | | | | | | | | | | | | | | -// * |--------+------+------+------+------+------| |------+------+------+------+------+--------| -// * | | | | | | | | | | | | | | -// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| -// * | | | | | | | | | | | | | | | | | | -// * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' -// * | | | | | | | | | | | | -// * | | | | | | | | | | | | -// * `----------------------------------' `----------------------------------' -// */ -// [_LAYERINDEX] = LAYOUT( -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -// ), + [_ADJUST] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, RTOG, RSAI, RHUI, RVAI, RMOD, TRNS, TRNS, TRNS, F11, F12, TRNS, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, TRNS, RSAD, RHUD, RVAD, RRMD, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' + ), + // + // * Layer template + // + // [_LAYERINDEX] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' + // ), }; static void send_layer_via_hid(char *layer) { - raw_hid_send((uint8_t*)layer, sizeof(layer)); + //raw_hid_send((uint8_t*)layer, sizeof(layer)); + return; } +/* RGB LIGHT LAYERS +const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 10, HSV_AZURE} +); + +const rgblight_segment_t PROGMEM my_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 10, HSV_RED} +); + +const rgblight_segment_t PROGMEM my_lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 10, HSV_TURQUOISE} +); + +const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 10, HSV_PURPLE} +); +*/ + + + layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t new_state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + switch (get_highest_layer(new_state)) { case _QWERTY: send_layer_via_hid("Default"); - //rgblight_sethsv_noeeprom(0, 0, 255); + rgblight_sethsv_noeeprom(HSV_BLUE); break; case _LOWER: send_layer_via_hid("Lower"); - //rgblight_sethsv_noeeprom(255, 0, 0); + rgblight_sethsv_noeeprom(HSV_RED); break; case _RAISE: send_layer_via_hid("Raise"); + rgblight_sethsv_noeeprom(HSV_TURQUOISE); break; case _ADJUST: send_layer_via_hid("Adjust"); + rgblight_sethsv_noeeprom(HSV_PURPLE); break; default: send_layer_via_hid("Undefined"); @@ -200,10 +244,10 @@ static void render_status(void) { oled_write_P(PSTR("Default\n"), false); break; case _LOWER: - oled_write_P(PSTR("Lower\n"), false); + oled_write_P(PSTR("Lower / Symbols\n"), false); break; case _RAISE: - oled_write_P(PSTR("Raise\n"), false); + oled_write_P(PSTR("Raise / Numbers\n"), false); break; case _ADJUST: oled_write_P(PSTR("Adjust\n"), false); @@ -233,6 +277,7 @@ void oled_task_user(void) { void raw_hid_receive(uint8_t *data, uint8_t length) { // messages from host // add ability to set color + raw_hid_send(data, length); } #endif diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 76790a5da04d..30f66106d3b2 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -1,5 +1,9 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays -#ENCODER_ENABLE = yes # Enables the use of one or more encoders RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUTO_SHIFT_ENABLE = yes # Enable autoshift +MOUSEKEY_ENABLE = yes +CONSOLE_ENABLE = no +BOOTMAGIC_ENABLE = no RAW_ENABLE = yes +Link_Time_Optimization = yes +EXTRAFLAGS = -flto From 2fc075324c0477388b57e7f2c84e5d7829989fd0 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sat, 19 Sep 2020 00:09:05 -0500 Subject: [PATCH 10/46] Remove some RGB modes for space --- keyboards/kyria/keymaps/cwebster2/config.h | 24 +++++++++++----------- keyboards/kyria/keymaps/cwebster2/keymap.c | 4 ++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 61b991901e92..93020b7badf5 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -21,21 +21,22 @@ #endif #ifdef RGBLIGHT_ENABLE - #define RGBLIGHT_ANIMATIONS -//#define RGBLIGHT_EFFECT_ALTERNATING -//#define RGBLIGHT_EFFECT_BREATHING -//#define RGBLIGHT_EFFECT_CHRISTMAS -//#define RGBLIGHT_EFFECT_KNIGHT -//#define RGBLIGHT_EFFECT_RAINBOW_MOOD -//#define RGBLIGHT_EFFECT_RAINBOW_SWIRL -//#define RGBLIGHT_EFFECT_RGB_TEST -//#define RGBLIGHT_EFFECT_SNAKE -//#define RGBLIGHT_EFFECT_STATIC_GRADIENT -//#define RGBLIGHT_EFFECT_TWINKLE + //#define RGBLIGHT_ANIMATIONS + //#define RGBLIGHT_EFFECT_ALTERNATING + #define RGBLIGHT_EFFECT_BREATHING + //#define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_RAINBOW_MOOD + //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_SNAKE + //#define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_SLEEP + #define RGBLIGHT_LIMIT_VAL 128 #endif #define TAPPING_TOGGLE 1 @@ -70,4 +71,3 @@ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R27, KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, \ KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ ) - diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 9b3e583bbe02..af9ea3d8c4bd 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -23,6 +23,7 @@ enum layers { _ADJUST }; +// shortcuts for certain keys to use LAYOUT_kc() #define KC_RAISE TT(_RAISE) #define KC_LOWER TT(_LOWER) #define KC_KITTY S(KC_LCTL) @@ -170,6 +171,9 @@ const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); */ +void keyboard_post_init_user(void) { + rgblight_sethsv_noeeprom(HSV_BLUE); +} layer_state_t layer_state_set_user(layer_state_t state) { From e1e0b110b00cab3df7a662efe28057c6d1d6531d Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 20 Sep 2020 16:31:18 -0500 Subject: [PATCH 11/46] Start working on a miryoku-like keymap. This adds homerow mods to my keymap on the base layer and adds a game layer that doesnt have them --- keyboards/kyria/keymaps/cwebster2/config.h | 19 ++++- keyboards/kyria/keymaps/cwebster2/keymap.c | 94 +++++++++++++++------- keyboards/kyria/keymaps/cwebster2/rules.mk | 3 + 3 files changed, 86 insertions(+), 30 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 93020b7badf5..d9a3dff90614 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -41,6 +41,7 @@ #define TAPPING_TOGGLE 1 #define TAPPING_TERM 200 +#define TAPPING_FORCE_HOLD #define PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT @@ -48,8 +49,20 @@ #define NO_AUTO_SHIFT_SPECIAL #define NO_AUTO_SHIFT_ALPHA +#define QMK_KEYS_PER_SCAN 4 + #define EE_HANDS +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 16 +#undef MOUSEKEY_WHEEL_DELAY +#define MOUSEKEY_WHEEL_DELAY 0 +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 6 +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 64 /* Disable unused and unneeded features to reduce on firmware size */ #ifdef LOCKING_SUPPORT_ENABLE @@ -66,8 +79,8 @@ L33, L34, L35, L36, L37, R37, R36, R35, R34, R33 \ ) \ LAYOUT ( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R05, KC_##R04, KC_##R03, KC_##R02, KC_##R01, KC_##R00, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R15, KC_##R14, KC_##R13, KC_##R12, KC_##R11, KC_##R10, \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R05, KC_##R04, KC_##R03, KC_##R02, KC_##R01, KC_##R00, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R15, KC_##R14, KC_##R13, KC_##R12, KC_##R11, KC_##R10, \ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R27, KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, \ - KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ + KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ ) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index af9ea3d8c4bd..dd4c521f649d 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -15,31 +15,39 @@ */ #include QMK_KEYBOARD_H #include "raw_hid.h" +#include + +char wpm_str[10]; +uint16_t wpm_graph_timer = 0; enum layers { _QWERTY = 0, + _GAME, _LOWER, _RAISE, _ADJUST }; // shortcuts for certain keys to use LAYOUT_kc() -#define KC_RAISE TT(_RAISE) -#define KC_LOWER TT(_LOWER) -#define KC_KITTY S(KC_LCTL) -#define KC_I3 S(KC_LGUI) +#define KC_TO(a) TO(a) +#define KC_DF(a) DF(a) +#define KC_RAISE TT(_RAISE) +#define KC_LOWER TT(_LOWER) +#define KC_KITTY S(KC_LCTL) +#define KC_I3 S(KC_LGUI) #define KC_CTLESC MT(MOD_LCTL, KC_ESC) -#define KC_GUIBS MT(MOD_LGUI, KC_BSPC) -#define KC_ALTCLN MT(MOD_LALT, KC_COLON) -#define KC_RTOG RGB_TOG -#define KC_RSAI RGB_SAI -#define KC_RHUI RGB_HUI -#define KC_RVAI RGB_VAI -#define KC_RMOD RGB_MOD -#define KC_RSAD RGB_SAD -#define KC_RHUD RGB_HUD -#define KC_RVAD RGB_VAD -#define KC_RRMD RGB_RMOD +#define KC_GUIBS MT(MOD_LGUI, KC_BSPC) +#define KC_ALTCLN MT(MOD_LALT, S(KC_SCLN)) // this doesnt work. need to write a custom keycode to handle it +#define KC_RTOG RGB_TOG +#define KC_RSAI RGB_SAI +#define KC_RHUI RGB_HUI +#define KC_RVAI RGB_VAI +#define KC_RMOD RGB_MOD +#define KC_RSAD RGB_SAD +#define KC_RHUD RGB_HUD +#define KC_RVAD RGB_VAD +#define KC_RRMD RGB_RMOD +#define KC_TT(m,a) m##_T(KC_##a) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -47,15 +55,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Base Layer: QWERTY */ [_QWERTY] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - I3, KITTY, RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, SPC, PSCR - // `----------------------------------' `----------------------------------' + // ,-------------------------------------------------------. ,-------------------------------------------. + GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, + // |--------+---------+---------+---------+---------+------| |------+------+------+------+------+--------| + TAB, TT(LGUI,A),TT(LALT,S),TT(LCTL,D),TT(LSFT,F), G, H,TT(RSFT,J),TT(RCTL,K),TT(RALT,L),TT(RGUI,SCLN), QUOT, + // |--------+---------+---------+---------+---------+------+------+------. ,------+------+------+------+------+------+------+--------| + LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + // `----------------------------+---------+---------+------+------+------| |------+------+------+------+------+----------------------' + I3, KITTY, RAISE, SPC, CTLESC, GUIBS, ENT, LOWER,TO(_GAME),PSCR + // `----------------------------------------' `----------------------------------' ), /* * Lower Layer: Symbols @@ -133,6 +141,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // `----------------------------------' `----------------------------------' ), // + // GAME layout -- qwerty without homerow mods + [_GAME] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + I3, KITTY, RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, TO(_QWERTY), PSCR + // `----------------------------------' `----------------------------------' + ), // * Layer template // // [_LAYERINDEX] = LAYOUT_kc( @@ -186,7 +206,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { break; case _LOWER: send_layer_via_hid("Lower"); - rgblight_sethsv_noeeprom(HSV_RED); + rgblight_sethsv_noeeprom(HSV_MAGENTA); break; case _RAISE: send_layer_via_hid("Raise"); @@ -196,6 +216,10 @@ layer_state_t layer_state_set_user(layer_state_t state) { send_layer_via_hid("Adjust"); rgblight_sethsv_noeeprom(HSV_PURPLE); break; + case _GAME: + send_layer_via_hid("Game"); + rgblight_sethsv_noeeprom(HSV_RED); + break; default: send_layer_via_hid("Undefined"); } @@ -225,6 +249,12 @@ static void render_logo(void) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; oled_write_raw_P(logo, sizeof(logo)); + + /*oled_write_P(PSTR("Combos enabled: ", flase));*/ + /*if (is_combo_enabled()) {*/ + /* oled_write_P(PSTR("Yes\n"), false);*/ + /*} else {*/ + /* oled_write_P(PSTR("No\n"), false);*/ } static void render_qmk_logo(void) { @@ -248,18 +278,28 @@ static void render_status(void) { oled_write_P(PSTR("Default\n"), false); break; case _LOWER: - oled_write_P(PSTR("Lower / Symbols\n"), false); + oled_write_P(PSTR("Lower / Sym\n"), false); break; case _RAISE: - oled_write_P(PSTR("Raise / Numbers\n"), false); + oled_write_P(PSTR("Raise / Num\n"), false); break; case _ADJUST: oled_write_P(PSTR("Adjust\n"), false); break; + case _GAME: + oled_write_P(PSTR("Game\n"), false); + break; default: oled_write_P(PSTR("Undefined\n"), false); } +#ifdef WPM_ENABLE + // Write WPM + sprintf(wpm_str, "WPM: %03d", get_current_wpm()); + //oled_write_P(PSTR("\n"), false); + oled_write(wpm_str, false); +#endif + // Host Keyboard LED Status uint8_t led_usb_state = host_keyboard_leds(); oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 30f66106d3b2..bec7499ac43e 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -2,8 +2,11 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUTO_SHIFT_ENABLE = yes # Enable autoshift MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no BOOTMAGIC_ENABLE = no RAW_ENABLE = yes Link_Time_Optimization = yes EXTRAFLAGS = -flto +WPM_ENABLE = yes + From faeb4329eff39652605b854ebe7161ab85054f2c Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 20 Sep 2020 23:39:42 -0500 Subject: [PATCH 12/46] more work on keymaps --- keyboards/kyria/keymaps/cwebster2/config.h | 30 +++- keyboards/kyria/keymaps/cwebster2/keymap.c | 161 +++++++++++++-------- 2 files changed, 126 insertions(+), 65 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index d9a3dff90614..c66f587f5daa 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -40,8 +40,8 @@ #endif #define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 -#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 175 +//#define TAPPING_FORCE_HOLD #define PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT @@ -84,3 +84,29 @@ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R27, KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, \ KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ ) + +#define LAYOUT_left_kc( \ + L00, L01, L02, L03, L04, L05, \ + L10, L11, L12, L13, L14, L15, \ + L20, L21, L22, L23, L24, L25, L26, L27, \ + L33, L34, L35, L36, L37 \ + ) \ + LAYOUT_kc ( \ + L00, L01, L02, L03, L04, L05, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + L10, L11, L12, L13, L14, L15, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + L20, L21, L22, L23, L24, L25, L26, L27, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + L33, L34, L35, L36, L37, TRNS, TRNS, TRNS, TRNS, TRNS \ + ) + +#define LAYOUT_right_kc( \ + R05, R04, R03, R02, R01, R00, \ + R15, R14, R13, R12, R11, R10, \ + R27, R26, R25, R24, R23, R22, R21, R20, \ + R37, R36, R35, R34, R33 \ + ) \ + LAYOUT_kc ( \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, R05, R04, R03, R02, R01, R00, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, R15, R14, R13, R12, R11, R10, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, R27, R26, R25, R24, R23, R22, R21, R20, \ + TRNS, TRNS, TRNS, TRNS, TRNS, R37, R36, R35, R34, R33 \ + ) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index dd4c521f649d..1de69cdf1cee 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -22,6 +22,10 @@ uint16_t wpm_graph_timer = 0; enum layers { _QWERTY = 0, + _FN, + _SYMBOLS, + _NUM, + _NAV, _GAME, _LOWER, _RAISE, @@ -33,9 +37,8 @@ enum layers { #define KC_DF(a) DF(a) #define KC_RAISE TT(_RAISE) #define KC_LOWER TT(_LOWER) -#define KC_KITTY S(KC_LCTL) -#define KC_I3 S(KC_LGUI) -#define KC_CTLESC MT(MOD_LCTL, KC_ESC) +#define KC_KITTY(a) LCTL_T(KC_##a) +#define KC_I3(a) SCMD_T(KC_##a) #define KC_GUIBS MT(MOD_LGUI, KC_BSPC) #define KC_ALTCLN MT(MOD_LALT, S(KC_SCLN)) // this doesnt work. need to write a custom keycode to handle it #define KC_RTOG RGB_TOG @@ -48,6 +51,11 @@ enum layers { #define KC_RVAD RGB_VAD #define KC_RRMD RGB_RMOD #define KC_TT(m,a) m##_T(KC_##a) +#define KC_CTLESC MT(MOD_LCTL, KC_ESC) +#define KC_FN(a) LT(_FN, KC_##a) +#define KC_SYM(a) LT(_SYMBOLS, KC_##a) +#define KC_NUM(a) LT(_NUM, KC_##a) +#define KC_NAV(a) LT(_NAV, KC_##a) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -55,31 +63,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Base Layer: QWERTY */ [_QWERTY] = LAYOUT_kc( - // ,-------------------------------------------------------. ,-------------------------------------------. - GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, - // |--------+---------+---------+---------+---------+------| |------+------+------+------+------+--------| + // ,-----------------------------------------------------------. ,-------------------------------------------. + GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, + // |--------+----------+----------+----------+----------+------| |------+------+------+------+------+--------| TAB, TT(LGUI,A),TT(LALT,S),TT(LCTL,D),TT(LSFT,F), G, H,TT(RSFT,J),TT(RCTL,K),TT(RALT,L),TT(RGUI,SCLN), QUOT, - // |--------+---------+---------+---------+---------+------+------+------. ,------+------+------+------+------+------+------+--------| - LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, - // `----------------------------+---------+---------+------+------+------| |------+------+------+------+------+----------------------' - I3, KITTY, RAISE, SPC, CTLESC, GUIBS, ENT, LOWER,TO(_GAME),PSCR + // |--------+----------+----------+----------+----------+------+------+------. ,------+------+------+------+------+------+------+--------| + EQL, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + // `------------------------------+----------+----------+------+------+------| |------+------+------+------+------+----------------------' + I3(LBRC),KITTY(MINS),SYM(TAB),NAV(SPC),FN(ESC), FN(BSPC),NUM(ENT),SYM(DEL),TO(_GAME),PSCR // `----------------------------------------' `----------------------------------' ), -/* - * Lower Layer: Symbols - * - * ,-------------------------------------------. ,-------------------------------------------. - * | | ! | @ | | | [ | ] | | | | | | | | \ | - * |--------+------+------+------+------+------| |------+------+------+------+------+--------| - * | | # | $ | ` | { | } | | + | - | / | * | % | ' " | - * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| - * | | % | ^ | ~ | ( | ) | | | | | | & | = | , | . | / ? | - _ | - * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - * | | | | | | | | | | | | - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - */ - [_LOWER] = LAYOUT_kc( + // symbols and mouse + [_SYMBOLS] = LAYOUT_kc( // ,-------------------------------------------. ,-------------------------------------------. TRNS, EXLM, AT, PIPE, LBRC, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, // |--------+------+------+------+------+------| |------+------+------+------+------+--------| @@ -90,46 +85,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS // `----------------------------------' `----------------------------------' ), -/* - * Raise Layer: Number keys, media, navigation - * - * ,-------------------------------------------. ,-------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| |------+------+------+------+------+--------| - * | | | Prev | Play | Next | VolUp| | Left | Down | Up | Right| | | - * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| - * | | | | | Mute | VolDn| | | | | | MLeft| Mdown| MUp |MRight| | | - * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - * | | | | | | | | | | | | - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - */ - [_RAISE] = LAYOUT_kc( + [_NUM] = LAYOUT_kc( // ,-------------------------------------------. ,-------------------------------------------. - TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + TRNS, LBRC, 7, 8, 9, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, TRNS, MPRV, MPLY, MNXT, VOLU, LEFT, DOWN, UP, RGHT, TRNS, TRNS, + TRNS, SCLN, 4, 5, 6, EQL, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, TRNS, TRNS, TRNS, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, + TRNS, GRV, 1, 2, 3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, DOT, 0, MINS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' + ), + [_NAV] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, UP, RGHT, TRNS, TRNS, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS // `----------------------------------' `----------------------------------' ), -/* - * Adjust Layer: Function keys, RGB - * - * ,-------------------------------------------. ,-------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+------| |------+------+------+------+------+--------| - * | | TOG | SAI | HUI | VAI | MOD | | | | | F11 | F12 | | - * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------| - * | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | | - * `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - * | | | | | | | | | | | | - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - */ - [_ADJUST] = LAYOUT_kc( + // media and fn + [_FN] = LAYOUT_kc( // ,-------------------------------------------. ,-------------------------------------------. TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, // |--------+------+------+------+------+------| |------+------+------+------+------+--------| @@ -140,7 +119,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS // `----------------------------------' `----------------------------------' ), - // // GAME layout -- qwerty without homerow mods [_GAME] = LAYOUT_kc( // ,-------------------------------------------. ,-------------------------------------------. @@ -150,9 +128,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - I3, KITTY, RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, TO(_QWERTY), PSCR + I3(LBRC),KITTY(MINS), RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, TO(_QWERTY), PSCR + // `----------------------------------' `----------------------------------' + ), + [_LOWER] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, EXLM, AT, PIPE, LBRC, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, HASH, DLR, GRV, LCBR, RCBR, PLUS, MINS, SLSH, ASTR, PERC, QUOT, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, PERC, CIRC, TILD, LPRN, RPRN, TRNS, TRNS, TRNS, TRNS, AMPR, EQL, COMM, DOT, SLSH, MINS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS // `----------------------------------' `----------------------------------' ), + [_RAISE] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, TRNS, MPRV, MPLY, MNXT, VOLU, LEFT, DOWN, UP, RGHT, TRNS, TRNS, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, TRNS, TRNS, TRNS, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' + ), + [_ADJUST] = LAYOUT_kc( + // ,-------------------------------------------. ,-------------------------------------------. + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, + // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + TRNS, RTOG, RSAI, RHUI, RVAI, RMOD, TRNS, TRNS, TRNS, F11, F12, TRNS, + // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + TRNS, TRNS, RSAD, RHUD, RVAD, RRMD, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + // `----------------------------------' `----------------------------------' + ), // * Layer template // // [_LAYERINDEX] = LAYOUT_kc( @@ -204,6 +215,18 @@ layer_state_t layer_state_set_user(layer_state_t state) { send_layer_via_hid("Default"); rgblight_sethsv_noeeprom(HSV_BLUE); break; + case _SYMBOLS: + rgblight_sethsv_noeeprom(HSV_GREEN); + break; + case _NUM: + rgblight_sethsv_noeeprom(HSV_CORAL); + break; + case _NAV: + rgblight_sethsv_noeeprom(HSV_GOLDENROD); + break; + case _FN: + rgblight_sethsv_noeeprom(HSV_PINK); + break; case _LOWER: send_layer_via_hid("Lower"); rgblight_sethsv_noeeprom(HSV_MAGENTA); @@ -277,6 +300,21 @@ static void render_status(void) { case _QWERTY: oled_write_P(PSTR("Default\n"), false); break; + case _SYMBOLS: + oled_write_P(PSTR("Sym / Mouse\n"), false); + break; + case _NUM: + oled_write_P(PSTR("Numbers\n"), false); + break; + case _NAV: + oled_write_P(PSTR("Navigation\n"), false); + break; + case _FN: + oled_write_P(PSTR("Media / Fn\n"), false); + break; + case _GAME: + oled_write_P(PSTR("Game\n"), false); + break; case _LOWER: oled_write_P(PSTR("Lower / Sym\n"), false); break; @@ -286,9 +324,6 @@ static void render_status(void) { case _ADJUST: oled_write_P(PSTR("Adjust\n"), false); break; - case _GAME: - oled_write_P(PSTR("Game\n"), false); - break; default: oled_write_P(PSTR("Undefined\n"), false); } From 641cbd2c2216fa1abf44c1dc2e3a0622e1b93288 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 22 Sep 2020 00:42:06 -0500 Subject: [PATCH 13/46] Fine tuning home row mods --- keyboards/kyria/keymaps/cwebster2/config.h | 6 +- keyboards/kyria/keymaps/cwebster2/keymap.c | 158 +++++++++++---------- keyboards/kyria/keymaps/cwebster2/rules.mk | 2 + 3 files changed, 88 insertions(+), 78 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index c66f587f5daa..76e2f56e3006 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -1,4 +1,4 @@ -/* Copyright 2019 Thomas Baart +/* Copyright 2020 Casey Webster * * 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 @@ -42,14 +42,14 @@ #define TAPPING_TOGGLE 1 #define TAPPING_TERM 175 //#define TAPPING_FORCE_HOLD -#define PERMISSIVE_HOLD +#undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT #define AUTO_SHIFT_TIMEOUT 200 #define NO_AUTO_SHIFT_SPECIAL #define NO_AUTO_SHIFT_ALPHA -#define QMK_KEYS_PER_SCAN 4 +#define QMK_KEYS_PER_SCAN 1 #define EE_HANDS diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 1de69cdf1cee..771496400abf 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -20,6 +20,10 @@ char wpm_str[10]; uint16_t wpm_graph_timer = 0; +enum custom_keycodes { + KC_RACL = SAFE_RANGE +}; + enum layers { _QWERTY = 0, _FN, @@ -63,73 +67,74 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Base Layer: QWERTY */ [_QWERTY] = LAYOUT_kc( - // ,-----------------------------------------------------------. ,-------------------------------------------. - GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, - // |--------+----------+----------+----------+----------+------| |------+------+------+------+------+--------| - TAB, TT(LGUI,A),TT(LALT,S),TT(LCTL,D),TT(LSFT,F), G, H,TT(RSFT,J),TT(RCTL,K),TT(RALT,L),TT(RGUI,SCLN), QUOT, - // |--------+----------+----------+----------+----------+------+------+------. ,------+------+------+------+------+------+------+--------| - EQL, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, - // `------------------------------+----------+----------+------+------+------| |------+------+------+------+------+----------------------' - I3(LBRC),KITTY(MINS),SYM(TAB),NAV(SPC),FN(ESC), FN(BSPC),NUM(ENT),SYM(DEL),TO(_GAME),PSCR - // `----------------------------------------' `----------------------------------' + /* ,-------------------------------------------------------------------. ,--------------------------------------------------------------------. */ + GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, + /* |--------+-----------+-----------+-----------+-----------+----------| |---------+-----------+-----------+-----------+-------------+--------| */ + TAB, TT(LGUI,A), TT(LALT,S), TT(LCTL,D), TT(LSFT,F), G, H, TT(RSFT,J), TT(RCTL,K), TT(RALT,L), TT(RGUI,SCLN), QUOT, + /* |--------+-----------+-----------+-----------+-----------+----------+---------+--------. ,---------+---------+---------+-----------+-----------+-----------+-------------+--------| */ + EQL, Z, X, C, V, B, COLON, LGUI, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + /* `--------------------------------+-----------+-----------+----------+---------+--------| |---------+---------+---------+---------+-------------+----------------------------------' */ + I3(LBRC), KITTY(MINS), SYM(TAB), NAV(SPC), FN(ESC), FN(BSPC), NUM(ENT), SYM(DEL), TO(_GAME), PSCR + /* `-----------------------------------------------------' `-----------------------------------------------------' */ ), // symbols and mouse [_SYMBOLS] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, EXLM, AT, PIPE, LBRC, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, HASH, DLR, GRV, LCBR, RCBR, PLUS, MINS, SLSH, ASTR, PERC, QUOT, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, PERC, CIRC, TILD, LPRN, RPRN, TRNS, TRNS, TRNS, TRNS, AMPR, EQL, COMM, DOT, SLSH, MINS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' + /* ,-------------------------------------------. ,-------------------------------------------. */ + TRNS, RCBR, AMPR, ASTR, LPRN, LCBR, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ + TRNS, COLN, DLR, PERC, CIRC, PLUS, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ + TRNS, TILD, EXLM, AT, HASH, PIPE, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ + TRNS, TRNS, LPRN, RPRN, UNDS, TRNS, TRNS, TRNS, TRNS, TRNS + /* `----------------------------------' `----------------------------------' */ ), [_NUM] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, LBRC, 7, 8, 9, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, SCLN, 4, 5, 6, EQL, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, GRV, 1, 2, 3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + /* ,-------------------------------------------. ,-------------------------------------------. */ + TRNS, RBRC, 7, 8, 9, LBRC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ + TRNS, SCLN, 4, 5, 6, EQL, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ + TRNS, GRV, 1, 2, 3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ TRNS, TRNS, DOT, 0, MINS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' - ), - [_NAV] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, UP, RGHT, TRNS, TRNS, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' + /* `----------------------------------' `----------------------------------' */ ), // media and fn [_FN] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, RTOG, RSAI, RHUI, RVAI, RMOD, TRNS, TRNS, TRNS, F11, F12, TRNS, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, TRNS, RSAD, RHUD, RVAD, RRMD, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' + /* ,-------------------------------------------. ,-------------------------------------------. */ + TRNS, F12, F7, F8, F9, SYSREQ, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ + TRNS, F11, F4, F5, F6, SLCK, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ + TRNS, F10, F1, F2, F3, PAUSE, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' + /* `----------------------------------' `----------------------------------' */ + ), + [_NAV] = LAYOUT_kc( + /* ,-------------------------------------------. ,-------------------------------------------. */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, AGIN, UNDO, CUT, COPY, PSTE, TRNS, + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ + TRNS, LGUI, LALT, LCTL, LSFT, TRNS, LEFT, DOWN, UP, RGHT, CAPS, TRNS, + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ + TRNS, TRNS, RALT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END, INS, TRNS, + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + /* `----------------------------------' `----------------------------------' */ ), // GAME layout -- qwerty without homerow mods [_GAME] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. + /* ,-------------------------------------------. ,-------------------------------------------. */ GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - I3(LBRC),KITTY(MINS), RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, TO(_QWERTY), PSCR - // `----------------------------------' `----------------------------------' + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ + // I3(LBRC), KITTY(MINS), SYM(TAB), NAV(SPC), FN(ESC), FN(BSPC), NUM(ENT), SYM(DEL), TO(_QWERTY), PSCR + I3(LBRC),KITTY(MINS), RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, TO(_QWERTY), PSCR + /* `----------------------------------' `----------------------------------' */ ), [_LOWER] = LAYOUT_kc( // ,-------------------------------------------. ,-------------------------------------------. @@ -273,11 +278,22 @@ static void render_logo(void) { }; oled_write_raw_P(logo, sizeof(logo)); + oled_advance_page(false); + oled_advance_page(false); + oled_advance_page(false); + oled_advance_page(false); /*oled_write_P(PSTR("Combos enabled: ", flase));*/ /*if (is_combo_enabled()) {*/ /* oled_write_P(PSTR("Yes\n"), false);*/ /*} else {*/ /* oled_write_P(PSTR("No\n"), false);*/ + +#ifdef WPM_ENABLE + // Write WPM + sprintf(wpm_str, "WPM: %03d", get_current_wpm()); + //oled_write_P(PSTR("\n"), false); + oled_write(wpm_str, false); +#endif } static void render_qmk_logo(void) { @@ -328,12 +344,6 @@ static void render_status(void) { oled_write_P(PSTR("Undefined\n"), false); } -#ifdef WPM_ENABLE - // Write WPM - sprintf(wpm_str, "WPM: %03d", get_current_wpm()); - //oled_write_P(PSTR("\n"), false); - oled_write(wpm_str, false); -#endif // Host Keyboard LED Status uint8_t led_usb_state = host_keyboard_leds(); @@ -360,23 +370,21 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { } #endif -#ifdef ENCODER_ENABLE -void encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - // Volume control - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - else if (index == 1) { - // Page up/Page down - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t my_colon_timer; + + switch (keycode) { + case KC_RACL: + if (record->event.pressed) { + my_colon_timer = timer_read(); + register_code(KC_RALT); + } else { + unregister_code(KC_RALT); + if (timer_elapsed(my_colon_timer) < TAPPING_TERM) { + SEND_STRING(":"); + } + } + return false; } + return true; } -#endif diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index bec7499ac43e..366e29a2fb25 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -9,4 +9,6 @@ RAW_ENABLE = yes Link_Time_Optimization = yes EXTRAFLAGS = -flto WPM_ENABLE = yes +GRAVE_ESC_ENABLE = no +CONSOLE_ENABLE = no From ca3f223e369e68022a5d34dda33cf2e287395177 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 22 Sep 2020 22:37:21 -0500 Subject: [PATCH 14/46] update keymap --- keyboards/kyria/keymaps/cwebster2/config.h | 10 +- keyboards/kyria/keymaps/cwebster2/keymap.c | 158 +++++++++++---------- keyboards/kyria/keymaps/cwebster2/rules.mk | 3 +- 3 files changed, 92 insertions(+), 79 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 76e2f56e3006..41cd2d5ffbda 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -45,9 +45,13 @@ #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT -#define AUTO_SHIFT_TIMEOUT 200 -#define NO_AUTO_SHIFT_SPECIAL -#define NO_AUTO_SHIFT_ALPHA +#define COMBO_COUNT 2 + +#ifdef AUTO_SHIFT_ENABLE + #define AUTO_SHIFT_TIMEOUT 200 + #define NO_AUTO_SHIFT_SPECIAL + #define NO_AUTO_SHIFT_ALPHA +#endif #define QMK_KEYS_PER_SCAN 1 diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 771496400abf..3a9e7e62a167 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -20,20 +20,34 @@ char wpm_str[10]; uint16_t wpm_graph_timer = 0; +#ifdef COMBO_ENABLE +enum combos { + ZX_COPY, + CV_PASTE +}; + +const uint16_t PROGMEM copy_combo[] = { KC_Z, KC_X, COMBO_END }; +const uint16_t PROGMEM paste_combo[] = { KC_C, KC_V, COMBO_END }; + +combo_t key_combos[COMBO_COUNT] = { + [ZX_COPY] = COMBO(copy_combo, LCTL_T(KC_C)), + [CV_PASTE] = COMBO(paste_combo, LCTL_T(KC_V)) +}; +#endif + enum custom_keycodes { - KC_RACL = SAFE_RANGE + KC_LCCL = SAFE_RANGE }; enum layers { _QWERTY = 0, + _GAME, _FN, _SYMBOLS, _NUM, _NAV, - _GAME, - _LOWER, - _RAISE, - _ADJUST + _MOUSE, + _MEDIA }; // shortcuts for certain keys to use LAYOUT_kc() @@ -41,7 +55,7 @@ enum layers { #define KC_DF(a) DF(a) #define KC_RAISE TT(_RAISE) #define KC_LOWER TT(_LOWER) -#define KC_KITTY(a) LCTL_T(KC_##a) +#define KC_KITTY(a) C_S_T(KC_##a) #define KC_I3(a) SCMD_T(KC_##a) #define KC_GUIBS MT(MOD_LGUI, KC_BSPC) #define KC_ALTCLN MT(MOD_LALT, S(KC_SCLN)) // this doesnt work. need to write a custom keycode to handle it @@ -56,10 +70,13 @@ enum layers { #define KC_RRMD RGB_RMOD #define KC_TT(m,a) m##_T(KC_##a) #define KC_CTLESC MT(MOD_LCTL, KC_ESC) +#define KC_CTLTAB MT(MOD_LCTL, KC_TAB) #define KC_FN(a) LT(_FN, KC_##a) #define KC_SYM(a) LT(_SYMBOLS, KC_##a) #define KC_NUM(a) LT(_NUM, KC_##a) #define KC_NAV(a) LT(_NAV, KC_##a) +#define KC_MED(a) LT(_MEDIA, KC_##a) +#define KC_MSE(a) LT(_MOUSE, KC_##a) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -70,11 +87,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,-------------------------------------------------------------------. ,--------------------------------------------------------------------. */ GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, /* |--------+-----------+-----------+-----------+-----------+----------| |---------+-----------+-----------+-----------+-------------+--------| */ - TAB, TT(LGUI,A), TT(LALT,S), TT(LCTL,D), TT(LSFT,F), G, H, TT(RSFT,J), TT(RCTL,K), TT(RALT,L), TT(RGUI,SCLN), QUOT, + CTLTAB, TT(LGUI,A), TT(LALT,S), TT(LCTL,D), TT(LSFT,F), G, H, TT(RSFT,J), TT(RCTL,K), TT(RALT,L), TT(RGUI,SCLN), QUOT, /* |--------+-----------+-----------+-----------+-----------+----------+---------+--------. ,---------+---------+---------+-----------+-----------+-----------+-------------+--------| */ - EQL, Z, X, C, V, B, COLON, LGUI, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + EQL, Z, X, C, V, B, LCCL, LGUI, RALT, LSFT, N, M, COMM, DOT, SLSH, MINS, /* `--------------------------------+-----------+-----------+----------+---------+--------| |---------+---------+---------+---------+-------------+----------------------------------' */ - I3(LBRC), KITTY(MINS), SYM(TAB), NAV(SPC), FN(ESC), FN(BSPC), NUM(ENT), SYM(DEL), TO(_GAME), PSCR + I3(LBRC), KITTY(MINS), MSE(TAB), NAV(SPC), MED(ESC), FN(ENT), NUM(BSPC), SYM(DEL), TO(_GAME), PSCR /* `-----------------------------------------------------' `-----------------------------------------------------' */ ), // symbols and mouse @@ -123,6 +140,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS /* `----------------------------------' `----------------------------------' */ ), + [_MOUSE] = LAYOUT_kc( + /* ,-------------------------------------------. ,-------------------------------------------. */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + /* `----------------------------------' `----------------------------------' */ + ), + [_MEDIA] = LAYOUT_kc( + /* ,-------------------------------------------. ,-------------------------------------------. */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + /* `----------------------------------' `----------------------------------' */ + ), // GAME layout -- qwerty without homerow mods [_GAME] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ @@ -130,45 +169,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - LSPO, Z, X, C, V, B, LSPO, ALTCLN, RALT, RSPC, N, M, COMM, DOT, SLSH, MINS, + LSPO, Z, X, C, V, B, LCTL, LGUI, RALT, RSFT, N, M, COMM, DOT, SLSH, RSPC, /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - // I3(LBRC), KITTY(MINS), SYM(TAB), NAV(SPC), FN(ESC), FN(BSPC), NUM(ENT), SYM(DEL), TO(_QWERTY), PSCR - I3(LBRC),KITTY(MINS), RAISE, SPC, CTLESC, GUIBS, ENT, LOWER, TO(_QWERTY), PSCR + I3(LBRC), KITTY(MINS), MSE(TAB), NAV(SPC), MED(ESC), FN(ENT), NUM(BSPC), SYM(DEL), TO(_QWERTY), PSCR /* `----------------------------------' `----------------------------------' */ ), - [_LOWER] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, EXLM, AT, PIPE, LBRC, RBRC, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, HASH, DLR, GRV, LCBR, RCBR, PLUS, MINS, SLSH, ASTR, PERC, QUOT, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, PERC, CIRC, TILD, LPRN, RPRN, TRNS, TRNS, TRNS, TRNS, AMPR, EQL, COMM, DOT, SLSH, MINS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' - ), - [_RAISE] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, TRNS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, TRNS, MPRV, MPLY, MNXT, VOLU, LEFT, DOWN, UP, RGHT, TRNS, TRNS, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, TRNS, TRNS, TRNS, MUTE, VOLD, TRNS, TRNS, TRNS, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' - ), - [_ADJUST] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, TRNS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - TRNS, RTOG, RSAI, RHUI, RVAI, RMOD, TRNS, TRNS, TRNS, F11, F12, TRNS, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - TRNS, TRNS, RSAD, RHUD, RVAD, RRMD, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' - ), // * Layer template // // [_LAYERINDEX] = LAYOUT_kc( @@ -213,9 +218,7 @@ void keyboard_post_init_user(void) { layer_state_t layer_state_set_user(layer_state_t state) { - layer_state_t new_state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); - - switch (get_highest_layer(new_state)) { + switch (get_highest_layer(state)) { case _QWERTY: send_layer_via_hid("Default"); rgblight_sethsv_noeeprom(HSV_BLUE); @@ -232,26 +235,21 @@ layer_state_t layer_state_set_user(layer_state_t state) { case _FN: rgblight_sethsv_noeeprom(HSV_PINK); break; - case _LOWER: - send_layer_via_hid("Lower"); + case _MEDIA: rgblight_sethsv_noeeprom(HSV_MAGENTA); break; - case _RAISE: - send_layer_via_hid("Raise"); + case _MOUSE: + //send_layer_via_hid("Raise"); rgblight_sethsv_noeeprom(HSV_TURQUOISE); break; - case _ADJUST: - send_layer_via_hid("Adjust"); - rgblight_sethsv_noeeprom(HSV_PURPLE); - break; case _GAME: - send_layer_via_hid("Game"); + /*send_layer_via_hid("Game");*/ rgblight_sethsv_noeeprom(HSV_RED); break; default: send_layer_via_hid("Undefined"); } - return new_state; + return state; } #ifdef OLED_DRIVER_ENABLE @@ -282,11 +280,24 @@ static void render_logo(void) { oled_advance_page(false); oled_advance_page(false); oled_advance_page(false); - /*oled_write_P(PSTR("Combos enabled: ", flase));*/ - /*if (is_combo_enabled()) {*/ - /* oled_write_P(PSTR("Yes\n"), false);*/ - /*} else {*/ - /* oled_write_P(PSTR("No\n"), false);*/ + +#ifdef COMBO_ENABLE + oled_write_P(PSTR("Combos enabled: "), false); + if (is_combo_enabled()) { + oled_write_P(PSTR("Yes\n"), false); + } else { + oled_write_P(PSTR("No\n"), false); + } +#endif + + uint8_t mods = get_mods() | get_weak_mods(); + oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR("xxxx "), false); + oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR("xxxx "), false); + oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("xxx "), false); + oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR("xxx "), false); + oled_write_P(PSTR("\n"), false); + sprintf(wpm_str, "MOD: %03d\n", mods); + oled_write(wpm_str, false); #ifdef WPM_ENABLE // Write WPM @@ -317,7 +328,7 @@ static void render_status(void) { oled_write_P(PSTR("Default\n"), false); break; case _SYMBOLS: - oled_write_P(PSTR("Sym / Mouse\n"), false); + oled_write_P(PSTR("Shifted Sym\n"), false); break; case _NUM: oled_write_P(PSTR("Numbers\n"), false); @@ -326,19 +337,16 @@ static void render_status(void) { oled_write_P(PSTR("Navigation\n"), false); break; case _FN: - oled_write_P(PSTR("Media / Fn\n"), false); + oled_write_P(PSTR("Fn\n"), false); break; case _GAME: oled_write_P(PSTR("Game\n"), false); break; - case _LOWER: - oled_write_P(PSTR("Lower / Sym\n"), false); - break; - case _RAISE: - oled_write_P(PSTR("Raise / Num\n"), false); + case _MEDIA: + oled_write_P(PSTR("Media keys\n"), false); break; - case _ADJUST: - oled_write_P(PSTR("Adjust\n"), false); + case _MOUSE: + oled_write_P(PSTR("Mouse keys\n"), false); break; default: oled_write_P(PSTR("Undefined\n"), false); @@ -374,12 +382,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint16_t my_colon_timer; switch (keycode) { - case KC_RACL: + case KC_LCCL: if (record->event.pressed) { my_colon_timer = timer_read(); - register_code(KC_RALT); + register_code(KC_LCTL); } else { - unregister_code(KC_RALT); + unregister_code(KC_LCTL); if (timer_elapsed(my_colon_timer) < TAPPING_TERM) { SEND_STRING(":"); } diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 366e29a2fb25..c967833e96f8 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -1,6 +1,6 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUTO_SHIFT_ENABLE = yes # Enable autoshift +AUTO_SHIFT_ENABLE = no # Enable autoshift MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no @@ -11,4 +11,5 @@ EXTRAFLAGS = -flto WPM_ENABLE = yes GRAVE_ESC_ENABLE = no CONSOLE_ENABLE = no +COMBO_ENABLE = no From 809ff5b9e5a0c03ab3a1e6b58309bfd76006353d Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 22 Sep 2020 23:18:22 -0500 Subject: [PATCH 15/46] Keymap update --- keyboards/kyria/keymaps/cwebster2/keymap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 3a9e7e62a167..1dc3a8cd1d8a 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -291,13 +291,11 @@ static void render_logo(void) { #endif uint8_t mods = get_mods() | get_weak_mods(); + oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR("xxx "), false); + oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("xxx "), false); oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR("xxxx "), false); oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR("xxxx "), false); - oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("xxx "), false); - oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR("xxx "), false); oled_write_P(PSTR("\n"), false); - sprintf(wpm_str, "MOD: %03d\n", mods); - oled_write(wpm_str, false); #ifdef WPM_ENABLE // Write WPM @@ -352,6 +350,12 @@ static void render_status(void) { oled_write_P(PSTR("Undefined\n"), false); } + uint8_t mods = get_mods() | get_weak_mods(); + oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR("xxx "), false); + oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("xxx "), false); + oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR("xxxx "), false); + oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR("xxxx "), false); + oled_write_P(PSTR("\n"), false); // Host Keyboard LED Status uint8_t led_usb_state = host_keyboard_leds(); From 6b043632e238007d31096c4bfdf13bbf9a32b518 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 22 Sep 2020 23:43:48 -0500 Subject: [PATCH 16/46] add split transport --- quantum/split_common/transport.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 467ff81a97cf..7414479884c0 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -28,7 +28,9 @@ static pin_t encoders_pad[] = ENCODERS_PAD_A; typedef struct _I2C_slave_buffer_t { matrix_row_t smatrix[ROWS_PER_HAND]; +# if defined(BACKLIGHT_ENABLE) uint8_t backlight_level; +# endif # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) rgblight_syncinfo_t rgblight_sync; # endif @@ -38,6 +40,7 @@ typedef struct _I2C_slave_buffer_t { # ifdef WPM_ENABLE uint8_t current_wpm; # endif + uint8_t modifiers; } I2C_slave_buffer_t; static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; @@ -47,6 +50,7 @@ static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_re # define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) # define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) # define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm) +# define I2C_MODS_START offsetof(I2C_slave_buffer_t, modifiers) # define TIMEOUT 100 @@ -91,6 +95,11 @@ bool transport_master(matrix_row_t matrix[]) { } } # endif + uint8_t modifiers = get_mods() | get_weak_mods(); + if (modifiers != i2c_buffer->modifiers) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)¤t_wpm, sizeof(modifiers), TIMEOUT) >= 0) { + i2c_buffer->modifiers = modifiers; + } return true; } @@ -118,6 +127,8 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(i2c_buffer->current_wpm); # endif + + set_mods(i2c_buffer->modifiers); } void transport_master_init(void) { i2c_init(); } @@ -145,6 +156,7 @@ typedef struct _Serial_m2s_buffer_t { # ifdef WPM_ENABLE uint8_t current_wpm; # endif + uint8_t modifiers; } Serial_m2s_buffer_t; # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) @@ -251,6 +263,7 @@ bool transport_master(matrix_row_t matrix[]) { // Write wpm to slave serial_m2s_buffer.current_wpm = get_current_wpm(); # endif + serial_m2s_buffer.modifiers = get_mods() | get_weak_mods(); return true; } @@ -271,6 +284,7 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(serial_m2s_buffer.current_wpm); # endif + set_mods(serial_m2s_buffer.modifiers); } #endif From 57bf1219d987f1862cea87821277562e47773812 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 22 Sep 2020 23:59:08 -0500 Subject: [PATCH 17/46] keymap --- keyboards/kyria/keymaps/cwebster2/keymap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 1dc3a8cd1d8a..0c28c76d4cd0 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -291,10 +291,10 @@ static void render_logo(void) { #endif uint8_t mods = get_mods() | get_weak_mods(); - oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR("xxx "), false); - oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("xxx "), false); - oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR("xxxx "), false); - oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR("xxxx "), false); + oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" "), false); + oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" "), false); + oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false); + oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false); oled_write_P(PSTR("\n"), false); #ifdef WPM_ENABLE @@ -351,10 +351,10 @@ static void render_status(void) { } uint8_t mods = get_mods() | get_weak_mods(); - oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR("xxx "), false); - oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR("xxx "), false); - oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR("xxxx "), false); - oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR("xxxx "), false); + oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" "), false); + oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" "), false); + oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false); + oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false); oled_write_P(PSTR("\n"), false); // Host Keyboard LED Status From e3a642cb044a49259a4019c998784f8c132bd053 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Wed, 23 Sep 2020 08:51:21 -0500 Subject: [PATCH 18/46] cherry pick from develop --- quantum/split_common/transport.c | 56 +++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 7414479884c0..d9fb6084e461 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -28,7 +28,12 @@ static pin_t encoders_pad[] = ENCODERS_PAD_A; typedef struct _I2C_slave_buffer_t { matrix_row_t smatrix[ROWS_PER_HAND]; -# if defined(BACKLIGHT_ENABLE) + uint8_t real_mods; + uint8_t weak_mods; +#ifndef NO_ACTION_ONESHOT + uint8_t oneshot_mods; +#endif +# ifdef(BACKLIGHT_ENABLE) uint8_t backlight_level; # endif # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) @@ -40,7 +45,6 @@ typedef struct _I2C_slave_buffer_t { # ifdef WPM_ENABLE uint8_t current_wpm; # endif - uint8_t modifiers; } I2C_slave_buffer_t; static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; @@ -48,9 +52,11 @@ static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_re # define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level) # define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync) # define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) +# define I2C_MODS_START offsetof(I2C_slave_buffer_t, real_mods) +# define I2C_MODS_START offsetof(I2C_slave_buffer_t, weak_mods) +# define I2C_MODS_START offsetof(I2C_slave_buffer_t, oneshot_mods) # define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) # define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm) -# define I2C_MODS_START offsetof(I2C_slave_buffer_t, modifiers) # define TIMEOUT 100 @@ -95,10 +101,22 @@ bool transport_master(matrix_row_t matrix[]) { } } # endif - uint8_t modifiers = get_mods() | get_weak_mods(); - if (modifiers != i2c_buffer->modifiers) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)¤t_wpm, sizeof(modifiers), TIMEOUT) >= 0) { - i2c_buffer->modifiers = modifiers; + uint8_t real_mods = get_mods(); + if (real_mods != i2c_buffer->real_mods) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)&real_mods, sizeof(real_mods), TIMEOUT) >= 0) { + i2c_buffer->real_mods = real_mods; + } + + uint8_t weak_mods = get_weak_mods(); + if (weak_mods != i2c_buffer->weak_mods) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)&weak_mods, sizeof(weak_mods), TIMEOUT) >= 0) { + i2c_buffer->weak_mods = weak_mods; + } + + uint8_t oneshot_mods = get_mods(); + if (oneshot_mods != i2c_buffer->oneshot_mods) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)&oneshot_mods, sizeof(oneshot_mods), TIMEOUT) >= 0) { + i2c_buffer->oneshot_mods = oneshot_mods; } return true; } @@ -128,7 +146,11 @@ void transport_slave(matrix_row_t matrix[]) { set_current_wpm(i2c_buffer->current_wpm); # endif - set_mods(i2c_buffer->modifiers); + set_mods(i2c_buffer->real_mods); + set_weak_mods(i2c_buffer->real_weak_mods); +#ifndef NO_ACTION_ONESHOT + set_oneshot_mods(i2c_buffer->oneshot_mods); +#endif } void transport_master_init(void) { i2c_init(); } @@ -150,13 +172,17 @@ typedef struct _Serial_s2m_buffer_t { } Serial_s2m_buffer_t; typedef struct _Serial_m2s_buffer_t { + uint8_t real_mods; + uint8_t weak_mods; +#ifndef NO_ACTION_ONESHOT + uint8_t oneshot_mods; +#endif # ifdef BACKLIGHT_ENABLE uint8_t backlight_level; # endif # ifdef WPM_ENABLE uint8_t current_wpm; # endif - uint8_t modifiers; } Serial_m2s_buffer_t; # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) @@ -263,7 +289,11 @@ bool transport_master(matrix_row_t matrix[]) { // Write wpm to slave serial_m2s_buffer.current_wpm = get_current_wpm(); # endif - serial_m2s_buffer.modifiers = get_mods() | get_weak_mods(); + serial_m2s_buffer.real_mods = get_mods(); + serial_m2s_buffer.weak_mods = get_weak_mods(); +#ifndef NO_ACTION_ONESHOT + serial_m2s_buffer.oneshot_mods = get_oneshot_mods(); +#endif return true; } @@ -284,7 +314,11 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(serial_m2s_buffer.current_wpm); # endif - set_mods(serial_m2s_buffer.modifiers); + set_mods(i2c_buffer->real_mods); + set_weak_mods(i2c_buffer->real_weak_mods); +#ifndef NO_ACTION_ONESHOT + set_oneshot_mods(i2c_buffer->oneshot_mods); +#endif } #endif From bafff0aae29058881e122460b5e097d055edb79a Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Wed, 23 Sep 2020 08:55:51 -0500 Subject: [PATCH 19/46] merge develop --- quantum/split_common/transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index d9fb6084e461..b9e5be56bd68 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -314,10 +314,10 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(serial_m2s_buffer.current_wpm); # endif - set_mods(i2c_buffer->real_mods); - set_weak_mods(i2c_buffer->real_weak_mods); + set_mods(serial_m2s_buffer.real_mods); + set_weak_mods(serial_m2s_buffer.real_weak_mods); #ifndef NO_ACTION_ONESHOT - set_oneshot_mods(i2c_buffer->oneshot_mods); + set_oneshot_mods(serial_m2s_buffer.oneshot_mods); #endif } From 10bbbda20e2abcfcd9590272d944b1f323d7cb68 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Wed, 23 Sep 2020 08:58:25 -0500 Subject: [PATCH 20/46] fix --- quantum/split_common/transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index b9e5be56bd68..c4014d4708d0 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -147,7 +147,7 @@ void transport_slave(matrix_row_t matrix[]) { # endif set_mods(i2c_buffer->real_mods); - set_weak_mods(i2c_buffer->real_weak_mods); + set_weak_mods(i2c_buffer->weak_mods); #ifndef NO_ACTION_ONESHOT set_oneshot_mods(i2c_buffer->oneshot_mods); #endif @@ -315,7 +315,7 @@ void transport_slave(matrix_row_t matrix[]) { set_current_wpm(serial_m2s_buffer.current_wpm); # endif set_mods(serial_m2s_buffer.real_mods); - set_weak_mods(serial_m2s_buffer.real_weak_mods); + set_weak_mods(serial_m2s_buffer.weak_mods); #ifndef NO_ACTION_ONESHOT set_oneshot_mods(serial_m2s_buffer.oneshot_mods); #endif From 2ef663b296324df17e5ac9c82978f918e9f276b4 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 25 Sep 2020 17:20:29 -0500 Subject: [PATCH 21/46] keymap iterations --- keyboards/kyria/keymaps/cwebster2/config.h | 7 +- keyboards/kyria/keymaps/cwebster2/keymap.c | 133 +++++++++++++-------- keyboards/kyria/keymaps/cwebster2/rules.mk | 3 +- 3 files changed, 90 insertions(+), 53 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 41cd2d5ffbda..b909ecf18056 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -40,7 +40,7 @@ #endif #define TAPPING_TOGGLE 1 -#define TAPPING_TERM 175 +#define TAPPING_TERM 200 //#define TAPPING_FORCE_HOLD #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT @@ -76,6 +76,9 @@ # undef LOCKING_RESYNC_ENABLE #endif + + + #define LAYOUT_kc( \ L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ @@ -88,6 +91,8 @@ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R27, KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, \ KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ ) +#define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__) + #define LAYOUT_left_kc( \ L00, L01, L02, L03, L04, L05, \ diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 0c28c76d4cd0..0f5f6401692e 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2019 Thomas Baart +/* Copyright 2020 Casey Webster * * 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 @@ -15,6 +15,7 @@ */ #include QMK_KEYBOARD_H #include "raw_hid.h" +#define RAW_EPSIZE 8 #include char wpm_str[10]; @@ -41,6 +42,7 @@ enum custom_keycodes { enum layers { _QWERTY = 0, + _COLEMAK, _GAME, _FN, _SYMBOLS, @@ -53,51 +55,82 @@ enum layers { // shortcuts for certain keys to use LAYOUT_kc() #define KC_TO(a) TO(a) #define KC_DF(a) DF(a) -#define KC_RAISE TT(_RAISE) -#define KC_LOWER TT(_LOWER) #define KC_KITTY(a) C_S_T(KC_##a) #define KC_I3(a) SCMD_T(KC_##a) -#define KC_GUIBS MT(MOD_LGUI, KC_BSPC) -#define KC_ALTCLN MT(MOD_LALT, S(KC_SCLN)) // this doesnt work. need to write a custom keycode to handle it -#define KC_RTOG RGB_TOG -#define KC_RSAI RGB_SAI -#define KC_RHUI RGB_HUI -#define KC_RVAI RGB_VAI -#define KC_RMOD RGB_MOD -#define KC_RSAD RGB_SAD -#define KC_RHUD RGB_HUD -#define KC_RVAD RGB_VAD -#define KC_RRMD RGB_RMOD +#define KC_TOG RGB_TOG +#define KC_SAI RGB_SAI +#define KC_HUI RGB_HUI +#define KC_VAI RGB_VAI +#define KC_MOD RGB_MOD +#define KC_RST RESET +#define KC_CTLBS CTL_T(KC_BSPC) #define KC_TT(m,a) m##_T(KC_##a) -#define KC_CTLESC MT(MOD_LCTL, KC_ESC) -#define KC_CTLTAB MT(MOD_LCTL, KC_TAB) #define KC_FN(a) LT(_FN, KC_##a) #define KC_SYM(a) LT(_SYMBOLS, KC_##a) #define KC_NUM(a) LT(_NUM, KC_##a) #define KC_NAV(a) LT(_NAV, KC_##a) #define KC_MED(a) LT(_MEDIA, KC_##a) #define KC_MSE(a) LT(_MOUSE, KC_##a) - +#define KC_ALTCL LALT_T(KC_CAPS) + +#define LAYOUT_kyria_base( \ + L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, \ + L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, \ + L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, \ + L33, L34, L35, R35, R34, R33 \ + ) \ + LAYOUT_kyria_wrapper ( \ + KC_GRV, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, KC_BSLS, \ + KC_CTLBS, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, KC_QUOT, \ + KC_EQL, L21, L22, L23, L24, L25, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, R25, R24, R23, R22, R21, KC_MINS, \ + SCMD_T(KC_LBRC), C_S_T(KC_MINS), L33, L34, L35, R35, R34, R33, TO(_GAME), KC_PSCR \ + ) +#define LAYOUT_kyria_base_wrapper(...) LAYOUT_kyria_base(__VA_ARGS__) + +#define _______QWERTY_L1______ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _______QWERTY_L2______ LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G +#define _______QWERTY_L3______ KC_Z, KC_X, KC_C, KC_V, KC_B +#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _______QWERTY_R2______ KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_SCLN) +#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH + +#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B +#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G +#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V +#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT +#define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O) +#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH + +#define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) +#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * Base Layer: QWERTY */ - [_QWERTY] = LAYOUT_kc( - /* ,-------------------------------------------------------------------. ,--------------------------------------------------------------------. */ - GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, - /* |--------+-----------+-----------+-----------+-----------+----------| |---------+-----------+-----------+-----------+-------------+--------| */ - CTLTAB, TT(LGUI,A), TT(LALT,S), TT(LCTL,D), TT(LSFT,F), G, H, TT(RSFT,J), TT(RCTL,K), TT(RALT,L), TT(RGUI,SCLN), QUOT, - /* |--------+-----------+-----------+-----------+-----------+----------+---------+--------. ,---------+---------+---------+-----------+-----------+-----------+-------------+--------| */ - EQL, Z, X, C, V, B, LCCL, LGUI, RALT, LSFT, N, M, COMM, DOT, SLSH, MINS, - /* `--------------------------------+-----------+-----------+----------+---------+--------| |---------+---------+---------+---------+-------------+----------------------------------' */ - I3(LBRC), KITTY(MINS), MSE(TAB), NAV(SPC), MED(ESC), FN(ENT), NUM(BSPC), SYM(DEL), TO(_GAME), PSCR - /* `-----------------------------------------------------' `-----------------------------------------------------' */ + [_QWERTY] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______QWERTY_L1______, _______QWERTY_R1______, + _______QWERTY_L2______, _______QWERTY_R2______, + _______QWERTY_L3______, _______QWERTY_R3______, + _______THUMBS_L_______, _______THUMBS_R_______ + /* `---------------------' `------------------------------' */ + ), +/* + * Base Layer: QWERTY + */ + [_COLEMAK] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______COLEMAK_L1_____, _______COLEMAK_R1_____, + _______COLEMAK_L2_____, _______COLEMAK_R2_____, + _______COLEMAK_L3_____, _______COLEMAK_R3_____, + _______THUMBS_L_______, _______THUMBS_R_______ + /* `---------------------' `------------------------------' */ ), // symbols and mouse [_SYMBOLS] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ - TRNS, RCBR, AMPR, ASTR, LPRN, LCBR, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + RST, RCBR, AMPR, ASTR, LPRN, LCBR, TRNS, TRNS, TRNS, TRNS, TRNS, RST, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ TRNS, COLN, DLR, PERC, CIRC, PLUS, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ @@ -108,11 +141,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_NUM] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ - TRNS, RBRC, 7, 8, 9, LBRC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + RST, RBRC, 7, 8, 9, LBRC, TRNS, TRNS, TRNS, TRNS, TRNS, RST, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ TRNS, SCLN, 4, 5, 6, EQL, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, GRV, 1, 2, 3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, + TRNS, GRV, 1, 2, 3, SLSH, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ TRNS, TRNS, DOT, 0, MINS, TRNS, TRNS, TRNS, TRNS, TRNS /* `----------------------------------' `----------------------------------' */ @@ -120,18 +153,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // media and fn [_FN] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ - TRNS, F12, F7, F8, F9, SYSREQ, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + RST, F12, F7, F8, F9, SYSREQ, TRNS, TRNS, TRNS, TRNS, TRNS, RST, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, F11, F4, F5, F6, SLCK, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, + TRNS, F11, F4, F5, F6, TRNS, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, F10, F1, F2, F3, PAUSE, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, + TRNS, F10, F1, F2, F3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + TRNS, TRNS, MENU, SLSH, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS /* `----------------------------------' `----------------------------------' */ ), [_NAV] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, AGIN, UNDO, CUT, COPY, PSTE, TRNS, + RST, TRNS, TRNS, TRNS, TRNS, TRNS, UNDO, CUT, COPY, PSTE, AGIN, RST, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ TRNS, LGUI, LALT, LCTL, LSFT, TRNS, LEFT, DOWN, UP, RGHT, CAPS, TRNS, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ @@ -142,24 +175,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_MOUSE] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + RST, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RST, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, WH_L, WH_D, WH_U, WH_R, TRNS, TRNS, /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + TRNS, TRNS, TRNS, TRNS, TRNS, BTN1, BTN3, BTN2, TRNS, TRNS /* `----------------------------------' `----------------------------------' */ ), [_MEDIA] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + RST, TRNS, TRNS, TRNS, TRNS, TRNS, TOG, MOD, HUI, SAI, VAI, RST, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPRV, VOLD, VOLU, MNXT, TRNS, TRNS, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS + TRNS, TRNS, TRNS, TRNS, TRNS, MSTP, MPLY, MUTE, TRNS, TRNS /* `----------------------------------' `----------------------------------' */ ), // GAME layout -- qwerty without homerow mods @@ -167,7 +200,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,-------------------------------------------. ,-------------------------------------------. */ GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, + CTLBS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ LSPO, Z, X, C, V, B, LCTL, LGUI, RALT, RSFT, N, M, COMM, DOT, SLSH, RSPC, /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ @@ -189,8 +222,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ), }; -static void send_layer_via_hid(char *layer) { - //raw_hid_send((uint8_t*)layer, sizeof(layer)); +static void send_layer_via_hid(int layer) { + uint8_t data[RAW_EPSIZE]; + data[0] = 1; + data[1] = layer; + raw_hid_send((uint8_t*)data, sizeof(data)); return; } @@ -216,11 +252,10 @@ void keyboard_post_init_user(void) { rgblight_sethsv_noeeprom(HSV_BLUE); } - layer_state_t layer_state_set_user(layer_state_t state) { + send_layer_via_hid(state); switch (get_highest_layer(state)) { case _QWERTY: - send_layer_via_hid("Default"); rgblight_sethsv_noeeprom(HSV_BLUE); break; case _SYMBOLS: @@ -239,15 +274,11 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_sethsv_noeeprom(HSV_MAGENTA); break; case _MOUSE: - //send_layer_via_hid("Raise"); rgblight_sethsv_noeeprom(HSV_TURQUOISE); break; case _GAME: - /*send_layer_via_hid("Game");*/ rgblight_sethsv_noeeprom(HSV_RED); break; - default: - send_layer_via_hid("Undefined"); } return state; } diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index c967833e96f8..0e4944baef14 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -12,4 +12,5 @@ WPM_ENABLE = yes GRAVE_ESC_ENABLE = no CONSOLE_ENABLE = no COMBO_ENABLE = no - +SPACE_CADET_ENABLE = no +GRAVE_ESC_ENABLE = no From 4528cacef851a2940fc566e0eb51c479e75b2e5a Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 25 Sep 2020 23:25:21 -0500 Subject: [PATCH 22/46] Refactoring --- keyboards/kyria/keymaps/cwebster2/keymap.c | 77 ++++++++-------------- users/cwebster2/cwebster2.h | 59 +++++++++++++++++ 2 files changed, 86 insertions(+), 50 deletions(-) create mode 100644 users/cwebster2/cwebster2.h diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 0f5f6401692e..a1a39ccdcaac 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -18,6 +18,8 @@ #define RAW_EPSIZE 8 #include +#include "cwebster2.h" + char wpm_str[10]; uint16_t wpm_graph_timer = 0; @@ -80,29 +82,13 @@ enum layers { L33, L34, L35, R35, R34, R33 \ ) \ LAYOUT_kyria_wrapper ( \ - KC_GRV, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, KC_BSLS, \ - KC_CTLBS, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, KC_QUOT, \ + KC_GRV, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, KC_BSLS, \ + KC_CTLBS, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, KC_QUOT, \ KC_EQL, L21, L22, L23, L24, L25, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, R25, R24, R23, R22, R21, KC_MINS, \ SCMD_T(KC_LBRC), C_S_T(KC_MINS), L33, L34, L35, R35, R34, R33, TO(_GAME), KC_PSCR \ ) #define LAYOUT_kyria_base_wrapper(...) LAYOUT_kyria_base(__VA_ARGS__) -#define _______QWERTY_L1______ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _______QWERTY_L2______ LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G -#define _______QWERTY_L3______ KC_Z, KC_X, KC_C, KC_V, KC_B -#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______QWERTY_R2______ KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_SCLN) -#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B -#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G -#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V -#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT -#define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O) -#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH - -#define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) -#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* @@ -114,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______QWERTY_L2______, _______QWERTY_R2______, _______QWERTY_L3______, _______QWERTY_R3______, _______THUMBS_L_______, _______THUMBS_R_______ - /* `---------------------' `------------------------------' */ + /* `---------------------' `---------------------' */ ), /* * Base Layer: QWERTY @@ -125,42 +111,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______COLEMAK_L2_____, _______COLEMAK_R2_____, _______COLEMAK_L3_____, _______COLEMAK_R3_____, _______THUMBS_L_______, _______THUMBS_R_______ - /* `---------------------' `------------------------------' */ + /* `---------------------' `---------------------' */ ), // symbols and mouse - [_SYMBOLS] = LAYOUT_kc( - /* ,-------------------------------------------. ,-------------------------------------------. */ - RST, RCBR, AMPR, ASTR, LPRN, LCBR, TRNS, TRNS, TRNS, TRNS, TRNS, RST, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, COLN, DLR, PERC, CIRC, PLUS, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, TILD, EXLM, AT, HASH, PIPE, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, LPRN, RPRN, UNDS, TRNS, TRNS, TRNS, TRNS, TRNS - /* `----------------------------------' `----------------------------------' */ + [_SYMBOLS] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______SYM______L1____, _______INACTIVE_R1____, + _______SYM______L2____, _______INACTIVE_R2____, + _______SYM______L3____, _______INACTIVE_R3____, + _______SYM_______T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ ), - [_NUM] = LAYOUT_kc( - /* ,-------------------------------------------. ,-------------------------------------------. */ - RST, RBRC, 7, 8, 9, LBRC, TRNS, TRNS, TRNS, TRNS, TRNS, RST, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, SCLN, 4, 5, 6, EQL, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, GRV, 1, 2, 3, SLSH, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, DOT, 0, MINS, TRNS, TRNS, TRNS, TRNS, TRNS - /* `----------------------------------' `----------------------------------' */ + [_NUM] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______NUM______L1____, _______INACTIVE_R1____, + _______NUM______L2____, _______INACTIVE_R2____, + _______NUM______L3____, _______INACTIVE_R3____, + _______NUM_______T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ ), // media and fn - [_FN] = LAYOUT_kc( - /* ,-------------------------------------------. ,-------------------------------------------. */ - RST, F12, F7, F8, F9, SYSREQ, TRNS, TRNS, TRNS, TRNS, TRNS, RST, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, F11, F4, F5, F6, TRNS, TRNS, LSFT, LCTL, LALT, LGUI, TRNS, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, F10, F1, F2, F3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RALT, TRNS, TRNS, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, MENU, SLSH, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - /* `----------------------------------' `----------------------------------' */ + [_FN] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______FN_______L1____, _______INACTIVE_R1____, + _______FN_______L2____, _______INACTIVE_R2____, + _______FN_______L3____, _______INACTIVE_R3____, + _______FN________T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ ), [_NAV] = LAYOUT_kc( /* ,-------------------------------------------. ,-------------------------------------------. */ diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h new file mode 100644 index 000000000000..8840a6649ba8 --- /dev/null +++ b/users/cwebster2/cwebster2.h @@ -0,0 +1,59 @@ +/* Copyright 2020 Casey Webster + * + * 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 . + */ + + +#define _______QWERTY_L1______ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _______QWERTY_L2______ LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G +#define _______QWERTY_L3______ KC_Z, KC_X, KC_C, KC_V, KC_B +#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _______QWERTY_R2______ KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_SCLN) +#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH + +#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B +#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G +#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V +#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT +#define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O) +#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH + +#define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) +#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) + +#define _______INACTIVE_R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET +#define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI +#define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS + +#define _______INACTIVE_L1____ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS +#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_TRNS + +#define _______INACTIVE__T____ KC_TRNS, KC_TRNS, KC_TRNS + + +#define _______SYM______L1____ KC_RCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_LCBR +#define _______SYM______L2____ KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS +#define _______SYM______L3____ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE +#define _______SYM_______T____ KC_LPRN, KC_RPRN, KC_UNDS + +#define _______NUM______L1____ KC_RBRC, KC_7, KC_8, KC_9, KC_LBRC +#define _______NUM______L2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL +#define _______NUM______L3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH +#define _______NUM_______T____ KC_DOT, KC_0, KC_MINS + +#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYSREQ +#define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS +#define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_BSLS +#define _______FN________T____ KC_MENU, KC_SLSH, KC_TRNS From c7780466e7b0b29db760247abfd3ec6bf16e6fef Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sat, 26 Sep 2020 22:27:14 -0500 Subject: [PATCH 23/46] continued refactoring --- keyboards/kyria/keymaps/cwebster2/keymap.c | 99 ++++++---------------- users/cwebster2/cwebster2.h | 14 +++ 2 files changed, 40 insertions(+), 73 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index a1a39ccdcaac..6d49b452a204 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -55,24 +55,7 @@ enum layers { }; // shortcuts for certain keys to use LAYOUT_kc() -#define KC_TO(a) TO(a) -#define KC_DF(a) DF(a) -#define KC_KITTY(a) C_S_T(KC_##a) -#define KC_I3(a) SCMD_T(KC_##a) -#define KC_TOG RGB_TOG -#define KC_SAI RGB_SAI -#define KC_HUI RGB_HUI -#define KC_VAI RGB_VAI -#define KC_MOD RGB_MOD -#define KC_RST RESET #define KC_CTLBS CTL_T(KC_BSPC) -#define KC_TT(m,a) m##_T(KC_##a) -#define KC_FN(a) LT(_FN, KC_##a) -#define KC_SYM(a) LT(_SYMBOLS, KC_##a) -#define KC_NUM(a) LT(_NUM, KC_##a) -#define KC_NAV(a) LT(_NAV, KC_##a) -#define KC_MED(a) LT(_MEDIA, KC_##a) -#define KC_MSE(a) LT(_MOUSE, KC_##a) #define KC_ALTCL LALT_T(KC_CAPS) #define LAYOUT_kyria_base( \ @@ -102,9 +85,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______THUMBS_L_______, _______THUMBS_R_______ /* `---------------------' `---------------------' */ ), -/* - * Base Layer: QWERTY - */ [_COLEMAK] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ _______COLEMAK_L1_____, _______COLEMAK_R1_____, @@ -113,7 +93,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______THUMBS_L_______, _______THUMBS_R_______ /* `---------------------' `---------------------' */ ), - // symbols and mouse [_SYMBOLS] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ _______SYM______L1____, _______INACTIVE_R1____, @@ -130,7 +109,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______NUM_______T____, _______INACTIVE__T____ /* `---------------------' `---------------------' */ ), - // media and fn [_FN] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ _______FN_______L1____, _______INACTIVE_R1____, @@ -139,64 +117,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______FN________T____, _______INACTIVE__T____ /* `---------------------' `---------------------' */ ), - [_NAV] = LAYOUT_kc( - /* ,-------------------------------------------. ,-------------------------------------------. */ - RST, TRNS, TRNS, TRNS, TRNS, TRNS, UNDO, CUT, COPY, PSTE, AGIN, RST, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, LGUI, LALT, LCTL, LSFT, TRNS, LEFT, DOWN, UP, RGHT, CAPS, TRNS, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, TRNS, RALT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END, INS, TRNS, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - /* `----------------------------------' `----------------------------------' */ + [_NAV] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______INACTIVE_R1____, _______NAV______R1____, + _______INACTIVE_R1____, _______NAV______R2____, + _______INACTIVE_R1____, _______NAV______R3____, + _______INACTIVE__T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ ), - [_MOUSE] = LAYOUT_kc( - /* ,-------------------------------------------. ,-------------------------------------------. */ - RST, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RST, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, WH_L, WH_D, WH_U, WH_R, TRNS, TRNS, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, TRNS, TRNS, TRNS, BTN1, BTN3, BTN2, TRNS, TRNS - /* `----------------------------------' `----------------------------------' */ + [_MOUSE] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______INACTIVE_R1____, _______MOUSE____R1____, + _______INACTIVE_R1____, _______MOUSE____R2____, + _______INACTIVE_R1____, _______MOUSE____R3____, + _______INACTIVE__T____, _______MOUSE_____T____ + /* `---------------------' `---------------------' */ ), - [_MEDIA] = LAYOUT_kc( - /* ,-------------------------------------------. ,-------------------------------------------. */ - RST, TRNS, TRNS, TRNS, TRNS, TRNS, TOG, MOD, HUI, SAI, VAI, RST, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPRV, VOLD, VOLU, MNXT, TRNS, TRNS, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - TRNS, TRNS, TRNS, TRNS, TRNS, MSTP, MPLY, MUTE, TRNS, TRNS - /* `----------------------------------' `----------------------------------' */ + [_MEDIA] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______INACTIVE_R1____, _______MEDIA____R1____, + _______INACTIVE_R1____, _______MEDIA____R2____, + _______INACTIVE_R1____, _______MEDIA____R3____, + _______INACTIVE__T____, _______MEDIA_____T____ + /* `---------------------' `---------------------' */ ), // GAME layout -- qwerty without homerow mods - [_GAME] = LAYOUT_kc( + [_GAME] = LAYOUT_kyria_wrapper( /* ,-------------------------------------------. ,-------------------------------------------. */ - GRV, Q, W, E, R, T, Y, U, I, O, P, BSLS, - /* |--------+------+------+------+------+------| |------+------+------+------+------+--------| */ - CTLBS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, - /* |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| */ - LSPO, Z, X, C, V, B, LCTL, LGUI, RALT, RSFT, N, M, COMM, DOT, SLSH, RSPC, - /* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' */ - I3(LBRC), KITTY(MINS), MSE(TAB), NAV(SPC), MED(ESC), FN(ENT), NUM(BSPC), SYM(DEL), TO(_QWERTY), PSCR + KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, + KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_EQL, _______QWERTY_L3______, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, + SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR /* `----------------------------------' `----------------------------------' */ ), - // * Layer template - // - // [_LAYERINDEX] = LAYOUT_kc( - // ,-------------------------------------------. ,-------------------------------------------. - // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // |--------+------+------+------+------+------| |------+------+------+------+------+--------| - // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // |--------+------+------+------+------+------+------+------. ,------+------+------+------+------+------+------+--------| - // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - // `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------' - // TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS - // `----------------------------------' `----------------------------------' - // ), }; static void send_layer_via_hid(int layer) { diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h index 8840a6649ba8..c295f1578001 100644 --- a/users/cwebster2/cwebster2.h +++ b/users/cwebster2/cwebster2.h @@ -57,3 +57,17 @@ #define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS #define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_BSLS #define _______FN________T____ KC_MENU, KC_SLSH, KC_TRNS + +#define _______NAV______R1____ KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_AGIN +#define _______NAV______R2____ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS +#define _______NAV______R3____ KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS + +#define _______MEDIA____R1____ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI +#define _______MEDIA____R2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL +#define _______MEDIA____R3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH +#define _______MEDIA_____T____ KC_MSTP, KC_MPLY, KC_MUTE + +#define _______MOUSE____R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define _______MOUSE____R2____ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS +#define _______MOUSE____R3____ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_TRNS +#define _______MOUSE_____T____ KC_BTN1, KC_BTN3, KC_BTN2 From bd8a6ce0c4f78ea7bc48a2e1377af3c2d36571cf Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 27 Sep 2020 00:33:54 -0500 Subject: [PATCH 24/46] messing with rgb --- keyboards/kyria/keymaps/cwebster2/keymap.c | 75 +++++++++++++++++----- 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 6d49b452a204..d8d962e6974f 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -93,6 +93,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______THUMBS_L_______, _______THUMBS_R_______ /* `---------------------' `---------------------' */ ), + // GAME layout -- qwerty without homerow mods + [_GAME] = LAYOUT_kyria_wrapper( + /* ,-------------------------------------------. ,-------------------------------------------. */ + KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, + KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_EQL, _______QWERTY_L3______, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, + SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR + /* `----------------------------------' `----------------------------------' */ + ), + [_FN] = LAYOUT_kyria_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______FN_______L1____, _______INACTIVE_R1____, + _______FN_______L2____, _______INACTIVE_R2____, + _______FN_______L3____, _______INACTIVE_R3____, + _______FN________T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ + ), [_SYMBOLS] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ _______SYM______L1____, _______INACTIVE_R1____, @@ -107,14 +124,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______NUM______L2____, _______INACTIVE_R2____, _______NUM______L3____, _______INACTIVE_R3____, _______NUM_______T____, _______INACTIVE__T____ - /* `---------------------' `---------------------' */ - ), - [_FN] = LAYOUT_kyria_base_wrapper( - /* ,-----------------------. ,-----------------------. */ - _______FN_______L1____, _______INACTIVE_R1____, - _______FN_______L2____, _______INACTIVE_R2____, - _______FN_______L3____, _______INACTIVE_R3____, - _______FN________T____, _______INACTIVE__T____ /* `---------------------' `---------------------' */ ), [_NAV] = LAYOUT_kyria_base_wrapper( @@ -141,15 +150,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______INACTIVE__T____, _______MEDIA_____T____ /* `---------------------' `---------------------' */ ), - // GAME layout -- qwerty without homerow mods - [_GAME] = LAYOUT_kyria_wrapper( - /* ,-------------------------------------------. ,-------------------------------------------. */ - KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, - KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_EQL, _______QWERTY_L3______, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, - SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR - /* `----------------------------------' `----------------------------------' */ - ), }; static void send_layer_via_hid(int layer) { @@ -177,12 +177,53 @@ const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( {1, 10, HSV_PURPLE} ); */ +void keyboard_post_init_rgb(void); void keyboard_post_init_user(void) { rgblight_sethsv_noeeprom(HSV_BLUE); + keyboard_post_init_rgb(); +} + + +static const uint8_t PROGMEM layer_colors[][3] = { + [_QWERTY] = {HSV_BLUE}, + [_COLEMAK] = {HSV_AZURE}, + [_GAME] = {HSV_RED}, + [_FN] = {HSV_PINK}, + [_SYMBOLS] = {HSV_GREEN}, + [_NUM] = {HSV_CORAL}, + [_NAV] = {HSV_GOLDENROD}, + [_MOUSE] = {HSV_TURQUOISE}, + [_MEDIA] = {HSV_MAGENTA} +}; + +void keyboard_post_init_rgb(void) { +/*#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION)*/ + /*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/ + /*if (rgblight_config.enable) {*/ + /*layer_state_set_user(layer_state);*/ + /*uint16_t old_hue = rgblight_config.hue;*/ + uint16_t old_hue = 170; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } + /*}*/ +/*#endif*/ + /*layer_state_set_user(layer_state);*/ } layer_state_t layer_state_set_user(layer_state_t state) { + /*uint8_t layer = get_highest_layer(state);*/ + /*switch (get_highest_layer(state))*/ + /*{*/ + /* case _QWERTY ... _MEDIA:*/ + /* rgblight_sethsv_noeeprom(layer_colors[layer][0],layer_colors[layer][1],layer_colors[layer][2]);*/ + /* send_layer_via_hid(layer);*/ + /* break;*/ + /*}*/ send_layer_via_hid(state); switch (get_highest_layer(state)) { case _QWERTY: From 9b6ed24e514719dbc2d2274325ca3c0b2162c5bb Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 27 Sep 2020 15:44:07 -0500 Subject: [PATCH 25/46] update layer coloring --- keyboards/kyria/keymaps/cwebster2/config.h | 3 + keyboards/kyria/keymaps/cwebster2/keymap.c | 94 +++++++++++++--------- users/cwebster2/cwebster2.h | 3 + 3 files changed, 62 insertions(+), 38 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index b909ecf18056..c2a768b9eeb3 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -37,6 +37,9 @@ #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_SLEEP #define RGBLIGHT_LIMIT_VAL 128 + #define RGBLIGHT_LAYERS + #define RGBLIGHT_MAX_LAYERS 16 + //#define RGBLIGHT_STARTUP_ANIMATION #endif #define TAPPING_TOGGLE 1 diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index d8d962e6974f..258e5b9f15fa 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -20,8 +20,10 @@ #include "cwebster2.h" +#ifdef WPM_ENABLE char wpm_str[10]; uint16_t wpm_graph_timer = 0; +#endif #ifdef COMBO_ENABLE enum combos { @@ -51,7 +53,8 @@ enum layers { _NUM, _NAV, _MOUSE, - _MEDIA + _MEDIA, + __LAST }; // shortcuts for certain keys to use LAYOUT_kc() @@ -131,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______INACTIVE_R1____, _______NAV______R1____, _______INACTIVE_R1____, _______NAV______R2____, _______INACTIVE_R1____, _______NAV______R3____, - _______INACTIVE__T____, _______INACTIVE__T____ + _______INACTIVE__T____, _______NAKED_R___T____ /* `---------------------' `---------------------' */ ), [_MOUSE] = LAYOUT_kyria_base_wrapper( @@ -160,45 +163,52 @@ static void send_layer_via_hid(int layer) { return; } -/* RGB LIGHT LAYERS -const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {1, 10, HSV_AZURE} +#ifdef RGBLIGHT_LAYERS +const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_BLUE} ); +const rgblight_segment_t PROGMEM my_colemak_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_AZURE} ); +const rgblight_segment_t PROGMEM my_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_RED} ); +const rgblight_segment_t PROGMEM my_fn_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_PINK} ); +const rgblight_segment_t PROGMEM my_symbols_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_GREEN} ); +const rgblight_segment_t PROGMEM my_num_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_CORAL} ); +const rgblight_segment_t PROGMEM my_nav_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_GOLDENROD} ); +const rgblight_segment_t PROGMEM my_mouse_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_TURQUOISE} ); +const rgblight_segment_t PROGMEM my_media_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_MAGENTA} ); + +const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 3, HSV_RED}, + {7, 1, HSV_RED}, + {10, 3, HSV_RED}, + {17, 1, HSV_RED} ); -const rgblight_segment_t PROGMEM my_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {1, 10, HSV_RED} -); - -const rgblight_segment_t PROGMEM my_lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {1, 10, HSV_TURQUOISE} +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_qwerty_layer, + my_colemak_layer, + my_game_layer, + my_fn_layer, + my_symbols_layer, + my_num_layer, + my_nav_layer, + my_mouse_layer, + my_media_layer, + my_capslock_layer ); +#endif -const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {1, 10, HSV_PURPLE} -); -*/ void keyboard_post_init_rgb(void); void keyboard_post_init_user(void) { rgblight_sethsv_noeeprom(HSV_BLUE); keyboard_post_init_rgb(); +#ifdef RGBLIGHT_LAYERS + rgblight_layers = my_rgb_layers; +#else + rgblight_sethsv_noeeprom(HSV_BLUE); +#endif } - -static const uint8_t PROGMEM layer_colors[][3] = { - [_QWERTY] = {HSV_BLUE}, - [_COLEMAK] = {HSV_AZURE}, - [_GAME] = {HSV_RED}, - [_FN] = {HSV_PINK}, - [_SYMBOLS] = {HSV_GREEN}, - [_NUM] = {HSV_CORAL}, - [_NAV] = {HSV_GOLDENROD}, - [_MOUSE] = {HSV_TURQUOISE}, - [_MEDIA] = {HSV_MAGENTA} -}; - void keyboard_post_init_rgb(void) { -/*#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION)*/ +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) /*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/ /*if (rgblight_config.enable) {*/ /*layer_state_set_user(layer_state);*/ @@ -211,20 +221,17 @@ void keyboard_post_init_rgb(void) { wait_ms(10); } /*}*/ -/*#endif*/ +#endif /*layer_state_set_user(layer_state);*/ } layer_state_t layer_state_set_user(layer_state_t state) { - /*uint8_t layer = get_highest_layer(state);*/ - /*switch (get_highest_layer(state))*/ - /*{*/ - /* case _QWERTY ... _MEDIA:*/ - /* rgblight_sethsv_noeeprom(layer_colors[layer][0],layer_colors[layer][1],layer_colors[layer][2]);*/ - /* send_layer_via_hid(layer);*/ - /* break;*/ - /*}*/ +#ifdef RGBLIGHT_LAYERS + for (int i = _QWERTY; i < __LAST; i++) { + rgblight_set_layer_state(i, layer_state_cmp(state, i)); + } send_layer_via_hid(state); +#else switch (get_highest_layer(state)) { case _QWERTY: rgblight_sethsv_noeeprom(HSV_BLUE); @@ -251,10 +258,21 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_sethsv_noeeprom(HSV_RED); break; } +#endif return state; } +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(9, led_state.caps_lock); + return true; +} + #ifdef OLED_DRIVER_ENABLE +void suspend_power_down_user() { + oled_clear(); + oled_off(); +} + oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h index c295f1578001..5c32afa40840 100644 --- a/users/cwebster2/cwebster2.h +++ b/users/cwebster2/cwebster2.h @@ -32,6 +32,9 @@ #define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) #define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) +#define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL +#define _______NAKED_L___T____ KC_TAB, KC_SPC, KC_ESC + #define _______INACTIVE_R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET #define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI #define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS From 16e643c33de9cb758124a93cba9836a6218f0eff Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Mon, 28 Sep 2020 00:00:11 -0500 Subject: [PATCH 26/46] continued refactoring --- keyboards/kyria/keymaps/cwebster2/keymap.c | 25 +++++++++++++++------- users/cwebster2.h | 16 ++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 users/cwebster2.h diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 258e5b9f15fa..fffa1e22361e 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -88,12 +88,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______THUMBS_L_______, _______THUMBS_R_______ /* `---------------------' `---------------------' */ ), - [_COLEMAK] = LAYOUT_kyria_base_wrapper( + [_COLEMAK] = LAYOUT_kyria_wrapper( /* ,-----------------------. ,-----------------------. */ - _______COLEMAK_L1_____, _______COLEMAK_R1_____, - _______COLEMAK_L2_____, _______COLEMAK_R2_____, - _______COLEMAK_L3_____, _______COLEMAK_R3_____, - _______THUMBS_L_______, _______THUMBS_R_______ + KC_GRV, _______COLEMAK_L1_____, _______COLEMAK_R1_____, KC_BSLS, + KC_CTLBS, _______COLEMAK_L2_____, _______COLEMAK_R2_____, KC_SCLN, + KC_EQL, _______COLEMAK_L3_____, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______COLEMAK_R3_____, KC_MINS, + SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR /* `---------------------' `---------------------' */ ), // GAME layout -- qwerty without homerow mods @@ -102,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_EQL, _______QWERTY_L3______, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, - SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR + SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR /* `----------------------------------' `----------------------------------' */ ), [_FN] = LAYOUT_kyria_base_wrapper( @@ -159,7 +159,7 @@ static void send_layer_via_hid(int layer) { uint8_t data[RAW_EPSIZE]; data[0] = 1; data[1] = layer; - raw_hid_send((uint8_t*)data, sizeof(data)); + raw_hid_send(data, sizeof(data)); return; } @@ -335,15 +335,19 @@ static void render_qmk_logo(void) { } static void render_status(void) { + static bool isColemak = false; // QMK Logo and version information render_qmk_logo(); - oled_write_P(PSTR("Kyria rev1.3\n\n"), false); + oled_write_P(PSTR("Kyria rev1.3\n"), false); + + oled_write_P(isColemak ? PSTR("COLEMAK\n") : PSTR("QWERTY\n"), false); // Host Keyboard Layer Status oled_write_P(PSTR("Layer: "), false); switch (get_highest_layer(layer_state)) { case _QWERTY: oled_write_P(PSTR("Default\n"), false); + isColemak = false; break; case _SYMBOLS: oled_write_P(PSTR("Shifted Sym\n"), false); @@ -359,6 +363,11 @@ static void render_status(void) { break; case _GAME: oled_write_P(PSTR("Game\n"), false); + isColemak = false; + break; + case _COLEMAK: + oled_write_P(PSTR("Colemak-DHm\n"), false); + isColemak = true; break; case _MEDIA: oled_write_P(PSTR("Media keys\n"), false); diff --git a/users/cwebster2.h b/users/cwebster2.h new file mode 100644 index 000000000000..e309baa7ada2 --- /dev/null +++ b/users/cwebster2.h @@ -0,0 +1,16 @@ +/* Copyright 2020 Casey Webster + * + * 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 . + */ + From e14d59b2e3b973729ebd48de1feba9577016cf4d Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 29 Sep 2020 15:28:59 -0500 Subject: [PATCH 27/46] more features --- keyboards/kyria/keymaps/cwebster2/config.h | 9 +++++++++ keyboards/kyria/keymaps/cwebster2/rules.mk | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index c2a768b9eeb3..04b5d2ab98b7 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -47,6 +47,7 @@ //#define TAPPING_FORCE_HOLD #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT +#define NO_ACTION_ONESHOT #define COMBO_COUNT 2 @@ -79,6 +80,14 @@ # undef LOCKING_RESYNC_ENABLE #endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#ifndef NO_DEBUG + #define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) + #define NO_PRINT +#endif // !NO_PRINT diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 0e4944baef14..1ba7dea11383 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -6,11 +6,11 @@ EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no BOOTMAGIC_ENABLE = no RAW_ENABLE = yes -Link_Time_Optimization = yes -EXTRAFLAGS = -flto WPM_ENABLE = yes GRAVE_ESC_ENABLE = no CONSOLE_ENABLE = no COMBO_ENABLE = no SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no +Link_Time_Optimization = yes +EXTRAFLAGS += -flto From 42751749751019d3e85f012c21cee6b4c8fd2491 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 29 Sep 2020 18:57:43 -0500 Subject: [PATCH 28/46] modifier color --- keyboards/kyria/keymaps/cwebster2/keymap.c | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index fffa1e22361e..42f78dd97e99 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -181,6 +181,26 @@ const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( {17, 1, HSV_RED} ); +const rgblight_segment_t PROGMEM my_shift_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {9, 1, HSV_RED}, + {19, 1, HSV_RED} +); + +const rgblight_segment_t PROGMEM my_ctrl_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {5, 1, HSV_ORANGE}, + {15, 1, HSV_ORANGE} +); + +const rgblight_segment_t PROGMEM my_alt_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {4, 1, HSV_GOLD}, + {14, 1, HSV_GOLD} +); + +const rgblight_segment_t PROGMEM my_gui_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {3, 1, HSV_SPRINGGREEN}, + {13, 1, HSV_SPRINGGREEN} +); + const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( my_qwerty_layer, my_colemak_layer, @@ -191,7 +211,11 @@ const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( my_nav_layer, my_mouse_layer, my_media_layer, - my_capslock_layer + my_capslock_layer, + my_shift_layer, + my_ctrl_layer, + my_alt_layer, + my_gui_layer ); #endif @@ -391,6 +415,11 @@ static void render_status(void) { oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); + + rgblight_set_layer_state(10, mods & MOD_MASK_SHIFT); + rgblight_set_layer_state(11, mods & MOD_MASK_CTRL); + rgblight_set_layer_state(12, mods & MOD_MASK_ALT); + rgblight_set_layer_state(13, mods & MOD_MASK_GUI); } void oled_task_user(void) { From ca5e0f527b09dfc275034fa1e78adaebed3f0785 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Thu, 1 Oct 2020 22:34:20 -0500 Subject: [PATCH 29/46] Move stuff to userspace --- users/cwebster2/cwebster2.c | 18 ++++++ users/cwebster2/cwebster2.h | 105 +++++++++++++++-------------------- users/cwebster2/my_miryoku.h | 77 +++++++++++++++++++++++++ users/cwebster2/rules.mk | 13 +++++ 4 files changed, 153 insertions(+), 60 deletions(-) create mode 100644 users/cwebster2/cwebster2.c create mode 100644 users/cwebster2/my_miryoku.h create mode 100644 users/cwebster2/rules.mk diff --git a/users/cwebster2/cwebster2.c b/users/cwebster2/cwebster2.c new file mode 100644 index 000000000000..18306fe5ed83 --- /dev/null +++ b/users/cwebster2/cwebster2.c @@ -0,0 +1,18 @@ + +void keyboard_post_init_rgb(void) { +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) + /*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/ + /*if (rgblight_config.enable) {*/ + /*layer_state_set_user(layer_state);*/ + /*uint16_t old_hue = rgblight_config.hue;*/ + uint16_t old_hue = 170; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); + matrix_scan(); + wait_ms(10); + } + /*}*/ +#endif + /*layer_state_set_user(layer_state);*/ +} diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h index 5c32afa40840..65473a3eba6f 100644 --- a/users/cwebster2/cwebster2.h +++ b/users/cwebster2/cwebster2.h @@ -13,64 +13,49 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#pragma once + +#include "my_miryoku.h" + +#define TAPPING_TOGGLE 1 +#define TAPPING_TERM 200 +//#define TAPPING_FORCE_HOLD +#undef PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT +#define NO_ACTION_ONESHOT + +#ifdef AUTO_SHIFT_ENABLE + #define AUTO_SHIFT_TIMEOUT 200 + #define NO_AUTO_SHIFT_SPECIAL + #define NO_AUTO_SHIFT_ALPHA +#endif + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 16 +#undef MOUSEKEY_WHEEL_DELAY +#define MOUSEKEY_WHEEL_DELAY 0 +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 6 +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 64 + +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#ifndef NO_DEBUG + #define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) + #define NO_PRINT +#endif // !NO_PRINT + +void keyboard_post_init_rgb(void); - -#define _______QWERTY_L1______ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _______QWERTY_L2______ LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G -#define _______QWERTY_L3______ KC_Z, KC_X, KC_C, KC_V, KC_B -#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______QWERTY_R2______ KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_SCLN) -#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH - -#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B -#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G -#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V -#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT -#define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O) -#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH - -#define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) -#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) - -#define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL -#define _______NAKED_L___T____ KC_TAB, KC_SPC, KC_ESC - -#define _______INACTIVE_R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET -#define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI -#define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS - -#define _______INACTIVE_L1____ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS -#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_TRNS - -#define _______INACTIVE__T____ KC_TRNS, KC_TRNS, KC_TRNS - - -#define _______SYM______L1____ KC_RCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_LCBR -#define _______SYM______L2____ KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS -#define _______SYM______L3____ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE -#define _______SYM_______T____ KC_LPRN, KC_RPRN, KC_UNDS - -#define _______NUM______L1____ KC_RBRC, KC_7, KC_8, KC_9, KC_LBRC -#define _______NUM______L2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL -#define _______NUM______L3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH -#define _______NUM_______T____ KC_DOT, KC_0, KC_MINS - -#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYSREQ -#define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS -#define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_BSLS -#define _______FN________T____ KC_MENU, KC_SLSH, KC_TRNS - -#define _______NAV______R1____ KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_AGIN -#define _______NAV______R2____ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS -#define _______NAV______R3____ KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS - -#define _______MEDIA____R1____ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI -#define _______MEDIA____R2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL -#define _______MEDIA____R3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH -#define _______MEDIA_____T____ KC_MSTP, KC_MPLY, KC_MUTE - -#define _______MOUSE____R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define _______MOUSE____R2____ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS -#define _______MOUSE____R3____ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_TRNS -#define _______MOUSE_____T____ KC_BTN1, KC_BTN3, KC_BTN2 diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h new file mode 100644 index 000000000000..7d4e1dd45d71 --- /dev/null +++ b/users/cwebster2/my_miryoku.h @@ -0,0 +1,77 @@ +/* Copyright 2020 Casey Webster + * + * 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 + +#define _______QWERTY_L1______ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _______QWERTY_L2______ LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G +#define _______QWERTY_L3______ KC_Z, KC_X, KC_C, KC_V, KC_B +#define _______QWERTY_R1______ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _______QWERTY_R2______ KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_SCLN) +#define _______QWERTY_R3______ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH + +#define _______COLEMAK_L1_____ KC_Q, KC_W, KC_F, KC_P, KC_B +#define _______COLEMAK_L2_____ LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G +#define _______COLEMAK_L3_____ KC_Z, KC_X, KC_C, KC_D, KC_V +#define _______COLEMAK_R1_____ KC_J, KC_L, KC_U, KC_Y, KC_QUOT +#define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O) +#define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH + +#define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) +#define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) + +#define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL +#define _______NAKED_L___T____ KC_TAB, KC_SPC, KC_ESC + +#define _______INACTIVE_R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET +#define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI +#define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS + +#define _______INACTIVE_L1____ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS +#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_TRNS + +#define _______INACTIVE__T____ KC_TRNS, KC_TRNS, KC_TRNS + + +#define _______SYM______L1____ KC_RCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_LCBR +#define _______SYM______L2____ KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS +#define _______SYM______L3____ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE +#define _______SYM_______T____ KC_LPRN, KC_RPRN, KC_UNDS + +#define _______NUM______L1____ KC_RBRC, KC_7, KC_8, KC_9, KC_LBRC +#define _______NUM______L2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL +#define _______NUM______L3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH +#define _______NUM_______T____ KC_DOT, KC_0, KC_MINS + +#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYSREQ +#define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS +#define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_BSLS +#define _______FN________T____ KC_MENU, KC_SLSH, KC_TRNS + +#define _______NAV______R1____ KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, KC_AGIN +#define _______NAV______R2____ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_CAPS +#define _______NAV______R3____ KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS +#define _______NAV_______T____ KC_ENT, KC_BSPC, KC_DEL + +#define _______MEDIA____R1____ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI +#define _______MEDIA____R2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL +#define _______MEDIA____R3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH +#define _______MEDIA_____T____ KC_MSTP, KC_MPLY, KC_MUTE + +#define _______MOUSE____R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define _______MOUSE____R2____ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS +#define _______MOUSE____R3____ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_TRNS +#define _______MOUSE_____T____ KC_BTN1, KC_BTN3, KC_BTN2 diff --git a/users/cwebster2/rules.mk b/users/cwebster2/rules.mk new file mode 100644 index 000000000000..baedac377f36 --- /dev/null +++ b/users/cwebster2/rules.mk @@ -0,0 +1,13 @@ +AUTO_SHIFT_ENABLE = no # Enable autoshift +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +BOOTMAGIC_ENABLE = no +GRAVE_ESC_ENABLE = no +CONSOLE_ENABLE = no +SPACE_CADET_ENABLE = no +GRAVE_ESC_ENABLE = no +Link_Time_Optimization = yes +EXTRAFLAGS += -flto + +SRC += cwebster2.c From 4c41580ae57311f9db629d79f731dfb6bd9e4dd6 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Thu, 1 Oct 2020 22:35:07 -0500 Subject: [PATCH 30/46] Moving stuff out to userspace --- keyboards/kyria/keymaps/cwebster2/config.h | 86 +--------------------- keyboards/kyria/keymaps/cwebster2/keymap.c | 22 +----- keyboards/kyria/keymaps/cwebster2/rules.mk | 11 --- 3 files changed, 4 insertions(+), 115 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 04b5d2ab98b7..13f8623671a2 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -16,6 +16,8 @@ #pragma once +#include "cwebster2.h" + #ifdef OLED_DRIVER_ENABLE #define OLED_DISPLAY_128X64 #endif @@ -25,7 +27,7 @@ //#define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_BREATHING //#define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_KNIGHT //#define RGBLIGHT_EFFECT_RAINBOW_MOOD //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL //#define RGBLIGHT_EFFECT_RGB_TEST @@ -42,92 +44,10 @@ //#define RGBLIGHT_STARTUP_ANIMATION #endif -#define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 -//#define TAPPING_FORCE_HOLD -#undef PERMISSIVE_HOLD -#define IGNORE_MOD_TAP_INTERRUPT -#define NO_ACTION_ONESHOT - #define COMBO_COUNT 2 -#ifdef AUTO_SHIFT_ENABLE - #define AUTO_SHIFT_TIMEOUT 200 - #define NO_AUTO_SHIFT_SPECIAL - #define NO_AUTO_SHIFT_ALPHA -#endif - #define QMK_KEYS_PER_SCAN 1 #define EE_HANDS -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 0 -#undef MOUSEKEY_INTERVAL -#define MOUSEKEY_INTERVAL 16 -#undef MOUSEKEY_WHEEL_DELAY -#define MOUSEKEY_WHEEL_DELAY 0 -#undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 6 -#undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 64 - -/* Disable unused and unneeded features to reduce on firmware size */ -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif - -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION -#ifndef NO_DEBUG - #define NO_DEBUG -#endif // !NO_DEBUG -#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) - #define NO_PRINT -#endif // !NO_PRINT - - - -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ - L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ - L20, L21, L22, L23, L24, L25, L26, L27, R27, R26, R25, R24, R23, R22, R21, R20, \ - L33, L34, L35, L36, L37, R37, R36, R35, R34, R33 \ - ) \ - LAYOUT ( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R05, KC_##R04, KC_##R03, KC_##R02, KC_##R01, KC_##R00, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R15, KC_##R14, KC_##R13, KC_##R12, KC_##R11, KC_##R10, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R27, KC_##R26, KC_##R25, KC_##R24, KC_##R23, KC_##R22, KC_##R21, KC_##R20, \ - KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R37, KC_##R36, KC_##R35, KC_##R34, KC_##R33 \ - ) #define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__) - - -#define LAYOUT_left_kc( \ - L00, L01, L02, L03, L04, L05, \ - L10, L11, L12, L13, L14, L15, \ - L20, L21, L22, L23, L24, L25, L26, L27, \ - L33, L34, L35, L36, L37 \ - ) \ - LAYOUT_kc ( \ - L00, L01, L02, L03, L04, L05, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - L10, L11, L12, L13, L14, L15, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - L20, L21, L22, L23, L24, L25, L26, L27, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - L33, L34, L35, L36, L37, TRNS, TRNS, TRNS, TRNS, TRNS \ - ) - -#define LAYOUT_right_kc( \ - R05, R04, R03, R02, R01, R00, \ - R15, R14, R13, R12, R11, R10, \ - R27, R26, R25, R24, R23, R22, R21, R20, \ - R37, R36, R35, R34, R33 \ - ) \ - LAYOUT_kc ( \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, R05, R04, R03, R02, R01, R00, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, R15, R14, R13, R12, R11, R10, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, R27, R26, R25, R24, R23, R22, R21, R20, \ - TRNS, TRNS, TRNS, TRNS, TRNS, R37, R36, R35, R34, R33 \ - ) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 42f78dd97e99..22fc5a81d5f9 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -134,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______INACTIVE_R1____, _______NAV______R1____, _______INACTIVE_R1____, _______NAV______R2____, _______INACTIVE_R1____, _______NAV______R3____, - _______INACTIVE__T____, _______NAKED_R___T____ + _______INACTIVE__T____, _______NAV_______T____ /* `---------------------' `---------------------' */ ), [_MOUSE] = LAYOUT_kyria_base_wrapper( @@ -219,8 +219,6 @@ const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( ); #endif -void keyboard_post_init_rgb(void); - void keyboard_post_init_user(void) { rgblight_sethsv_noeeprom(HSV_BLUE); keyboard_post_init_rgb(); @@ -231,24 +229,6 @@ void keyboard_post_init_user(void) { #endif } -void keyboard_post_init_rgb(void) { -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) - /*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/ - /*if (rgblight_config.enable) {*/ - /*layer_state_set_user(layer_state);*/ - /*uint16_t old_hue = rgblight_config.hue;*/ - uint16_t old_hue = 170; - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 255; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); - matrix_scan(); - wait_ms(10); - } - /*}*/ -#endif - /*layer_state_set_user(layer_state);*/ -} - layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_LAYERS for (int i = _QWERTY; i < __LAST; i++) { diff --git a/keyboards/kyria/keymaps/cwebster2/rules.mk b/keyboards/kyria/keymaps/cwebster2/rules.mk index 1ba7dea11383..fe9ca3c2ccf2 100644 --- a/keyboards/kyria/keymaps/cwebster2/rules.mk +++ b/keyboards/kyria/keymaps/cwebster2/rules.mk @@ -1,16 +1,5 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUTO_SHIFT_ENABLE = no # Enable autoshift -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = no -BOOTMAGIC_ENABLE = no RAW_ENABLE = yes WPM_ENABLE = yes -GRAVE_ESC_ENABLE = no -CONSOLE_ENABLE = no COMBO_ENABLE = no -SPACE_CADET_ENABLE = no -GRAVE_ESC_ENABLE = no -Link_Time_Optimization = yes -EXTRAFLAGS += -flto From 646ef9bd0dc24ddd2049aecd71fbf224e5c57ab8 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Fri, 2 Oct 2020 00:06:45 -0500 Subject: [PATCH 31/46] refactoring into userspace --- keyboards/kyria/keymaps/cwebster2/config.h | 2 - keyboards/kyria/keymaps/cwebster2/keymap.c | 79 +++------------------- users/cwebster2/config.h | 57 ++++++++++++++++ users/cwebster2/cwebster2.c | 32 +++++++++ users/cwebster2/cwebster2.h | 65 +++++++----------- users/cwebster2/keycodes.c | 22 ++++++ users/cwebster2/keycodes.h | 11 +++ users/cwebster2/rules.mk | 1 + 8 files changed, 157 insertions(+), 112 deletions(-) create mode 100644 users/cwebster2/config.h create mode 100644 users/cwebster2/keycodes.c create mode 100644 users/cwebster2/keycodes.h diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 13f8623671a2..18f7fc777c8e 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -16,8 +16,6 @@ #pragma once -#include "cwebster2.h" - #ifdef OLED_DRIVER_ENABLE #define OLED_DISPLAY_128X64 #endif diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 22fc5a81d5f9..aa985ea1473c 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -40,27 +40,6 @@ combo_t key_combos[COMBO_COUNT] = { }; #endif -enum custom_keycodes { - KC_LCCL = SAFE_RANGE -}; - -enum layers { - _QWERTY = 0, - _COLEMAK, - _GAME, - _FN, - _SYMBOLS, - _NUM, - _NAV, - _MOUSE, - _MEDIA, - __LAST -}; - -// shortcuts for certain keys to use LAYOUT_kc() -#define KC_CTLBS CTL_T(KC_BSPC) -#define KC_ALTCL LALT_T(KC_CAPS) - #define LAYOUT_kyria_base( \ L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, \ L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, \ @@ -217,6 +196,14 @@ const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( my_alt_layer, my_gui_layer ); + +void matrix_scan_keymap(void) { + uint8_t mods = mod_config(get_mods()); + rgblight_set_layer_state(10, mods & MOD_MASK_SHIFT); + rgblight_set_layer_state(11, mods & MOD_MASK_CTRL); + rgblight_set_layer_state(12, mods & MOD_MASK_ALT); + rgblight_set_layer_state(13, mods & MOD_MASK_GUI); +} #endif void keyboard_post_init_user(void) { @@ -235,33 +222,6 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_set_layer_state(i, layer_state_cmp(state, i)); } send_layer_via_hid(state); -#else - switch (get_highest_layer(state)) { - case _QWERTY: - rgblight_sethsv_noeeprom(HSV_BLUE); - break; - case _SYMBOLS: - rgblight_sethsv_noeeprom(HSV_GREEN); - break; - case _NUM: - rgblight_sethsv_noeeprom(HSV_CORAL); - break; - case _NAV: - rgblight_sethsv_noeeprom(HSV_GOLDENROD); - break; - case _FN: - rgblight_sethsv_noeeprom(HSV_PINK); - break; - case _MEDIA: - rgblight_sethsv_noeeprom(HSV_MAGENTA); - break; - case _MOUSE: - rgblight_sethsv_noeeprom(HSV_TURQUOISE); - break; - case _GAME: - rgblight_sethsv_noeeprom(HSV_RED); - break; - } #endif return state; } @@ -396,10 +356,6 @@ static void render_status(void) { oled_write_P(IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false); oled_write_P(IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false); - rgblight_set_layer_state(10, mods & MOD_MASK_SHIFT); - rgblight_set_layer_state(11, mods & MOD_MASK_CTRL); - rgblight_set_layer_state(12, mods & MOD_MASK_ALT); - rgblight_set_layer_state(13, mods & MOD_MASK_GUI); } void oled_task_user(void) { @@ -419,22 +375,3 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { raw_hid_send(data, length); } #endif - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint16_t my_colon_timer; - - switch (keycode) { - case KC_LCCL: - if (record->event.pressed) { - my_colon_timer = timer_read(); - register_code(KC_LCTL); - } else { - unregister_code(KC_LCTL); - if (timer_elapsed(my_colon_timer) < TAPPING_TERM) { - SEND_STRING(":"); - } - } - return false; - } - return true; -} diff --git a/users/cwebster2/config.h b/users/cwebster2/config.h new file mode 100644 index 000000000000..867ac13ca4e3 --- /dev/null +++ b/users/cwebster2/config.h @@ -0,0 +1,57 @@ +/* Copyright 2020 Casey Webster + * + * 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 + +#define TAPPING_TOGGLE 1 +#define TAPPING_TERM 200 +//#define TAPPING_FORCE_HOLD +#undef PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT +#define NO_ACTION_ONESHOT + +#ifdef AUTO_SHIFT_ENABLE + #define AUTO_SHIFT_TIMEOUT 200 + #define NO_AUTO_SHIFT_SPECIAL + #define NO_AUTO_SHIFT_ALPHA +#endif + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 16 +#undef MOUSEKEY_WHEEL_DELAY +#define MOUSEKEY_WHEEL_DELAY 0 +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 6 +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 64 + +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#ifndef NO_DEBUG + #define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) + #define NO_PRINT +#endif // !NO_PRINT + diff --git a/users/cwebster2/cwebster2.c b/users/cwebster2/cwebster2.c index 18306fe5ed83..e66eb3d7f42c 100644 --- a/users/cwebster2/cwebster2.c +++ b/users/cwebster2/cwebster2.c @@ -1,3 +1,18 @@ +#include "cwebster2.h" + +userspace_config_t userspace_config; + +__attribute__((weak)) void matrix_scan_keymap(void) {} + +void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } + + matrix_scan_keymap(); +} void keyboard_post_init_rgb(void) { #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) @@ -16,3 +31,20 @@ void keyboard_post_init_rgb(void) { #endif /*layer_state_set_user(layer_state);*/ } + +__attribute__((weak)) void eeconfig_init_keymap(void) {} + +void eeconfig_init_user(void) { + userspace_config.raw = 0; + userspace_config.rgb_layer_change = true; + eeconfig_update_user(userspace_config.raw); + eeconfig_init_keymap(); + keyboard_init(); +} + +bool hasAllBitsInMask(uint8_t value, uint8_t mask) { + value &= 0xF; + mask &= 0xF; + + return (value & mask) == mask; +} diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h index 65473a3eba6f..c8ab9ee06bc8 100644 --- a/users/cwebster2/cwebster2.h +++ b/users/cwebster2/cwebster2.h @@ -16,46 +16,33 @@ #pragma once #include "my_miryoku.h" +#include "keycodes.h" +#include "eeprom.h" + +enum userspace_layers { + _QWERTY = 0, + _COLEMAK, + _GAME, + _FN, + _SYMBOLS, + _NUM, + _NAV, + _MOUSE, + _MEDIA, + __LAST +}; -#define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 -//#define TAPPING_FORCE_HOLD -#undef PERMISSIVE_HOLD -#define IGNORE_MOD_TAP_INTERRUPT -#define NO_ACTION_ONESHOT - -#ifdef AUTO_SHIFT_ENABLE - #define AUTO_SHIFT_TIMEOUT 200 - #define NO_AUTO_SHIFT_SPECIAL - #define NO_AUTO_SHIFT_ALPHA -#endif - -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 0 -#undef MOUSEKEY_INTERVAL -#define MOUSEKEY_INTERVAL 16 -#undef MOUSEKEY_WHEEL_DELAY -#define MOUSEKEY_WHEEL_DELAY 0 -#undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 6 -#undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 64 - -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif +void keyboard_post_init_rgb(void); +void matrix_scan_keymap(void); +void eeconfig_init_keymap(void); +bool hasAllBitsInMask(uint8_t value, uint8_t mask); -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION -#ifndef NO_DEBUG - #define NO_DEBUG -#endif // !NO_DEBUG -#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) - #define NO_PRINT -#endif // !NO_PRINT -void keyboard_post_init_rgb(void); +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + }; +} userspace_config_t; +extern userspace_config_t userspace_config; diff --git a/users/cwebster2/keycodes.c b/users/cwebster2/keycodes.c new file mode 100644 index 000000000000..85299939d88b --- /dev/null +++ b/users/cwebster2/keycodes.c @@ -0,0 +1,22 @@ +#include "keycodes.h" + +__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t my_colon_timer; + + switch (keycode) { + case KC_LCCL: + if (record->event.pressed) { + my_colon_timer = timer_read(); + register_code(KC_LCTL); + } else { + unregister_code(KC_LCTL); + if (timer_elapsed(my_colon_timer) < TAPPING_TERM) { + SEND_STRING(":"); + } + } + return false; + } + return process_record_keymap(keycode, record); +} diff --git a/users/cwebster2/keycodes.h b/users/cwebster2/keycodes.h new file mode 100644 index 000000000000..5f4f9a2398fb --- /dev/null +++ b/users/cwebster2/keycodes.h @@ -0,0 +1,11 @@ +#pragma once + +#include QMK_KEYBOARD_H + +enum userspace_custom_keycodes { + KC_LCCL = SAFE_RANGE, + NEW_SAFE_RANGE +}; + +#define KC_CTLBS CTL_T(KC_BSPC) +#define KC_ALTCL LALT_T(KC_CAPS) diff --git a/users/cwebster2/rules.mk b/users/cwebster2/rules.mk index baedac377f36..ab1391f2c4db 100644 --- a/users/cwebster2/rules.mk +++ b/users/cwebster2/rules.mk @@ -11,3 +11,4 @@ Link_Time_Optimization = yes EXTRAFLAGS += -flto SRC += cwebster2.c +SRC += keycodes.c From 9b97a1c0554f2f13718771d1caa24850746a9a00 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sat, 3 Oct 2020 16:39:48 -0500 Subject: [PATCH 32/46] More refactoring --- keyboards/kyria/keymaps/cwebster2/config.h | 2 +- keyboards/kyria/keymaps/cwebster2/keymap.c | 18 ++++++++++-------- users/cwebster2/keycodes.h | 1 + users/cwebster2/my_miryoku.h | 8 ++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 18f7fc777c8e..3dac751022a6 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -44,7 +44,7 @@ #define COMBO_COUNT 2 -#define QMK_KEYS_PER_SCAN 1 +#define QMK_KEYS_PER_SCAN 4 #define EE_HANDS diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index aa985ea1473c..3e0c59a67f74 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -161,23 +161,23 @@ const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); const rgblight_segment_t PROGMEM my_shift_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {9, 1, HSV_RED}, - {19, 1, HSV_RED} + {3, 1, HSV_RED}, + {13, 1, HSV_RED} ); const rgblight_segment_t PROGMEM my_ctrl_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {5, 1, HSV_ORANGE}, - {15, 1, HSV_ORANGE} + {4, 1, HSV_ORANGE}, + {14, 1, HSV_ORANGE} ); const rgblight_segment_t PROGMEM my_alt_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {4, 1, HSV_GOLD}, - {14, 1, HSV_GOLD} + {5, 1, HSV_GOLD}, + {15, 1, HSV_GOLD} ); const rgblight_segment_t PROGMEM my_gui_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {3, 1, HSV_SPRINGGREEN}, - {13, 1, HSV_SPRINGGREEN} + {9, 1, HSV_SPRINGGREEN}, + {19, 1, HSV_SPRINGGREEN} ); const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( @@ -216,6 +216,8 @@ void keyboard_post_init_user(void) { #endif } +//todo https://github.com/qmk/qmk_firmware/blob/debdc6379c7a72815df1f53e3406479381d243af/keyboards/crkbd/keymaps/soundmonster/keymap.c RGBRST + layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_LAYERS for (int i = _QWERTY; i < __LAST; i++) { diff --git a/users/cwebster2/keycodes.h b/users/cwebster2/keycodes.h index 5f4f9a2398fb..fa81a76e35eb 100644 --- a/users/cwebster2/keycodes.h +++ b/users/cwebster2/keycodes.h @@ -9,3 +9,4 @@ enum userspace_custom_keycodes { #define KC_CTLBS CTL_T(KC_BSPC) #define KC_ALTCL LALT_T(KC_CAPS) +#define KC_LOCK LGUI(LCTL(KC_L)) diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h index 7d4e1dd45d71..cb02fa2c1b84 100644 --- a/users/cwebster2/my_miryoku.h +++ b/users/cwebster2/my_miryoku.h @@ -35,11 +35,11 @@ #define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL #define _______NAKED_L___T____ KC_TAB, KC_SPC, KC_ESC -#define _______INACTIVE_R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET +#define _______INACTIVE_R1____ KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, RESET #define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI #define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS -#define _______INACTIVE_L1____ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define _______INACTIVE_L1____ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_LOCK #define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS #define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_TRNS @@ -67,8 +67,8 @@ #define _______NAV_______T____ KC_ENT, KC_BSPC, KC_DEL #define _______MEDIA____R1____ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI -#define _______MEDIA____R2____ KC_SCLN, KC_4, KC_5, KC_6, KC_EQL -#define _______MEDIA____R3____ KC_GRV, KC_1, KC_2, KC_3, KC_SLSH +#define _______MEDIA____R2____ KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS +#define _______MEDIA____R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS #define _______MEDIA_____T____ KC_MSTP, KC_MPLY, KC_MUTE #define _______MOUSE____R1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS From 65787d55ba451e077e4566333035e6e6a421e430 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 4 Oct 2020 14:23:30 -0500 Subject: [PATCH 33/46] Fixing some errors in the keymap and changing the oled output --- keyboards/kyria/keymaps/cwebster2/config.h | 7 ++- keyboards/kyria/keymaps/cwebster2/keymap.c | 51 +++++++++++-------- quantum/split_common/transport.c | 59 +++++++++++++++------- users/cwebster2/my_miryoku.h | 4 +- 4 files changed, 77 insertions(+), 44 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 3dac751022a6..0fedd1eb3251 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -42,10 +42,15 @@ //#define RGBLIGHT_STARTUP_ANIMATION #endif -#define COMBO_COUNT 2 +#ifdef COMBO_ENABLE + #define COMBO_COUNT 2 +#endif #define QMK_KEYS_PER_SCAN 4 #define EE_HANDS #define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__) + +#define DEBUG_MATRIX_SCAN_RATE +//#define SPLIT_MODS_ENABLE diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 3e0c59a67f74..da054eb48d25 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -88,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,-----------------------. ,-----------------------. */ _______FN_______L1____, _______INACTIVE_R1____, _______FN_______L2____, _______INACTIVE_R2____, - _______FN_______L3____, _______INACTIVE_R3____, + _______FN_______L3____, _______NAV______R2____, _______FN________T____, _______INACTIVE__T____ /* `---------------------' `---------------------' */ ), @@ -110,30 +110,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_NAV] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ - _______INACTIVE_R1____, _______NAV______R1____, - _______INACTIVE_R1____, _______NAV______R2____, - _______INACTIVE_R1____, _______NAV______R3____, + _______INACTIVE_L1____, _______NAV______R1____, + _______INACTIVE_L2____, _______NAV______R2____, + _______INACTIVE_L3____, _______NAV______R3____, _______INACTIVE__T____, _______NAV_______T____ /* `---------------------' `---------------------' */ ), [_MOUSE] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ - _______INACTIVE_R1____, _______MOUSE____R1____, - _______INACTIVE_R1____, _______MOUSE____R2____, - _______INACTIVE_R1____, _______MOUSE____R3____, + _______INACTIVE_L1____, _______MOUSE____R1____, + _______INACTIVE_L2____, _______MOUSE____R2____, + _______INACTIVE_L3____, _______MOUSE____R3____, _______INACTIVE__T____, _______MOUSE_____T____ /* `---------------------' `---------------------' */ ), [_MEDIA] = LAYOUT_kyria_base_wrapper( /* ,-----------------------. ,-----------------------. */ - _______INACTIVE_R1____, _______MEDIA____R1____, - _______INACTIVE_R1____, _______MEDIA____R2____, - _______INACTIVE_R1____, _______MEDIA____R3____, + _______INACTIVE_L1____, _______MEDIA____R1____, + _______INACTIVE_L2____, _______MEDIA____R2____, + _______INACTIVE_L3____, _______MEDIA____R3____, _______INACTIVE__T____, _______MEDIA_____T____ /* `---------------------' `---------------------' */ ), }; +#ifdef RAW_ENABLE static void send_layer_via_hid(int layer) { uint8_t data[RAW_EPSIZE]; data[0] = 1; @@ -141,6 +142,8 @@ static void send_layer_via_hid(int layer) { raw_hid_send(data, sizeof(data)); return; } +#endif + #ifdef RGBLIGHT_LAYERS const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_BLUE} ); @@ -214,6 +217,8 @@ void keyboard_post_init_user(void) { #else rgblight_sethsv_noeeprom(HSV_BLUE); #endif + /*debug_enable=true;*/ + /*debug_matrix=true;*/ } //todo https://github.com/qmk/qmk_firmware/blob/debdc6379c7a72815df1f53e3406479381d243af/keyboards/crkbd/keymaps/soundmonster/keymap.c RGBRST @@ -223,7 +228,9 @@ layer_state_t layer_state_set_user(layer_state_t state) { for (int i = _QWERTY; i < __LAST; i++) { rgblight_set_layer_state(i, layer_state_cmp(state, i)); } +# ifdef RAW_ENABLE send_layer_via_hid(state); +# endif #endif return state; } @@ -244,6 +251,11 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { } 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}; + static const char PROGMEM logo[] = { // canvas is 128x64. need 16 padding // 80x32 @@ -266,6 +278,7 @@ static void render_logo(void) { oled_advance_page(false); oled_advance_page(false); oled_advance_page(false); + oled_write_P(qmk_logo, false); #ifdef COMBO_ENABLE oled_write_P(PSTR("Combos enabled: "), false); @@ -276,40 +289,33 @@ static void render_logo(void) { } #endif +#ifdef SPLIT_MODS_ENABLE uint8_t mods = get_mods() | get_weak_mods(); oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" "), false); oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" "), false); oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false); oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false); oled_write_P(PSTR("\n"), false); +#endif #ifdef WPM_ENABLE // Write WPM sprintf(wpm_str, "WPM: %03d", get_current_wpm()); //oled_write_P(PSTR("\n"), false); + oled_write_P(PSTR(" "), false); oled_write(wpm_str, false); #endif } -static void render_qmk_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 render_status(void) { static bool isColemak = false; // QMK Logo and version information - render_qmk_logo(); - oled_write_P(PSTR("Kyria rev1.3\n"), false); + oled_write_P(PSTR("Kyria rev1.3\n\n"), false); - oled_write_P(isColemak ? PSTR("COLEMAK\n") : PSTR("QWERTY\n"), false); + oled_write_P(isColemak ? PSTR("COLEMAK ") : PSTR("QWERTY "), false); // Host Keyboard Layer Status - oled_write_P(PSTR("Layer: "), false); switch (get_highest_layer(layer_state)) { case _QWERTY: oled_write_P(PSTR("Default\n"), false); @@ -346,6 +352,7 @@ static void render_status(void) { } uint8_t mods = get_mods() | get_weak_mods(); + oled_write_P(PSTR("\n"), false); oled_write_P((mods & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" "), false); oled_write_P((mods & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" "), false); oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false); diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index c4014d4708d0..0de3fdf6b8f3 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -28,12 +28,14 @@ static pin_t encoders_pad[] = ENCODERS_PAD_A; typedef struct _I2C_slave_buffer_t { matrix_row_t smatrix[ROWS_PER_HAND]; +# ifdef SPLIT_MODS_ENABLE uint8_t real_mods; uint8_t weak_mods; -#ifndef NO_ACTION_ONESHOT +# ifndef NO_ACTION_ONESHOT uint8_t oneshot_mods; -#endif -# ifdef(BACKLIGHT_ENABLE) +# endif +# endif +# ifdef BACKLIGHT_ENABLE uint8_t backlight_level; # endif # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) @@ -49,12 +51,12 @@ typedef struct _I2C_slave_buffer_t { static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; +# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) +# define I2C_REAL_MODS_START offsetof(I2C_slave_buffer_t, real_mods) +# define I2C_WEAK_MODS_START offsetof(I2C_slave_buffer_t, weak_mods) +# define I2C_ONESHOT_MODS_START offsetof(I2C_slave_buffer_t, oneshot_mods) # define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level) # define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync) -# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) -# define I2C_MODS_START offsetof(I2C_slave_buffer_t, real_mods) -# define I2C_MODS_START offsetof(I2C_slave_buffer_t, weak_mods) -# define I2C_MODS_START offsetof(I2C_slave_buffer_t, oneshot_mods) # define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) # define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm) @@ -101,23 +103,32 @@ bool transport_master(matrix_row_t matrix[]) { } } # endif + +# ifdef SPLIT_MODS_ENABLE uint8_t real_mods = get_mods(); if (real_mods != i2c_buffer->real_mods) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)&real_mods, sizeof(real_mods), TIMEOUT) >= 0) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_REAL_MODS_START, (void *)&real_mods, sizeof(real_mods), TIMEOUT) >= 0) { i2c_buffer->real_mods = real_mods; + } } uint8_t weak_mods = get_weak_mods(); if (weak_mods != i2c_buffer->weak_mods) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)&weak_mods, sizeof(weak_mods), TIMEOUT) >= 0) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WEAK_MODS_START, (void *)&weak_mods, sizeof(weak_mods), TIMEOUT) >= 0) { i2c_buffer->weak_mods = weak_mods; + } } - uint8_t oneshot_mods = get_mods(); +# ifndef NO_ACTION_ONESHOT + uint8_t oneshot_mods = get_oneshot_mods(); if (oneshot_mods != i2c_buffer->oneshot_mods) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MODS_START, (void *)&oneshot_mods, sizeof(oneshot_mods), TIMEOUT) >= 0) { + if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_ONESHOT_MODS_START, (void *)&oneshot_mods, sizeof(oneshot_mods), TIMEOUT) >= 0) { i2c_buffer->oneshot_mods = oneshot_mods; + } } +# endif +# endif + return true; } @@ -146,11 +157,13 @@ void transport_slave(matrix_row_t matrix[]) { set_current_wpm(i2c_buffer->current_wpm); # endif +# ifdef SPLIT_MODS_ENABLE set_mods(i2c_buffer->real_mods); set_weak_mods(i2c_buffer->weak_mods); -#ifndef NO_ACTION_ONESHOT +# ifndef NO_ACTION_ONESHOT set_oneshot_mods(i2c_buffer->oneshot_mods); -#endif +# endif +# endif } void transport_master_init(void) { i2c_init(); } @@ -172,11 +185,13 @@ typedef struct _Serial_s2m_buffer_t { } Serial_s2m_buffer_t; typedef struct _Serial_m2s_buffer_t { +# ifdef SPLIT_MODS_ENABLE uint8_t real_mods; uint8_t weak_mods; -#ifndef NO_ACTION_ONESHOT +# ifndef NO_ACTION_ONESHOT uint8_t oneshot_mods; -#endif +# endif +# endif # ifdef BACKLIGHT_ENABLE uint8_t backlight_level; # endif @@ -289,11 +304,14 @@ bool transport_master(matrix_row_t matrix[]) { // Write wpm to slave serial_m2s_buffer.current_wpm = get_current_wpm(); # endif + +# ifdef SPLIT_MODS_ENABLE serial_m2s_buffer.real_mods = get_mods(); serial_m2s_buffer.weak_mods = get_weak_mods(); -#ifndef NO_ACTION_ONESHOT +# ifndef NO_ACTION_ONESHOT serial_m2s_buffer.oneshot_mods = get_oneshot_mods(); -#endif +# endif +# endif return true; } @@ -314,11 +332,14 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(serial_m2s_buffer.current_wpm); # endif + +# ifdef SPLIT_MODS_ENABLE set_mods(serial_m2s_buffer.real_mods); set_weak_mods(serial_m2s_buffer.weak_mods); -#ifndef NO_ACTION_ONESHOT +# ifndef NO_ACTION_ONESHOT set_oneshot_mods(serial_m2s_buffer.oneshot_mods); -#endif +# endif +# endif } #endif diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h index cb02fa2c1b84..f1eb1b04775a 100644 --- a/users/cwebster2/my_miryoku.h +++ b/users/cwebster2/my_miryoku.h @@ -39,9 +39,9 @@ #define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI #define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS -#define _______INACTIVE_L1____ RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_LOCK +#define _______INACTIVE_L1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LOCK #define _______INACTIVE_L2____ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_TRNS -#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_TRNS, KC_TRNS, KC_TRNS +#define _______INACTIVE_L3____ KC_TRNS, KC_RALT, KC_LEFT, KC_RGHT, KC_TRNS #define _______INACTIVE__T____ KC_TRNS, KC_TRNS, KC_TRNS From 000cb2231db83d1a910fc37d390aa47e5497fc1d Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 4 Oct 2020 15:27:09 -0500 Subject: [PATCH 34/46] Sync zen1 keymap to my userspace config --- keyboards/kyria/keymaps/cwebster2/config.h | 4 +- .../rgbkb/zen/rev1/keymaps/cwebster2/config.h | 20 +-- .../rgbkb/zen/rev1/keymaps/cwebster2/keymap.c | 144 ++++++++++++------ .../cwebster2/rgbkb_zen_rev1_layout_mine.json | 1 - .../rgbkb/zen/rev1/keymaps/cwebster2/rules.mk | 3 +- users/cwebster2/cwebster2.h | 3 + 6 files changed, 109 insertions(+), 66 deletions(-) delete mode 100644 keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 0fedd1eb3251..49e02661505b 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -50,7 +50,5 @@ #define EE_HANDS -#define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__) - -#define DEBUG_MATRIX_SCAN_RATE +//#define DEBUG_MATRIX_SCAN_RATE //#define SPLIT_MODS_ENABLE diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h index 4a549c5b1f75..211e3517ec95 100644 --- a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2020 Casey Webster 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 @@ -22,17 +22,13 @@ along with this program. If not, see . /* Use I2C or Serial, not both */ #define USE_SERIAL -// #define USE_I2C -/* Select hand configuration */ +#define EE_HANDS -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS +#ifdef COMBO_ENABLE + #define COMBO_COUNT 2 +#endif -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 +#define QMK_KEYS_PER_SCAN 4 + +#define EE_HANDS diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c index 3481ddc8687e..56ebf95934ff 100644 --- a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c @@ -1,55 +1,101 @@ #include QMK_KEYBOARD_H +#include "rev1.h" +#include "cwebster2.h" +#define LAYOUT_zen_base( \ + L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, \ + L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, \ + L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, \ + L33, L34, L35, R35, R34, R33 \ + ) \ + LAYOUT_zen_wrapper ( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \ + KC_GRV, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, KC_BSLS, \ + KC_CTLBS, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, KC_QUOT, \ + KC_EQL, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, KC_MINS, \ + KC_LCCL, KC_LGUI, SCMD_T(KC_LBRC), C_S_T(KC_MINS), L33, L34, L35, R35, R34, R33, TO(_GAME), KC_PSCR, KC_ALTCL, KC_LSFT \ + ) +#define LAYOUT_zen_base_wrapper(...) LAYOUT_zen_base(__VA_ARGS__) -enum layer_number { - _QWERTY = 0, - _SYMBOLS, - _NAV -}; - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - SYMBOLS, - NAV -}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - - /* Qwerty - * ,-----------------------------------------. .-----------------------------------------. - * | GRV | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Bksp | A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | | N | M | , | . | / |Shift | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | MO2 | GUI | Alt |RGBTOG| ESC |Space | CTRL || GUI |Enter | left | down | up | right| MO1 | - * `------------------------------------------------''-----------------------------------------------' - */ - - - [_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_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_BSPC, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - MO(2), KC_LGUI, KC_LALT, RGB_TOG, TT(2), KC_SPC, LCTL_T(KC_ESC), LGUI_T(KC_BSPC), KC_ENT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MO(1) \ - ), - - - - - [_SYMBOLS] = 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_TRNS, RGB_RMOD, RGB_VAI, KC_TRNS, KC_LBRC, KC_RBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ - KC_TRNS, RGB_RMOD, RGB_VAD, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ - KC_LSFT, RGB_SPD, RGB_SPI, KC_TRNS, KC_MINS, KC_EQL, NK_TOGG, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, \ - KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_TRNS \ - ), - - - [_NAV] = LAYOUT(KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) +/* + * Base Layer: QWERTY + */ + [_QWERTY] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______QWERTY_L1______, _______QWERTY_R1______, + _______QWERTY_L2______, _______QWERTY_R2______, + _______QWERTY_L3______, _______QWERTY_R3______, + _______THUMBS_L_______, _______THUMBS_R_______ + /* `---------------------' `---------------------' */ + ), + [_COLEMAK] = LAYOUT_zen_wrapper( + /* ,-----------------------. ,-----------------------. */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_GRV, _______COLEMAK_L1_____, _______COLEMAK_R1_____, KC_BSLS, + KC_CTLBS, _______COLEMAK_L2_____, _______COLEMAK_R2_____, KC_SCLN, + KC_EQL, _______COLEMAK_L3_____, _______COLEMAK_R3_____, KC_MINS, + KC_LCCL, KC_LGUI, SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_QWERTY), KC_PSCR, KC_ALTCL, KC_LSFT + /* `---------------------' `---------------------' */ + ), + // GAME layout -- qwerty without homerow mods + [_GAME] = LAYOUT_zen_wrapper( + /* ,-------------------------------------------. ,-------------------------------------------. */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, + KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_EQL, _______QWERTY_L3______, _______QWERTY_R3______, KC_MINS, + KC_LCCL, KC_LGUI, SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR, KC_ALTCL, KC_LSFT + /* `----------------------------------' `----------------------------------' */ + ), + [_FN] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______FN_______L1____, _______INACTIVE_R1____, + _______FN_______L2____, _______INACTIVE_R2____, + _______FN_______L3____, _______NAV______R2____, + _______FN________T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ + ), + [_SYMBOLS] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______SYM______L1____, _______INACTIVE_R1____, + _______SYM______L2____, _______INACTIVE_R2____, + _______SYM______L3____, _______INACTIVE_R3____, + _______SYM_______T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ + ), + [_NUM] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______NUM______L1____, _______INACTIVE_R1____, + _______NUM______L2____, _______INACTIVE_R2____, + _______NUM______L3____, _______INACTIVE_R3____, + _______NUM_______T____, _______INACTIVE__T____ + /* `---------------------' `---------------------' */ + ), + [_NAV] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______INACTIVE_L1____, _______NAV______R1____, + _______INACTIVE_L2____, _______NAV______R2____, + _______INACTIVE_L3____, _______NAV______R3____, + _______INACTIVE__T____, _______NAV_______T____ + /* `---------------------' `---------------------' */ + ), + [_MOUSE] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______INACTIVE_L1____, _______MOUSE____R1____, + _______INACTIVE_L2____, _______MOUSE____R2____, + _______INACTIVE_L3____, _______MOUSE____R3____, + _______INACTIVE__T____, _______MOUSE_____T____ + /* `---------------------' `---------------------' */ + ), + [_MEDIA] = LAYOUT_zen_base_wrapper( + /* ,-----------------------. ,-----------------------. */ + _______INACTIVE_L1____, _______MEDIA____R1____, + _______INACTIVE_L2____, _______MEDIA____R2____, + _______INACTIVE_L3____, _______MEDIA____R3____, + _______INACTIVE__T____, _______MEDIA_____T____ + /* `---------------------' `---------------------' */ + ), }; + diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json deleted file mode 100644 index 248360c6e753..000000000000 --- a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rgbkb_zen_rev1_layout_mine.json +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"notes":"","documentation":"\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"rgbkb/zen/rev1","keymap":"rgbkb_zen_rev1_layout_mine","layout":"LAYOUT","layers":[["KC_GRV","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_BSPC","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_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","MO(2)","KC_LGUI","KC_LALT","RGB_TOG","KC_ESC","KC_SPC","KC_LCTL","KC_LGUI","KC_ENT","KC_LEFT","KC_DOWN","KC_UP","KC_RGHT","MO(1)"],["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_TRNS","RGB_RMOD","RGB_VAI","KC_TRNS","KC_LBRC","KC_RBRC","KC_RBRC","KC_PGUP","KC_UP","KC_PGDN","KC_INS","KC_HOME","KC_TRNS","RGB_RMOD","RGB_VAD","KC_TRNS","KC_LCBR","KC_RCBR","KC_TRNS","KC_LEFT","KC_DOWN","KC_RGHT","KC_DEL","KC_END","KC_LSFT","RGB_SPD","RGB_SPI","KC_TRNS","KC_TRNS","KC_TRNS","NK_TOGG","KC_TRNS","KC_TRNS","KC_MPLY","KC_MPRV","KC_MNXT","KC_LCTL","KC_LGUI","KC_LALT","RGB_MOD","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MUTE","KC_VOLU","KC_TRNS"],["KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO"]],"author":""} \ No newline at end of file diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk index 1e3cebb14515..632a5f610d2c 100644 --- a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/rules.mk @@ -1 +1,2 @@ -RGBLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = no +RAW_ENABLE = yes diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h index c8ab9ee06bc8..5b1df896f0f3 100644 --- a/users/cwebster2/cwebster2.h +++ b/users/cwebster2/cwebster2.h @@ -19,6 +19,9 @@ #include "keycodes.h" #include "eeprom.h" +#define LAYOUT_kyria_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_zen_wrapper(...) LAYOUT(__VA_ARGS__) + enum userspace_layers { _QWERTY = 0, _COLEMAK, From 7de07c58d4f54d4fa184fd6bf0a385251e4aeaa4 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 4 Oct 2020 15:55:11 -0500 Subject: [PATCH 35/46] Update copyright notices and revert transport.c to master --- flash_zenr1.sh | 3 - keyboards/kyria/keymaps/cwebster2/config.h | 2 +- .../rgbkb/zen/rev1/keymaps/cwebster2/keymap.c | 15 ++++ quantum/split_common/transport.c | 71 +------------------ users/cwebster2/cwebster2.c | 15 ++++ users/cwebster2/keycodes.c | 15 ++++ users/cwebster2/keycodes.h | 15 ++++ 7 files changed, 62 insertions(+), 74 deletions(-) delete mode 100755 flash_zenr1.sh diff --git a/flash_zenr1.sh b/flash_zenr1.sh deleted file mode 100755 index 34ed474c6b3b..000000000000 --- a/flash_zenr1.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -bin/qmk flash -kb rgbkb/zen/rev1 -km cwebster2 diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index 49e02661505b..b6c561e45265 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -1,4 +1,4 @@ -/* Copyright 2020 Casey Webster +/* Copyright 2020 Casey Webster * * 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 diff --git a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c index 56ebf95934ff..7001395669d4 100644 --- a/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c +++ b/keyboards/rgbkb/zen/rev1/keymaps/cwebster2/keymap.c @@ -1,3 +1,18 @@ +/* Copyright 2020 Casey Webster + * + * 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 "rev1.h" #include "cwebster2.h" diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 0de3fdf6b8f3..467ff81a97cf 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -28,16 +28,7 @@ static pin_t encoders_pad[] = ENCODERS_PAD_A; typedef struct _I2C_slave_buffer_t { matrix_row_t smatrix[ROWS_PER_HAND]; -# ifdef SPLIT_MODS_ENABLE - uint8_t real_mods; - uint8_t weak_mods; -# ifndef NO_ACTION_ONESHOT - uint8_t oneshot_mods; -# endif -# endif -# ifdef BACKLIGHT_ENABLE uint8_t backlight_level; -# endif # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) rgblight_syncinfo_t rgblight_sync; # endif @@ -51,12 +42,9 @@ typedef struct _I2C_slave_buffer_t { static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; -# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) -# define I2C_REAL_MODS_START offsetof(I2C_slave_buffer_t, real_mods) -# define I2C_WEAK_MODS_START offsetof(I2C_slave_buffer_t, weak_mods) -# define I2C_ONESHOT_MODS_START offsetof(I2C_slave_buffer_t, oneshot_mods) # define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level) # define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync) +# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix) # define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) # define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm) @@ -103,32 +91,6 @@ bool transport_master(matrix_row_t matrix[]) { } } # endif - -# ifdef SPLIT_MODS_ENABLE - uint8_t real_mods = get_mods(); - if (real_mods != i2c_buffer->real_mods) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_REAL_MODS_START, (void *)&real_mods, sizeof(real_mods), TIMEOUT) >= 0) { - i2c_buffer->real_mods = real_mods; - } - } - - uint8_t weak_mods = get_weak_mods(); - if (weak_mods != i2c_buffer->weak_mods) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WEAK_MODS_START, (void *)&weak_mods, sizeof(weak_mods), TIMEOUT) >= 0) { - i2c_buffer->weak_mods = weak_mods; - } - } - -# ifndef NO_ACTION_ONESHOT - uint8_t oneshot_mods = get_oneshot_mods(); - if (oneshot_mods != i2c_buffer->oneshot_mods) { - if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_ONESHOT_MODS_START, (void *)&oneshot_mods, sizeof(oneshot_mods), TIMEOUT) >= 0) { - i2c_buffer->oneshot_mods = oneshot_mods; - } - } -# endif -# endif - return true; } @@ -156,14 +118,6 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(i2c_buffer->current_wpm); # endif - -# ifdef SPLIT_MODS_ENABLE - set_mods(i2c_buffer->real_mods); - set_weak_mods(i2c_buffer->weak_mods); -# ifndef NO_ACTION_ONESHOT - set_oneshot_mods(i2c_buffer->oneshot_mods); -# endif -# endif } void transport_master_init(void) { i2c_init(); } @@ -185,13 +139,6 @@ typedef struct _Serial_s2m_buffer_t { } Serial_s2m_buffer_t; typedef struct _Serial_m2s_buffer_t { -# ifdef SPLIT_MODS_ENABLE - uint8_t real_mods; - uint8_t weak_mods; -# ifndef NO_ACTION_ONESHOT - uint8_t oneshot_mods; -# endif -# endif # ifdef BACKLIGHT_ENABLE uint8_t backlight_level; # endif @@ -303,14 +250,6 @@ bool transport_master(matrix_row_t matrix[]) { # ifdef WPM_ENABLE // Write wpm to slave serial_m2s_buffer.current_wpm = get_current_wpm(); -# endif - -# ifdef SPLIT_MODS_ENABLE - serial_m2s_buffer.real_mods = get_mods(); - serial_m2s_buffer.weak_mods = get_weak_mods(); -# ifndef NO_ACTION_ONESHOT - serial_m2s_buffer.oneshot_mods = get_oneshot_mods(); -# endif # endif return true; } @@ -332,14 +271,6 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef WPM_ENABLE set_current_wpm(serial_m2s_buffer.current_wpm); # endif - -# ifdef SPLIT_MODS_ENABLE - set_mods(serial_m2s_buffer.real_mods); - set_weak_mods(serial_m2s_buffer.weak_mods); -# ifndef NO_ACTION_ONESHOT - set_oneshot_mods(serial_m2s_buffer.oneshot_mods); -# endif -# endif } #endif diff --git a/users/cwebster2/cwebster2.c b/users/cwebster2/cwebster2.c index e66eb3d7f42c..cfebc12c606f 100644 --- a/users/cwebster2/cwebster2.c +++ b/users/cwebster2/cwebster2.c @@ -1,3 +1,18 @@ +/* Copyright 2020 Casey Webster + * + * 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 "cwebster2.h" userspace_config_t userspace_config; diff --git a/users/cwebster2/keycodes.c b/users/cwebster2/keycodes.c index 85299939d88b..7ed979072d9c 100644 --- a/users/cwebster2/keycodes.c +++ b/users/cwebster2/keycodes.c @@ -1,3 +1,18 @@ +/* Copyright 2020 Casey Webster + * + * 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 "keycodes.h" __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } diff --git a/users/cwebster2/keycodes.h b/users/cwebster2/keycodes.h index fa81a76e35eb..b6363d646ee9 100644 --- a/users/cwebster2/keycodes.h +++ b/users/cwebster2/keycodes.h @@ -1,3 +1,18 @@ +/* Copyright 2020 Casey Webster + * + * 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 #include QMK_KEYBOARD_H From 455adf70020143f2b412523c17a0f811c17ddf87 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 4 Oct 2020 16:28:58 -0500 Subject: [PATCH 36/46] Swap tab and esc --- users/cwebster2/my_miryoku.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h index f1eb1b04775a..cb25af85760e 100644 --- a/users/cwebster2/my_miryoku.h +++ b/users/cwebster2/my_miryoku.h @@ -29,7 +29,7 @@ #define _______COLEMAK_R2_____ KC_M, RSFT_T(KC_N), RCTL_T(KC_E), RALT_T(KC_I), RGUI_T(KC_O) #define _______COLEMAK_R3_____ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH -#define _______THUMBS_L_______ LT(_MOUSE,KC_TAB), LT(_NAV,KC_SPC), LT(_MEDIA, KC_ESC) +#define _______THUMBS_L_______ LT(_MOUSE,KC_ESC), LT(_NAV,KC_SPC), LT(_MEDIA, KC_TAB) #define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) #define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL From 9ac871516ad0ff319809946c6341155b0ec07a31 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 4 Oct 2020 17:35:19 -0500 Subject: [PATCH 37/46] Remove a file accidentally created --- users/cwebster2.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 users/cwebster2.h diff --git a/users/cwebster2.h b/users/cwebster2.h deleted file mode 100644 index e309baa7ada2..000000000000 --- a/users/cwebster2.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright 2020 Casey Webster - * - * 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 . - */ - From 261fb54144b411141dc951eefd8e050bf89e6304 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Sun, 4 Oct 2020 19:26:16 -0500 Subject: [PATCH 38/46] Use LTO_ENABLE to turn on Link_Time_Optimization --- users/cwebster2/rules.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/users/cwebster2/rules.mk b/users/cwebster2/rules.mk index ab1391f2c4db..f39d4ebc96c9 100644 --- a/users/cwebster2/rules.mk +++ b/users/cwebster2/rules.mk @@ -7,8 +7,7 @@ GRAVE_ESC_ENABLE = no CONSOLE_ENABLE = no SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no -Link_Time_Optimization = yes -EXTRAFLAGS += -flto +LTO_ENABLE = yes SRC += cwebster2.c SRC += keycodes.c From 0d8db75c16b71ff453c0422edfdeb98f08bdf162 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Mon, 5 Oct 2020 00:00:21 -0500 Subject: [PATCH 39/46] Drop modtap thumbs on game layout --- keyboards/kyria/keymaps/cwebster2/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index da054eb48d25..fa44eae1f3b5 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_EQL, _______QWERTY_L3______, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, - SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______THUMBS_L_______, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR + SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______NAKED_L___T____, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR /* `----------------------------------' `----------------------------------' */ ), [_FN] = LAYOUT_kyria_base_wrapper( From 78112bf9f0b9c86d0d3cbc8733a6ba4f8a76da37 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Tue, 6 Oct 2020 23:11:37 -0500 Subject: [PATCH 40/46] Update game keymap --- keyboards/kyria/keymaps/cwebster2/keymap.c | 4 +++- users/cwebster2/my_miryoku.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index fa44eae1f3b5..77cb84f28e48 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -80,7 +80,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,-------------------------------------------. ,-------------------------------------------. */ KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_EQL, _______QWERTY_L3______, KC_LCCL, KC_LGUI, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, + KC_LSFT, _______QWERTY_L3______, KC_LCCL, KC_LALT, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______NAKED_L___T____, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR /* `----------------------------------' `----------------------------------' */ ), @@ -235,10 +235,12 @@ layer_state_t layer_state_set_user(layer_state_t state) { return state; } +#ifdef RGBLIGHT_LAYERS bool led_update_user(led_t led_state) { rgblight_set_layer_state(9, led_state.caps_lock); return true; } +#endif #ifdef OLED_DRIVER_ENABLE void suspend_power_down_user() { diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h index cb25af85760e..2d348cf2ecd9 100644 --- a/users/cwebster2/my_miryoku.h +++ b/users/cwebster2/my_miryoku.h @@ -33,7 +33,7 @@ #define _______THUMBS_R_______ LT(_FN, KC_ENT), LT(_NUM,KC_BSPC), LT(_SYMBOLS,KC_DEL) #define _______NAKED_R___T____ KC_ENT, KC_BSPC, KC_DEL -#define _______NAKED_L___T____ KC_TAB, KC_SPC, KC_ESC +#define _______NAKED_L___T____ KC_ESC, KC_SPC, KC_TAB #define _______INACTIVE_R1____ KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, RESET #define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI From 74c55ede3fc3528f4b89c53033d0ab331435e952 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Wed, 7 Oct 2020 15:52:14 -0500 Subject: [PATCH 41/46] More iteration on the game keymap --- keyboards/kyria/keymaps/cwebster2/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index 77cb84f28e48..e91741b44dab 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, _______QWERTY_L1______, _______QWERTY_R1______, KC_BSLS, KC_CTLBS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, _______QWERTY_L3______, KC_LCCL, KC_LALT, KC_ALTCL, KC_LSFT, _______QWERTY_R3______, KC_MINS, - SCMD_T(KC_LBRC), C_S_T(KC_MINS), _______NAKED_L___T____, _______THUMBS_R_______, TO(_COLEMAK), KC_PSCR + KC_EQL, KC_0, _______NAKED_L___T____, _______THUMBS_R_______, TO(_COLEMAK), KC_F12 /* `----------------------------------' `----------------------------------' */ ), [_FN] = LAYOUT_kyria_base_wrapper( From 003e2b5a457328bd17287b013437f5317433a0e0 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Thu, 8 Oct 2020 13:52:59 -0500 Subject: [PATCH 42/46] Add oled indications of kitty and i3 mod --- keyboards/kyria/keymaps/cwebster2/config.h | 1 + keyboards/kyria/keymaps/cwebster2/keymap.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/keyboards/kyria/keymaps/cwebster2/config.h b/keyboards/kyria/keymaps/cwebster2/config.h index b6c561e45265..6a56d7ee905f 100644 --- a/keyboards/kyria/keymaps/cwebster2/config.h +++ b/keyboards/kyria/keymaps/cwebster2/config.h @@ -37,6 +37,7 @@ #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_SLEEP #define RGBLIGHT_LIMIT_VAL 128 + #define RGBLIGHT_EFFECT_BREATHE_MAX 128 #define RGBLIGHT_LAYERS #define RGBLIGHT_MAX_LAYERS 16 //#define RGBLIGHT_STARTUP_ANIMATION diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index e91741b44dab..acf563e6a8a6 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -298,6 +298,7 @@ static void render_logo(void) { oled_write_P((mods & MOD_MASK_CTRL) ? PSTR("CTRL ") : PSTR(" "), false); oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false); oled_write_P(PSTR("\n"), false); + #endif #ifdef WPM_ENABLE @@ -361,6 +362,14 @@ static void render_status(void) { oled_write_P((mods & MOD_MASK_SHIFT) ? PSTR("SHFT ") : PSTR(" "), false); oled_write_P(PSTR("\n"), false); +#define I3MASK MOD_BIT(KC_LGUI) +#define I3SMASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_LSFT)) +#define KMASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_LSFT)) + + oled_write_P((mods == I3MASK) ? PSTR("I3 ") : (mods == I3SMASK) ? PSTR("I3-SFT ") : PSTR(" "), false); + oled_write_P((mods == KMASK) ? PSTR("KITTY ") : PSTR(" "), false); + oled_write_P(PSTR("\n"), false); + // Host Keyboard LED Status uint8_t led_usb_state = host_keyboard_leds(); oled_write_P(IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false); From 76a5b7fda16700b5d476fb1a6d2a0c5175b48e25 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Mon, 12 Oct 2020 17:35:15 -0500 Subject: [PATCH 43/46] Promote colemak to default --- keyboards/kyria/keymaps/cwebster2/keymap.c | 6 +++--- users/cwebster2/cwebster2.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/kyria/keymaps/cwebster2/keymap.c b/keyboards/kyria/keymaps/cwebster2/keymap.c index acf563e6a8a6..311ad167aa13 100644 --- a/keyboards/kyria/keymaps/cwebster2/keymap.c +++ b/keyboards/kyria/keymaps/cwebster2/keymap.c @@ -146,8 +146,8 @@ static void send_layer_via_hid(int layer) { #ifdef RGBLIGHT_LAYERS -const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_BLUE} ); -const rgblight_segment_t PROGMEM my_colemak_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_AZURE} ); +const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_AZURE} ); +const rgblight_segment_t PROGMEM my_colemak_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_BLUE} ); const rgblight_segment_t PROGMEM my_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_RED} ); const rgblight_segment_t PROGMEM my_fn_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_PINK} ); const rgblight_segment_t PROGMEM my_symbols_layer[] = RGBLIGHT_LAYER_SEGMENTS( {0, 20, HSV_GREEN} ); @@ -184,8 +184,8 @@ const rgblight_segment_t PROGMEM my_gui_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( - my_qwerty_layer, my_colemak_layer, + my_qwerty_layer, my_game_layer, my_fn_layer, my_symbols_layer, diff --git a/users/cwebster2/cwebster2.h b/users/cwebster2/cwebster2.h index 5b1df896f0f3..3d315d67401d 100644 --- a/users/cwebster2/cwebster2.h +++ b/users/cwebster2/cwebster2.h @@ -23,8 +23,8 @@ #define LAYOUT_zen_wrapper(...) LAYOUT(__VA_ARGS__) enum userspace_layers { - _QWERTY = 0, - _COLEMAK, + _COLEMAK = 0, + _QWERTY, _GAME, _FN, _SYMBOLS, From 2692f9466194da3783e90619a23a1bb0a57b0976 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Mon, 12 Oct 2020 17:41:53 -0500 Subject: [PATCH 44/46] Update tapping term for modtap keys --- users/cwebster2/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/cwebster2/config.h b/users/cwebster2/config.h index 867ac13ca4e3..0ea099bf3983 100644 --- a/users/cwebster2/config.h +++ b/users/cwebster2/config.h @@ -16,7 +16,7 @@ #pragma once #define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 +#define TAPPING_TERM 300 //#define TAPPING_FORCE_HOLD #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT From fe12f3cd0f17d50898104c9aef23a04b296ddb82 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Mon, 12 Oct 2020 18:26:42 -0500 Subject: [PATCH 45/46] Add per key tapping term --- users/cwebster2/config.h | 4 ++-- users/cwebster2/keycodes.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/users/cwebster2/config.h b/users/cwebster2/config.h index 0ea099bf3983..78733687cc41 100644 --- a/users/cwebster2/config.h +++ b/users/cwebster2/config.h @@ -16,7 +16,8 @@ #pragma once #define TAPPING_TOGGLE 1 -#define TAPPING_TERM 300 +#define TAPPING_TERM 200 +#define TAPPING_TERM_PER_KEY //#define TAPPING_FORCE_HOLD #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT @@ -54,4 +55,3 @@ #if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) #define NO_PRINT #endif // !NO_PRINT - diff --git a/users/cwebster2/keycodes.c b/users/cwebster2/keycodes.c index 7ed979072d9c..39b4341bd02a 100644 --- a/users/cwebster2/keycodes.c +++ b/users/cwebster2/keycodes.c @@ -35,3 +35,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return process_record_keymap(keycode, record); } + +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LGUI_T(KC_A): + case LALT_T(KC_S): + case LCTL_T(KC_D): + case LSFT_T(KC_F): + case RSFT_T(KC_J): + case RCTL_T(KC_K): + case RALT_T(KC_L): + case RGUI_T(KC_SCLN): + return TAPPING_TERM + 150; + default: + return TAPPING_TERM; + } +} From f094e072c9a6e38d270428e73b9abf27838291f1 Mon Sep 17 00:00:00 2001 From: Casey Webster Date: Mon, 12 Oct 2020 22:57:35 -0500 Subject: [PATCH 46/46] Use left modifiers on right side --- users/cwebster2/my_miryoku.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h index 2d348cf2ecd9..943855ad4323 100644 --- a/users/cwebster2/my_miryoku.h +++ b/users/cwebster2/my_miryoku.h @@ -36,7 +36,7 @@ #define _______NAKED_L___T____ KC_ESC, KC_SPC, KC_TAB #define _______INACTIVE_R1____ KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, RESET -#define _______INACTIVE_R2____ KC_TRNS, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI +#define _______INACTIVE_R2____ KC_TRNS, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI #define _______INACTIVE_R3____ KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_TRNS #define _______INACTIVE_L1____ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LOCK