From 819ac64b26ae68f38b36867f7cb1e169d5e824ff Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:00:33 -0400 Subject: [PATCH 001/160] initial commit --- .../ansi_encoder/keymaps/mkillewald/config.h | 29 ++ ...ron_q2_ansi_knob_configure_mkillewald.json | 418 ++++++++++++++++++ .../ansi_encoder/keymaps/mkillewald/keymap.c | 178 ++++++++ .../keymaps/mkillewald/keymap_user.h | 25 ++ .../keymaps/mkillewald/keymap_user_config.c | 83 ++++ .../keymaps/mkillewald/keymap_user_config.h | 28 ++ .../ansi_encoder/keymaps/mkillewald/readme.md | 59 +++ .../keymaps/mkillewald/rgb_matrix_user.c | 124 ++++++ .../keymaps/mkillewald/rgb_matrix_user.h | 27 ++ .../ansi_encoder/keymaps/mkillewald/rules.mk | 12 + 10 files changed, 983 insertions(+) create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h new file mode 100644 index 000000000000..aeb981b8dfe3 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -0,0 +1,29 @@ +/* Copyright 2021 @ Mike Killewald + * + * 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 CAPS_WORD_ENABLE +# define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD +# define CAPS_WORD_INDICATOR_COLOR RGB_RED +# define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER +#endif + +#ifdef RGB_MATRIX_ENABLE +# define CAPS_LOCK_INDICATOR_COLOR RGB_RED +# define FN1_LAYER_COLOR RGB_ORANGE +# define FN2_LAYER_COLOR RGB_GREEN +#endif \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json new file mode 100644 index 000000000000..a59858f53859 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json @@ -0,0 +1,418 @@ +{ + "name": "Keychron Q2 ANSI Knob", + "vendorProductId": 875823377, + "macros": [ + "{KC_LGUI,KC_LEFT}", + "{KC_LGUI,KC_RGHT}", + "{KC_LGUI,KC_LCTL,KC_Q}{150}{KC_ESC}", + "{KC_LGUI,KC_MINS}", + "{KC_LGUI,KC_PEQL}", + "{KC_LGUI,KC_0}", + "{KC_LCTL,KC_MINS}", + "{KC_LCTL,KC_PEQL}", + "{KC_LCTL,KC_0}", + "", + "", + "", + "", + "", + "", + "" + ], + "layers": [ + [ + "KC_ESC", + "KC_1", + "KC_2", + "KC_3", + "KC_4", + "KC_5", + "KC_6", + "KC_7", + "KC_8", + "KC_9", + "KC_0", + "KC_MINS", + "KC_EQL", + "KC_BSPC", + "KC_MUTE", + "KC_TAB", + "KC_Q", + "KC_W", + "KC_E", + "KC_R", + "KC_T", + "KC_Y", + "KC_U", + "KC_I", + "KC_O", + "KC_P", + "KC_LBRC", + "KC_RBRC", + "KC_BSLS", + "KC_PGUP", + "KC_CAPS", + "KC_A", + "KC_S", + "KC_D", + "KC_F", + "KC_G", + "KC_H", + "KC_J", + "KC_K", + "KC_L", + "KC_SCLN", + "KC_QUOT", + "KC_DOWN", + "KC_ENT", + "KC_PGDN", + "KC_LSFT", + "KC_NO", + "KC_Z", + "KC_X", + "KC_C", + "KC_V", + "KC_B", + "KC_N", + "KC_M", + "KC_COMM", + "KC_DOT", + "KC_SLSH", + "KC_NO", + "KC_RSFT", + "KC_UP", + "KC_LCTL", + "CUSTOM(2)", + "CUSTOM(4)", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_SPC", + "KC_NO", + "KC_NO", + "KC_NO", + "CUSTOM(5)", + "MO(2)", + "MO(4)", + "KC_LEFT", + "KC_RGHT" + ], + [ + "KC_ESC", + "KC_1", + "KC_2", + "KC_3", + "KC_4", + "KC_5", + "KC_6", + "KC_7", + "KC_8", + "KC_9", + "KC_0", + "KC_MINS", + "KC_EQL", + "KC_BSPC", + "KC_MUTE", + "KC_TAB", + "KC_Q", + "KC_W", + "KC_E", + "KC_R", + "KC_T", + "KC_Y", + "KC_U", + "KC_I", + "KC_O", + "KC_P", + "KC_LBRC", + "KC_RBRC", + "KC_BSLS", + "KC_PGUP", + "KC_CAPS", + "KC_A", + "KC_S", + "KC_D", + "KC_F", + "KC_G", + "KC_H", + "KC_J", + "KC_K", + "KC_L", + "KC_SCLN", + "KC_QUOT", + "KC_DOWN", + "KC_ENT", + "KC_PGDN", + "KC_LSFT", + "KC_NO", + "KC_Z", + "KC_X", + "KC_C", + "KC_V", + "KC_B", + "KC_N", + "KC_M", + "KC_COMM", + "KC_DOT", + "KC_SLSH", + "KC_NO", + "KC_RSFT", + "KC_UP", + "KC_LCTL", + "KC_LGUI", + "KC_LALT", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_SPC", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_RALT", + "MO(3)", + "MO(4)", + "KC_LEFT", + "KC_RGHT" + ], + [ + "KC_GRV", + "KC_BRID", + "KC_BRIU", + "CUSTOM(0)", + "CUSTOM(1)", + "RGB_VAD", + "RGB_VAI", + "KC_MPRV", + "KC_MPLY", + "KC_MNXT", + "KC_MUTE", + "KC_VOLD", + "KC_VOLU", + "KC_TRNS", + "MACRO(5)", + "KC_TRNS", + "MACRO(2)", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "MACRO(0)", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "MACRO(1)", + "KC_TRNS", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_TRNS", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS" + ], + [ + "KC_GRV", + "KC_BRID", + "KC_BRIU", + "CUSTOM(7)", + "CUSTOM(8)", + "RGB_VAD", + "RGB_VAI", + "KC_MPRV", + "KC_MPLY", + "KC_MNXT", + "KC_MUTE", + "KC_VOLD", + "KC_VOLU", + "KC_TRNS", + "MACRO(8)", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_HOME", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_END", + "KC_TRNS", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_TRNS", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS" + ], + [ + "S(KC_GRV)", + "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_TOG", + "RGB_TOG", + "RGB_MOD", + "RGB_VAI", + "RGB_HUI", + "RGB_SAI", + "RGB_SPI", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_DEL", + "KC_TRNS", + "RGB_RMOD", + "RGB_VAD", + "RGB_HUD", + "RGB_SAD", + "RGB_SPD", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_HOME", + "KC_TRNS", + "KC_NO", + "CUSTOM(11)", + "CUSTOM(12)", + "CUSTOM(13)", + "CUSTOM(14)", + "KC_TRNS", + "MAGIC_TOGGLE_NKRO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_TRNS", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS" + ] + ], + "encoders": [ + [ + ["KC_VOLD", "KC_VOLU"], + ["KC_VOLD", "KC_VOLU"], + ["MACRO(3)", "MACRO(4)"], + ["MACRO(6)", "MACRO(7)"], + ["RGB_VAD", "RGB_VAI"] + ] + ] +} \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c new file mode 100644 index 000000000000..3c8a5c5eb871 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -0,0 +1,178 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "keychron_common.h" +#include "keymap_user.h" +#include "keymap_user_config.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_user.h" +#endif + +// clang-format off + +enum my_keycodes { +#ifdef VIA_ENABLE + KC_LIGHT_TAB_TOGGLE = QK_KB_11, +#else + KC_LIGHT_TAB_TOGGLE = SAFE_RANGE, +#endif + KC_LIGHT_ALPHAS_TOGGLE, + KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, + KC_FN_LAYER_COLOR_TOGGLE, + KC_MACRO_LOCK_MAC, + KC_MACRO_SCREEN_SHOT_MAC +}; + +#define KC_LTTOG KC_LIGHT_TAB_TOGGLE +#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE +#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE +#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE +#define KC_LKMAC KC_MACRO_LOCK_MAC +#define KC_SSMAC KC_MACRO_SCREEN_SHOT_MAC + +bool bootloader_pressed = false; +bool do_bootloader = false; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_FN2] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_FN3] = LAYOUT_ansi_67( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FN1] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [_FN2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [_FN3] = { ENCODER_CCW_CW(_______, _______) }, +}; +#endif + +void housekeeping_task_user(void) { + if (do_bootloader) { + // bootloader was pressed on previous frame. RGB should now be off, + // so we can now call the bootloader. + reset_keyboard(); + } else if (bootloader_pressed) { + // User pressed bootloader combo and RGB was disabled earlier in this + // frame. We set a flag here to call the bootloader at end of + // the next frame. + do_bootloader = true; + } + + housekeeping_task_keychron(); +} + +void matrix_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} + +void keyboard_post_init_user(void) { + user_config_read(); +} + +/*bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { + return false; + } + + return true; +}*/ + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (process_record_keychron(keycode, record)) { + switch (keycode) { + case QK_BOOT: +#ifdef RGB_MATRIX_ENABLE + // We want to turn off LEDs before calling bootloader, so here + // we call rgb_matrix_disable_noeeprom() and set a flag because + // the LEDs won't be updated until the next frame. + rgb_matrix_disable_noeeprom(); + bootloader_pressed = true; + return false; // Skip all further processing of this key +#endif + return true; // Allow further processing of this key + case KC_LIGHT_TAB_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_tab(); + } + return false; // Skip all further processing of this key + case KC_LIGHT_ALPHAS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_alphas(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_transparent_keys_off(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_COLOR_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_color_enable(); + } + return false; // Skip all further processing of this key + case KC_MACRO_LOCK_MAC: + if (record->event.pressed) { + send_string(SS_LGUI(SS_LCTL("q")) SS_DELAY(300) SS_TAP(X_ESC)); + } + return false; // Skip all further processing of this key + case KC_MACRO_SCREEN_SHOT_MAC: + if (record->event.pressed) { + send_string(SS_LGUI(SS_LSFT("3"))); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } + } + return true; +} diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h new file mode 100644 index 000000000000..c7f6c2ae89f9 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h @@ -0,0 +1,25 @@ +/* Copyright 2021 @ Mike Killewald + * + * 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 + +enum layers{ + MAC_BASE, // Mac Base (layer 0) + WIN_BASE, // Win Base (layer 1) + _FN1, // Mac Fn1 (layer 2) + _FN2, // Win Fn1 (layer 3) + _FN3 // Mac/Win Fn2 (layer 4) +}; \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c new file mode 100644 index 000000000000..ef49aab44e40 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -0,0 +1,83 @@ +/* Copyright 2023 @ Mike Killewald + * + * 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 "keymap_user_config.h" + +typedef union { + uint32_t raw; + struct { + bool caps_lock_light_tab :1; + bool caps_lock_light_alphas :1; + bool fn_layer_transparent_keys_off :1; + bool fn_layer_color_enable :1; + }; +} user_config_t; + +user_config_t user_config; + +void eeconfig_init_user(void) { + user_config.raw = 0; + user_config.caps_lock_light_tab = false; + user_config.caps_lock_light_alphas = false; + user_config.fn_layer_transparent_keys_off = true; + user_config.fn_layer_color_enable = false; + eeconfig_update_user(user_config.raw); +} + +void user_config_read(void) { + user_config.raw = eeconfig_read_user(); +} + +void user_config_write(void) { + eeconfig_update_user(user_config.raw); +} + +bool user_config_get_caps_lock_light_tab(void) { + return user_config.caps_lock_light_tab; +} + +bool user_config_get_caps_lock_light_alphas(void) { + return user_config.caps_lock_light_alphas; +} + +bool user_config_get_fn_layer_transparent_keys_off(void) { + return user_config.fn_layer_transparent_keys_off; +} + +bool user_config_get_fn_layer_color_enable(void) { + return user_config.fn_layer_color_enable; +} + +void user_config_toggle_caps_lock_light_tab(void) { + user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit + user_config_write(); +} + +void user_config_toggle_caps_lock_light_alphas(void) { + user_config.caps_lock_light_alphas ^= 1; + user_config_write(); +} + +void user_config_toggle_fn_layer_transparent_keys_off(void) { + user_config.fn_layer_transparent_keys_off ^= 1; + user_config_write(); +} + +void user_config_toggle_fn_layer_color_enable(void) { + user_config.fn_layer_color_enable ^= 1; + user_config_write(); +} \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h new file mode 100644 index 000000000000..fe2e7943c18e --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -0,0 +1,28 @@ +/* Copyright 2023 @ Mike Killewald + * + * 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 + +void user_config_read(void); +void user_config_write(void); +bool user_config_get_caps_lock_light_tab(void); +bool user_config_get_caps_lock_light_alphas(void); +bool user_config_get_fn_layer_transparent_keys_off(void); +bool user_config_get_fn_layer_color_enable(void); +void user_config_toggle_caps_lock_light_tab(void); +void user_config_toggle_caps_lock_light_alphas(void); +void user_config_toggle_fn_layer_transparent_keys_off(void); +void user_config_toggle_fn_layer_color_enable(void); \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md new file mode 100644 index 000000000000..bf4c993f09d4 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -0,0 +1,59 @@ +## Keychron Q2 ANSI STM32L432 ENC11 (with knob) Keymap v1.0.0 + +## Features: +- Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. + +- Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) + - Activated by double tapping left Shift + - can change activation to tapping both left and right Shift by replacing define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD with #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD in config.h + - Left Shift, left Control and left Option (or left Windows key) will light when Caps Word is enabled + - #define CAPS_WORD_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Word is enabled (default: red) + - remove #define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER from config.h if you wish for the indicator to only light left Shift + +- Caps Lock RGB indicator + - the Caps Lock key will light when Caps Lock is enabled with the following options: + - #define CAPS_LOCK_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Lock is enabled (default: red) + - Fn2+Z (keycode: LTTOG) will toggle lighting the TAB key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. (default: off) + - Fn2+X (keycode: LATOG) will toggle lighting all the alpha keys when Caps Lock is enabled. (default: off) + +- Dynamic Fn layer RGB indicator + - When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted with the following options: + - #define FN1_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn1 layer (default: orange) + - #define FN2_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn2 layer (default: green) + - Fn2+C (keycode: TKTOG) will toggle turning off RGB for keys with no definition (default: RGB off) + - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color off) + +All custom keycodes described above can be moved to different keys in VIA by using the following keycodes: + - CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Togglex + - CUSTOM(12) = LATOG (default: Fn2+Z) Caps Lock Light Alpha Toggle + - CUSTOM(13) = TKTOG (default: Fn2+Z) Fn layer Trasnparent Key Toggle + - CUSTOM(14) = FCTOG (default: Fn2+Z) Fn layer Color Toggle + +RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. + +Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. + +Optional: + + I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) which makes the following layout changes: + - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) + - Fn1+Q in Mac mode will lock and sleep display + + - Changes the two vertical keys under the knob as follows: + - Base Layer: PGUP and PGDN + - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) + - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) + + - Changes the knob to function as follows: + - Base Layer: volume up, down Press: mute + - Fn1 Layer: zoom in, out Press: return to 100% zoom + - Fn2 Layer: LED brighness inc, dec Press: backlight toggle + +#### USE AT YOUR OWN RISK + +## Changelog: + +v1.0.0 March 19, 2023 +- Carried over features from my Q1V2 keymap. + + \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c new file mode 100644 index 000000000000..ad66bef49fc5 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -0,0 +1,124 @@ +/* Copyright 2023 @ Mike Killewald + * + * 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 "keychron_common.h" +#include "rgb_matrix_user.h" +#include "keymap_user.h" +#include "keymap_user_config.h" + +keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; +bool is_suspended = false; + +void suspend_power_down_user(void) { + // code will run multiple times while keyboard is suspended + is_suspended = true; +} + +void suspend_wakeup_init_user(void) { + // code will run on keyboard wakeup + is_suspended = false; +} + +void rgb_matrix_init_user(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + uint8_t led_index = g_led_config.matrix_co[row][col]; + if (led_index != NO_LED) { + led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; + } + } + } +} + +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +/* if(!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) { + return false; + }*/ + + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { + case MAC_BASE: + case WIN_BASE: +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); + } +#endif + break; + case _FN1: + case _FN2: +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } + break; + case _FN3: +#ifdef FN2_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN2_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } + break; + } + return false; +} + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = led_min; i < led_max; i++) { + uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); + if ((*is_keycode)(keycode)) { + rgb_matrix_set_color(i, red, green, blue); + } + } +} + +bool is_caps_lock_indicator(uint16_t keycode) { + bool indicator = keycode == KC_CAPS; + + if (user_config_get_caps_lock_light_tab()) { + indicator = keycode == KC_TAB || keycode == KC_CAPS; + } + + if (user_config_get_caps_lock_light_alphas()) { + return (KC_A <= keycode && keycode <= KC_Z) || indicator; + } else { + return indicator; + } +} + +bool is_caps_word_indicator(uint16_t keycode) { + bool indicator = keycode == KC_LSFT; +#ifdef CAPS_WORD_LIGHT_LOWER_LEFT_CORNER + indicator = keycode == KC_LSFT || keycode == KC_LCTL || keycode == KC_LOPTN; +#endif + return indicator; +} + +bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } +bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h new file mode 100644 index 000000000000..3cc2364c2037 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h @@ -0,0 +1,27 @@ +/* Copyright 2021 @ Mike Killewald + * + * 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 + +void rgb_matrix_init_user(void); +void rgb_matrix_set_cyber_colors(void); +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); + +bool is_caps_lock_indicator(uint16_t keycode); +bool is_caps_word_indicator(uint16_t keycode); +bool is_transparent(uint16_t keycode); +bool is_not_transparent(uint16_t keycode); + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk new file mode 100644 index 000000000000..3ebb5793fa51 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk @@ -0,0 +1,12 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes +CAPS_WORD_ENABLE = yes + +SRC += keymap_user_config.c + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_matrix_user.c +endif + +VPATH += keyboards/keychron/common +SRC += keychron_common.c From 0239fc5ee574bbba93b11603ae90d2815c34d00b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:02:58 -0400 Subject: [PATCH 002/160] updated readme --- .../ansi_encoder/keymaps/mkillewald/readme.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index bf4c993f09d4..916df97602fa 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -33,21 +33,19 @@ RGB must be toggled on for all indicators to function. If you do not want an RGB Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. -Optional: - - I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) which makes the following layout changes: - - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - - Fn1+Q in Mac mode will lock and sleep display +I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) which makes the following layout changes: + - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) + - Fn1+Q in Mac mode will lock and sleep display + + - Changes the two vertical keys under the knob as follows: + - Base Layer: PGUP and PGDN + - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) + - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) - - Changes the two vertical keys under the knob as follows: - - Base Layer: PGUP and PGDN - - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) - - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) - - - Changes the knob to function as follows: - - Base Layer: volume up, down Press: mute - - Fn1 Layer: zoom in, out Press: return to 100% zoom - - Fn2 Layer: LED brighness inc, dec Press: backlight toggle + - Changes the knob to function as follows: + - Base Layer: volume up, down Press: mute + - Fn1 Layer: zoom in, out Press: return to 100% zoom + - Fn2 Layer: LED brighness inc, dec Press: backlight toggle #### USE AT YOUR OWN RISK From f6bd2b657b1e340f82a814284e30b19124d11c43 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:04:33 -0400 Subject: [PATCH 003/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 916df97602fa..fb3cfbd83d1a 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -33,6 +33,9 @@ RGB must be toggled on for all indicators to function. If you do not want an RGB Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. + +## Optional .json Configuration File + I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) which makes the following layout changes: - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - Fn1+Q in Mac mode will lock and sleep display From a0bc1c08c95f28a5f340f7a137d20c71f33463e8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:06:17 -0400 Subject: [PATCH 004/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index fb3cfbd83d1a..dce4c7e87842 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -36,20 +36,18 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File -I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) which makes the following layout changes: +I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - Fn1+Q in Mac mode will lock and sleep display - - Changes the two vertical keys under the knob as follows: - Base Layer: PGUP and PGDN - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) - - Changes the knob to function as follows: - Base Layer: volume up, down Press: mute - Fn1 Layer: zoom in, out Press: return to 100% zoom - Fn2 Layer: LED brighness inc, dec Press: backlight toggle - + #### USE AT YOUR OWN RISK ## Changelog: From 350f2d435047456a88fa44b490ddbe2bd4175d29 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:07:28 -0400 Subject: [PATCH 005/160] updated readme --- .../q2/ansi_encoder/keymaps/mkillewald/readme.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index dce4c7e87842..96c9dc6d7475 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -37,16 +37,20 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: + - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - - Fn1+Q in Mac mode will lock and sleep display + + - Fn1+Q in Mac mode will lock and sleep display + - Changes the two vertical keys under the knob as follows: - Base Layer: PGUP and PGDN - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) + - Changes the knob to function as follows: - - Base Layer: volume up, down Press: mute - - Fn1 Layer: zoom in, out Press: return to 100% zoom - - Fn2 Layer: LED brighness inc, dec Press: backlight toggle + - Base Layer: volume up, down Press: mute + - Fn1 Layer: zoom in, out Press: return to 100% zoom + - Fn2 Layer: LED brighness inc, dec Press: backlight toggle #### USE AT YOUR OWN RISK From dc2a2a160c1382012bececdf046c1ae82d00bed5 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:08:28 -0400 Subject: [PATCH 006/160] updated readme --- .../ansi_encoder/keymaps/mkillewald/readme.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 96c9dc6d7475..5eb92262ffa2 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -38,19 +38,19 @@ Please make sure to save any customizations you have made in VIA to a .json file I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: - - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) +- Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - - Fn1+Q in Mac mode will lock and sleep display +- Fn1+Q in Mac mode will lock and sleep display - - Changes the two vertical keys under the knob as follows: - - Base Layer: PGUP and PGDN - - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) - - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) +- Changes the two vertical keys under the knob as follows: + - Base Layer: PGUP and PGDN + - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) + - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) - - Changes the knob to function as follows: - - Base Layer: volume up, down Press: mute - - Fn1 Layer: zoom in, out Press: return to 100% zoom - - Fn2 Layer: LED brighness inc, dec Press: backlight toggle +- Changes the knob to function as follows: + - Base Layer: volume up, down Press: mute + - Fn1 Layer: zoom in, out Press: return to 100% zoom + - Fn2 Layer: LED brighness inc, dec Press: backlight toggle #### USE AT YOUR OWN RISK From 570a2b79a5ec909cd5d2c2d62f5c63803685d3f0 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:09:12 -0400 Subject: [PATCH 007/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 5eb92262ffa2..ef1463a0c0ef 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -36,7 +36,9 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File -I have included an optional .json configuration file (keychron_q2_ansi_knob_configure_mkillewald.json) which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: +keychron_q2_ansi_knob_configure_mkillewald.json + +I have included an optional .json configuration file which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) From f41efa9d55e4efb7bd057817916b1ef2434bde1e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:52:28 -0400 Subject: [PATCH 008/160] RGB_ORANGE in config.h produced yellow on my Q2, so I changed FN1_LAYER_COLOR to produce orange --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index aeb981b8dfe3..27a3c6089dd9 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -24,6 +24,6 @@ #ifdef RGB_MATRIX_ENABLE # define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN1_LAYER_COLOR RGB_ORANGE +# define FN1_LAYER_COLOR 0xFF, 0x23, 0x00 # define FN2_LAYER_COLOR RGB_GREEN #endif \ No newline at end of file From 8bc043f1688eeb1ce56af78d287f9108caa5feca Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:52:44 -0400 Subject: [PATCH 009/160] updated readme --- .../q2/ansi_encoder/keymaps/mkillewald/readme.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index ef1463a0c0ef..03c551348b8d 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -33,7 +33,6 @@ RGB must be toggled on for all indicators to function. If you do not want an RGB Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. - ## Optional .json Configuration File keychron_q2_ansi_knob_configure_mkillewald.json @@ -53,6 +52,14 @@ I have included an optional .json configuration file which can be loaded in VIA - Base Layer: volume up, down Press: mute - Fn1 Layer: zoom in, out Press: return to 100% zoom - Fn2 Layer: LED brighness inc, dec Press: backlight toggle + +## Known Issues + +1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working +2. Keychron LED test Fn1+Home+Right is not working + +It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. + #### USE AT YOUR OWN RISK From cea8aceee9c9fe79b37eca99852189b1f4f6f374 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 11:55:13 -0400 Subject: [PATCH 010/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 03c551348b8d..0f1e876cf8cb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -24,10 +24,10 @@ - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color off) All custom keycodes described above can be moved to different keys in VIA by using the following keycodes: - - CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Togglex - - CUSTOM(12) = LATOG (default: Fn2+Z) Caps Lock Light Alpha Toggle - - CUSTOM(13) = TKTOG (default: Fn2+Z) Fn layer Trasnparent Key Toggle - - CUSTOM(14) = FCTOG (default: Fn2+Z) Fn layer Color Toggle +- CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Togglex +- CUSTOM(12) = LATOG (default: Fn2+Z) Caps Lock Light Alpha Toggle +- CUSTOM(13) = TKTOG (default: Fn2+Z) Fn layer Trasnparent Key Toggle +- CUSTOM(14) = FCTOG (default: Fn2+Z) Fn layer Color Toggle RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. From 8f86459e886f3c823564403007e934a9a60103cf Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 12:06:21 -0400 Subject: [PATCH 011/160] decreased red value by 1 --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 27a3c6089dd9..44e533bc8833 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -24,6 +24,6 @@ #ifdef RGB_MATRIX_ENABLE # define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN1_LAYER_COLOR 0xFF, 0x23, 0x00 +# define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 # define FN2_LAYER_COLOR RGB_GREEN #endif \ No newline at end of file From e40d4f3ea582851e9c7153a777feac41fc4f4514 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 19 Mar 2023 14:55:37 -0400 Subject: [PATCH 012/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 0f1e876cf8cb..0abc16dd648c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -25,9 +25,9 @@ All custom keycodes described above can be moved to different keys in VIA by using the following keycodes: - CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Togglex -- CUSTOM(12) = LATOG (default: Fn2+Z) Caps Lock Light Alpha Toggle -- CUSTOM(13) = TKTOG (default: Fn2+Z) Fn layer Trasnparent Key Toggle -- CUSTOM(14) = FCTOG (default: Fn2+Z) Fn layer Color Toggle +- CUSTOM(12) = LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle +- CUSTOM(13) = TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle +- CUSTOM(14) = FCTOG (default: Fn2+V) Fn layer Color Toggle RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. From 3dbc53117b4d5ed43c961c7e13a6bd2c2dfd2597 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 12:26:43 -0400 Subject: [PATCH 013/160] removed custom macros, retained same functionality --- ...ron_q2_ansi_knob_configure_mkillewald.json | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json index a59858f53859..c9e82638ddcb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json @@ -2,15 +2,15 @@ "name": "Keychron Q2 ANSI Knob", "vendorProductId": 875823377, "macros": [ - "{KC_LGUI,KC_LEFT}", - "{KC_LGUI,KC_RGHT}", - "{KC_LGUI,KC_LCTL,KC_Q}{150}{KC_ESC}", - "{KC_LGUI,KC_MINS}", - "{KC_LGUI,KC_PEQL}", - "{KC_LGUI,KC_0}", - "{KC_LCTL,KC_MINS}", - "{KC_LCTL,KC_PEQL}", - "{KC_LCTL,KC_0}", + "{KC_LGUI,KC_LCTL,KC_Q}{165}{KC_ESC}", + "", + "", + "", + "", + "", + "", + "", + "", "", "", "", @@ -189,9 +189,9 @@ "KC_VOLD", "KC_VOLU", "KC_TRNS", - "MACRO(5)", + "G(KC_0)", "KC_TRNS", - "MACRO(2)", + "MACRO(0)", "KC_TRNS", "KC_TRNS", "KC_TRNS", @@ -204,7 +204,7 @@ "KC_TRNS", "KC_TRNS", "KC_TRNS", - "MACRO(0)", + "G(KC_LEFT)", "KC_TRNS", "KC_TRNS", "KC_TRNS", @@ -219,7 +219,7 @@ "KC_TRNS", "KC_TRNS", "KC_TRNS", - "MACRO(1)", + "G(KC_RGHT)", "KC_TRNS", "KC_NO", "KC_TRNS", @@ -266,7 +266,7 @@ "KC_VOLD", "KC_VOLU", "KC_TRNS", - "MACRO(8)", + "C(KC_0)", "KC_TRNS", "KC_TRNS", "KC_TRNS", @@ -410,8 +410,8 @@ [ ["KC_VOLD", "KC_VOLU"], ["KC_VOLD", "KC_VOLU"], - ["MACRO(3)", "MACRO(4)"], - ["MACRO(6)", "MACRO(7)"], + ["G(KC_MINS)", "G(KC_EQL)"], + ["C(KC_MINS)", "C(KC_EQL)"], ["RGB_VAD", "RGB_VAI"] ] ] From d4d70a2b9fd381fee6d7aff4000c8c548d370bf5 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 12:27:11 -0400 Subject: [PATCH 014/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 0abc16dd648c..3cf3c6d9e2aa 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -24,7 +24,7 @@ - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color off) All custom keycodes described above can be moved to different keys in VIA by using the following keycodes: -- CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Togglex +- CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle - CUSTOM(12) = LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle - CUSTOM(13) = TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle - CUSTOM(14) = FCTOG (default: Fn2+V) Fn layer Color Toggle From 0ea4222495a4966112cbaed15db390019fdf279c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 12:35:53 -0400 Subject: [PATCH 015/160] increased delay in Fn1+Q macro to 200 ms --- .../mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json index c9e82638ddcb..d81e23390eae 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json @@ -2,7 +2,7 @@ "name": "Keychron Q2 ANSI Knob", "vendorProductId": 875823377, "macros": [ - "{KC_LGUI,KC_LCTL,KC_Q}{165}{KC_ESC}", + "{KC_LGUI,KC_LCTL,KC_Q}{200}{KC_ESC}", "", "", "", From 9a21c290f249aebb6bba55142c6726e2e28bb799 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 13:42:58 -0400 Subject: [PATCH 016/160] updated GPL header --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- .../keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c | 4 +++- .../keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h | 2 +- .../q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c | 2 +- .../q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h | 2 +- .../q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c | 2 +- .../q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 44e533bc8833..430e0b89d6b0 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 3c8a5c5eb871..9c8ed0a5afae 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Keychron (https://www.keychron.com) +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 @@ -84,6 +84,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; +// clang-format on + #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h index c7f6c2ae89f9..bf430da5158b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index ef49aab44e40..676a2424d86f 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -1,4 +1,4 @@ -/* Copyright 2023 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index fe2e7943c18e..5e7eb50b671c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -1,4 +1,4 @@ -/* Copyright 2023 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index ad66bef49fc5..82fd5e474b5f 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -1,4 +1,4 @@ -/* Copyright 2023 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h index 3cc2364c2037..9081f92be488 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 From 90b18259e78790d6bfc718f21d774111b5c7a389 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 13:47:50 -0400 Subject: [PATCH 017/160] clean up --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 9c8ed0a5afae..a5d1f1590eda 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -121,18 +121,11 @@ void keyboard_post_init_user(void) { user_config_read(); } -/*bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keychron(keycode, record)) { - return false; - } - - return true; -}*/ - bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { case QK_BOOT: + case RESET: #ifdef RGB_MATRIX_ENABLE // We want to turn off LEDs before calling bootloader, so here // we call rgb_matrix_disable_noeeprom() and set a flag because From 278bb4271e92626e2d21ad52ea7de112858f503d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 13:48:28 -0400 Subject: [PATCH 018/160] removed unused code --- .../ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 82fd5e474b5f..6031e40eaef6 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -21,17 +21,6 @@ #include "keymap_user_config.h" keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; -bool is_suspended = false; - -void suspend_power_down_user(void) { - // code will run multiple times while keyboard is suspended - is_suspended = true; -} - -void suspend_wakeup_init_user(void) { - // code will run on keyboard wakeup - is_suspended = false; -} void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { From 172ffe29f04c6000dd0bb820b78b680769ed0d56 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 14:49:30 -0400 Subject: [PATCH 019/160] toggle RGB LEDs off before calling bootloader when RESET/QK_BOOT keycode is pressed --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index a5d1f1590eda..875d651e5eaa 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -44,8 +44,11 @@ enum my_keycodes { #define KC_LKMAC KC_MACRO_LOCK_MAC #define KC_SSMAC KC_MACRO_SCREEN_SHOT_MAC +#ifdef RGB_MATRIX_ENABLE bool bootloader_pressed = false; +bool bootloader_wait = false; bool do_bootloader = false; +#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( @@ -97,16 +100,23 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { #endif void housekeeping_task_user(void) { +#ifdef RGB_MATRIX_ENABLE if (do_bootloader) { - // bootloader was pressed on previous frame. RGB should now be off, - // so we can now call the bootloader. - reset_keyboard(); - } else if (bootloader_pressed) { - // User pressed bootloader combo and RGB was disabled earlier in this - // frame. We set a flag here to call the bootloader at end of - // the next frame. + // bootloader was pressed two frames ago. RGB should now be off, + // so we can call the bootloader. + reset_keyboard(); + } else if (bootloader_wait) { + // bootloader was pressed on previous frame, we wait this frame and + // set flag to do bootloader at end of next frame. For some reason, my + // Q2 needed this extra wait frame. do_bootloader = true; + } else if (bootloader_pressed) { + // User pressed bootloader keycode and RGB was disabled earlier in this + // frame. However RGB changes wont take place immediately, so we set a + // flag here which will be caught at end of the next frame. + bootloader_wait = true; } +#endif housekeeping_task_keychron(); } @@ -125,7 +135,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { case QK_BOOT: - case RESET: #ifdef RGB_MATRIX_ENABLE // We want to turn off LEDs before calling bootloader, so here // we call rgb_matrix_disable_noeeprom() and set a flag because From 81fd3684d39b5cabf8ea6625b4ead6c50353cf38 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 20 Mar 2023 16:01:50 -0400 Subject: [PATCH 020/160] removed unused custom keycodes. Can apply as Macro in VIA instead --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 875d651e5eaa..d93b499d8d28 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -26,23 +26,20 @@ enum my_keycodes { #ifdef VIA_ENABLE - KC_LIGHT_TAB_TOGGLE = QK_KB_11, + KC_LIGHT_TAB_TOGGLE = QK_KB_11, // USER11 here gave compile error (not defined) + // indexed at 11 to appear after Keychron's keycodes #else KC_LIGHT_TAB_TOGGLE = SAFE_RANGE, #endif KC_LIGHT_ALPHAS_TOGGLE, KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE, - KC_MACRO_LOCK_MAC, - KC_MACRO_SCREEN_SHOT_MAC + KC_FN_LAYER_COLOR_TOGGLE }; #define KC_LTTOG KC_LIGHT_TAB_TOGGLE #define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE #define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_LKMAC KC_MACRO_LOCK_MAC -#define KC_SSMAC KC_MACRO_SCREEN_SHOT_MAC #ifdef RGB_MATRIX_ENABLE bool bootloader_pressed = false; @@ -163,17 +160,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { user_config_toggle_fn_layer_color_enable(); } - return false; // Skip all further processing of this key - case KC_MACRO_LOCK_MAC: - if (record->event.pressed) { - send_string(SS_LGUI(SS_LCTL("q")) SS_DELAY(300) SS_TAP(X_ESC)); - } - return false; // Skip all further processing of this key - case KC_MACRO_SCREEN_SHOT_MAC: - if (record->event.pressed) { - send_string(SS_LGUI(SS_LSFT("3"))); - } - return false; // Skip all further processing of this key + return false; // Skip all further processing of this key default: return true; // Process all other keycodes normally } From 3fba6b3f3531425f8117281ec6925d7b04723103 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 22 Mar 2023 11:46:53 -0400 Subject: [PATCH 021/160] replaced bools with enum for bootloader_state --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 53 +++++++++++-------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index d93b499d8d28..5ff51d9bb0b7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -24,6 +24,15 @@ // clang-format off +#ifdef RGB_MATRIX_ENABLE +enum my_bootloader_state { + BOOTLOADER_INACTIVE, + BOOTLOADER_PRESSED, + BOOTLOADER_WAIT, + BOOTLOADER_DO +} bootloader_state; +#endif + enum my_keycodes { #ifdef VIA_ENABLE KC_LIGHT_TAB_TOGGLE = QK_KB_11, // USER11 here gave compile error (not defined) @@ -41,12 +50,6 @@ enum my_keycodes { #define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#ifdef RGB_MATRIX_ENABLE -bool bootloader_pressed = false; -bool bootloader_wait = false; -bool do_bootloader = false; -#endif - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, @@ -98,21 +101,27 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { #ifdef RGB_MATRIX_ENABLE - if (do_bootloader) { - // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. - reset_keyboard(); - } else if (bootloader_wait) { - // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my - // Q2 needed this extra wait frame. - do_bootloader = true; - } else if (bootloader_pressed) { - // User pressed bootloader keycode and RGB was disabled earlier in this - // frame. However RGB changes wont take place immediately, so we set a - // flag here which will be caught at end of the next frame. - bootloader_wait = true; - } + switch(bootloader_state) { + case BOOTLOADER_DO: + // bootloader was pressed two frames ago. RGB should now be off, + // so we can call the bootloader. + reset_keyboard(); + break; + case BOOTLOADER_WAIT: + // bootloader was pressed on previous frame, we wait this frame and + // set flag to do bootloader at end of next frame. For some reason, my + // Q2 needed this extra wait frame. + bootloader_state = BOOTLOADER_DO; + break; + case BOOTLOADER_PRESSED: + // User pressed bootloader keycode and RGB was disabled earlier in this + // frame. However RGB changes wont take place immediately, so we set a + // flag here which will be caught at end of the next frame. + bootloader_state = BOOTLOADER_WAIT; + break; + default: + break; + } #endif housekeeping_task_keychron(); @@ -137,7 +146,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // we call rgb_matrix_disable_noeeprom() and set a flag because // the LEDs won't be updated until the next frame. rgb_matrix_disable_noeeprom(); - bootloader_pressed = true; + bootloader_state = BOOTLOADER_PRESSED; return false; // Skip all further processing of this key #endif return true; // Allow further processing of this key From 190061c8a96c1d18711367f8bce9522f53e36c7e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 31 Mar 2023 14:35:22 -0400 Subject: [PATCH 022/160] removed commented out block --- .../q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 6031e40eaef6..32f52f2ca02a 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -33,11 +33,7 @@ void rgb_matrix_init_user(void) { } } -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { -/* if(!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) { - return false; - }*/ - +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { uint8_t current_layer = get_highest_layer(layer_state); switch (current_layer) { case MAC_BASE: From e8e012e6b4ee0d246a8ff6b1d40b74fc1e69fb38 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 13:59:38 -0400 Subject: [PATCH 023/160] changed from QK_KB_11 to QK_USER_0 Co-authored-by: Nick Brassel --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 5ff51d9bb0b7..4c714049d386 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -34,12 +34,7 @@ enum my_bootloader_state { #endif enum my_keycodes { -#ifdef VIA_ENABLE - KC_LIGHT_TAB_TOGGLE = QK_KB_11, // USER11 here gave compile error (not defined) - // indexed at 11 to appear after Keychron's keycodes -#else - KC_LIGHT_TAB_TOGGLE = SAFE_RANGE, -#endif + KC_LIGHT_TAB_TOGGLE = QK_USER_0, KC_LIGHT_ALPHAS_TOGGLE, KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, KC_FN_LAYER_COLOR_TOGGLE From 7f1f36bfef79fc6e9ddf7f328a54c9e3f4f775c4 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 14:07:13 -0400 Subject: [PATCH 024/160] removed .json file --- ...ron_q2_ansi_knob_configure_mkillewald.json | 418 ------------------ 1 file changed, 418 deletions(-) delete mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json deleted file mode 100644 index d81e23390eae..000000000000 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keychron_q2_ansi_knob_configure_mkillewald.json +++ /dev/null @@ -1,418 +0,0 @@ -{ - "name": "Keychron Q2 ANSI Knob", - "vendorProductId": 875823377, - "macros": [ - "{KC_LGUI,KC_LCTL,KC_Q}{200}{KC_ESC}", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "layers": [ - [ - "KC_ESC", - "KC_1", - "KC_2", - "KC_3", - "KC_4", - "KC_5", - "KC_6", - "KC_7", - "KC_8", - "KC_9", - "KC_0", - "KC_MINS", - "KC_EQL", - "KC_BSPC", - "KC_MUTE", - "KC_TAB", - "KC_Q", - "KC_W", - "KC_E", - "KC_R", - "KC_T", - "KC_Y", - "KC_U", - "KC_I", - "KC_O", - "KC_P", - "KC_LBRC", - "KC_RBRC", - "KC_BSLS", - "KC_PGUP", - "KC_CAPS", - "KC_A", - "KC_S", - "KC_D", - "KC_F", - "KC_G", - "KC_H", - "KC_J", - "KC_K", - "KC_L", - "KC_SCLN", - "KC_QUOT", - "KC_DOWN", - "KC_ENT", - "KC_PGDN", - "KC_LSFT", - "KC_NO", - "KC_Z", - "KC_X", - "KC_C", - "KC_V", - "KC_B", - "KC_N", - "KC_M", - "KC_COMM", - "KC_DOT", - "KC_SLSH", - "KC_NO", - "KC_RSFT", - "KC_UP", - "KC_LCTL", - "CUSTOM(2)", - "CUSTOM(4)", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_SPC", - "KC_NO", - "KC_NO", - "KC_NO", - "CUSTOM(5)", - "MO(2)", - "MO(4)", - "KC_LEFT", - "KC_RGHT" - ], - [ - "KC_ESC", - "KC_1", - "KC_2", - "KC_3", - "KC_4", - "KC_5", - "KC_6", - "KC_7", - "KC_8", - "KC_9", - "KC_0", - "KC_MINS", - "KC_EQL", - "KC_BSPC", - "KC_MUTE", - "KC_TAB", - "KC_Q", - "KC_W", - "KC_E", - "KC_R", - "KC_T", - "KC_Y", - "KC_U", - "KC_I", - "KC_O", - "KC_P", - "KC_LBRC", - "KC_RBRC", - "KC_BSLS", - "KC_PGUP", - "KC_CAPS", - "KC_A", - "KC_S", - "KC_D", - "KC_F", - "KC_G", - "KC_H", - "KC_J", - "KC_K", - "KC_L", - "KC_SCLN", - "KC_QUOT", - "KC_DOWN", - "KC_ENT", - "KC_PGDN", - "KC_LSFT", - "KC_NO", - "KC_Z", - "KC_X", - "KC_C", - "KC_V", - "KC_B", - "KC_N", - "KC_M", - "KC_COMM", - "KC_DOT", - "KC_SLSH", - "KC_NO", - "KC_RSFT", - "KC_UP", - "KC_LCTL", - "KC_LGUI", - "KC_LALT", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_SPC", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_RALT", - "MO(3)", - "MO(4)", - "KC_LEFT", - "KC_RGHT" - ], - [ - "KC_GRV", - "KC_BRID", - "KC_BRIU", - "CUSTOM(0)", - "CUSTOM(1)", - "RGB_VAD", - "RGB_VAI", - "KC_MPRV", - "KC_MPLY", - "KC_MNXT", - "KC_MUTE", - "KC_VOLD", - "KC_VOLU", - "KC_TRNS", - "G(KC_0)", - "KC_TRNS", - "MACRO(0)", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "G(KC_LEFT)", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "G(KC_RGHT)", - "KC_TRNS", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_TRNS", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS" - ], - [ - "KC_GRV", - "KC_BRID", - "KC_BRIU", - "CUSTOM(7)", - "CUSTOM(8)", - "RGB_VAD", - "RGB_VAI", - "KC_MPRV", - "KC_MPLY", - "KC_MNXT", - "KC_MUTE", - "KC_VOLD", - "KC_VOLU", - "KC_TRNS", - "C(KC_0)", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_HOME", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_END", - "KC_TRNS", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_TRNS", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS" - ], - [ - "S(KC_GRV)", - "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_TOG", - "RGB_TOG", - "RGB_MOD", - "RGB_VAI", - "RGB_HUI", - "RGB_SAI", - "RGB_SPI", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_DEL", - "KC_TRNS", - "RGB_RMOD", - "RGB_VAD", - "RGB_HUD", - "RGB_SAD", - "RGB_SPD", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_HOME", - "KC_TRNS", - "KC_NO", - "CUSTOM(11)", - "CUSTOM(12)", - "CUSTOM(13)", - "CUSTOM(14)", - "KC_TRNS", - "MAGIC_TOGGLE_NKRO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_TRNS", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS", - "KC_TRNS" - ] - ], - "encoders": [ - [ - ["KC_VOLD", "KC_VOLU"], - ["KC_VOLD", "KC_VOLU"], - ["G(KC_MINS)", "G(KC_EQL)"], - ["C(KC_MINS)", "C(KC_EQL)"], - ["RGB_VAD", "RGB_VAI"] - ] - ] -} \ No newline at end of file From 2cdd12c8542046e7a78ec487116af5c5a64d8e7f Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 14:15:35 -0400 Subject: [PATCH 025/160] updated readme --- .../q2/ansi_encoder/keymaps/mkillewald/readme.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 3cf3c6d9e2aa..e92db616d8f7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -35,7 +35,7 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File -keychron_q2_ansi_knob_configure_mkillewald.json +[https://drive.google.com/file/d/1aLno7NCXyGtsXduB4LRbHoctklYt4Psh/view?usp=share_link](keychron_q2_ansi_knob_configure_mkillewald.json) I have included an optional .json configuration file which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: @@ -43,6 +43,10 @@ I have included an optional .json configuration file which can be loaded in VIA - Fn1+Q in Mac mode will lock and sleep display +- Uses Grave Escape on key to the left of the 1 key: + - Base Layer: key functions as ESC, shift+key gives ~ + - Fn1 and Fn2 Layer: Fn+key gives ` + - Changes the two vertical keys under the knob as follows: - Base Layer: PGUP and PGDN - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) @@ -66,6 +70,4 @@ It seems Keychron has not pushed the relavant code to the main QMK repo yet. I s ## Changelog: v1.0.0 March 19, 2023 -- Carried over features from my Q1V2 keymap. - - \ No newline at end of file +- Carried over features from my Q1V2 keymap. \ No newline at end of file From ba0867ac52eb6c70792308a455dd6266adfc840d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 14:17:35 -0400 Subject: [PATCH 026/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index e92db616d8f7..8d4862d3e8d5 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -35,7 +35,7 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File -[https://drive.google.com/file/d/1aLno7NCXyGtsXduB4LRbHoctklYt4Psh/view?usp=share_link](keychron_q2_ansi_knob_configure_mkillewald.json) +[keychron_q2_ansi_knob_configure_mkillewald.json](https://drive.google.com/file/d/1aLno7NCXyGtsXduB4LRbHoctklYt4Psh/view?usp=share_link) I have included an optional .json configuration file which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: From b093da64a4b732e90157872b1ee78dd5fccfd167 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 14:20:20 -0400 Subject: [PATCH 027/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 8d4862d3e8d5..2d0dcaeebd82 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -35,7 +35,7 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File -[keychron_q2_ansi_knob_configure_mkillewald.json](https://drive.google.com/file/d/1aLno7NCXyGtsXduB4LRbHoctklYt4Psh/view?usp=share_link) +[keychron_q2_ansi_knob_configure_mkillewald.json](https://drive.google.com/file/d/1fCnly9thzn6KfIpd2yOrHi0w9CQgaIxn/view?usp=share_link) I have included an optional .json configuration file which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: From 4b3a7c850dc2b8630a1ff2283d55756aa1cb5b3d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 16:42:33 -0400 Subject: [PATCH 028/160] updated readme with new custom keycode identifiers --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 2d0dcaeebd82..8b1e6d7ad4da 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -24,10 +24,10 @@ - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color off) All custom keycodes described above can be moved to different keys in VIA by using the following keycodes: -- CUSTOM(11) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle -- CUSTOM(12) = LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle -- CUSTOM(13) = TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle -- CUSTOM(14) = FCTOG (default: Fn2+V) Fn layer Color Toggle +- CUSTOM(64) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle +- CUSTOM(67) = FCTOG (default: Fn2+V) Fn layer Color Toggle RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. From d6216d07f921830f73a21fe3dac9f3dae6daac64 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 18:25:17 -0400 Subject: [PATCH 029/160] Update keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md removed link to optional .json file Co-authored-by: Ryan --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 8b1e6d7ad4da..6a7e8331069d 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -35,7 +35,6 @@ Please make sure to save any customizations you have made in VIA to a .json file ## Optional .json Configuration File -[keychron_q2_ansi_knob_configure_mkillewald.json](https://drive.google.com/file/d/1fCnly9thzn6KfIpd2yOrHi0w9CQgaIxn/view?usp=share_link) I have included an optional .json configuration file which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: From 5cffea01a843a596b819500c857d5171c6789e50 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 18:26:01 -0400 Subject: [PATCH 030/160] hard coded layout changes previously provided by the optional .json file --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 70 +++++++++++-------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 4c714049d386..fc174d63c17d 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -37,47 +37,52 @@ enum my_keycodes { KC_LIGHT_TAB_TOGGLE = QK_USER_0, KC_LIGHT_ALPHAS_TOGGLE, KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE + KC_FN_LAYER_COLOR_TOGGLE, + KC_LOCK_BLANK_MAC }; #define KC_LTTOG KC_LIGHT_TAB_TOGGLE #define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE #define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE +#define KC_LBMAC KC_LOCK_BLANK_MAC const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), [WIN_BASE] = LAYOUT_ansi_67( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + // Mac Fn1 [_FN1] = LAYOUT_ansi_67( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, G(KC_0), + _______, KC_LBMAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_LEFT), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_RGHT), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + // Win Fn1 [_FN2] = LAYOUT_ansi_67( - KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, C(KC_0), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + // Combined Mac Win Fn2 [_FN3] = LAYOUT_ansi_67( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; @@ -88,9 +93,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [_FN1] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, - [_FN2] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, - [_FN3] = { ENCODER_CCW_CW(_______, _______) }, + [_FN1] = { ENCODER_CCW_CW(G(KC_MINS), G(KC_EQL)) }, + [_FN2] = { ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)) }, + [_FN3] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, }; #endif @@ -99,17 +104,17 @@ void housekeeping_task_user(void) { switch(bootloader_state) { case BOOTLOADER_DO: // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. + // so we can call the bootloader. reset_keyboard(); break; case BOOTLOADER_WAIT: // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my + // set flag to do bootloader at end of next frame. For some reason, my // Q2 needed this extra wait frame. bootloader_state = BOOTLOADER_DO; break; case BOOTLOADER_PRESSED: - // User pressed bootloader keycode and RGB was disabled earlier in this + // User pressed bootloader keycode and RGB was disabled earlier in this // frame. However RGB changes wont take place immediately, so we set a // flag here which will be caught at end of the next frame. bootloader_state = BOOTLOADER_WAIT; @@ -118,7 +123,7 @@ void housekeeping_task_user(void) { break; } #endif - + housekeeping_task_keychron(); } @@ -132,14 +137,14 @@ void keyboard_post_init_user(void) { user_config_read(); } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { case QK_BOOT: #ifdef RGB_MATRIX_ENABLE // We want to turn off LEDs before calling bootloader, so here // we call rgb_matrix_disable_noeeprom() and set a flag because - // the LEDs won't be updated until the next frame. + // the LEDs won't be updated until the next frame. rgb_matrix_disable_noeeprom(); bootloader_state = BOOTLOADER_PRESSED; return false; // Skip all further processing of this key @@ -148,7 +153,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_LIGHT_TAB_TOGGLE: if (record->event.pressed) { user_config_toggle_caps_lock_light_tab(); - } + } return false; // Skip all further processing of this key case KC_LIGHT_ALPHAS_TOGGLE: if (record->event.pressed) { @@ -164,7 +169,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { user_config_toggle_fn_layer_color_enable(); } - return false; // Skip all further processing of this key + return false; // Skip all further processing of this key + case KC_LOCK_BLANK_MAC: + if (record->event.pressed) { + send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); + } + return false; // Skip all further processing of this key default: return true; // Process all other keycodes normally } From 6664cd190538e9ef12c35ad7f1bf600d895d02e3 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 18:26:49 -0400 Subject: [PATCH 031/160] updated readme --- .../ansi_encoder/keymaps/mkillewald/readme.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 6a7e8331069d..0a1f50c387ee 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,7 +1,7 @@ -## Keychron Q2 ANSI STM32L432 ENC11 (with knob) Keymap v1.0.0 +## Keychron Q2 ANSI STM32L432 ENC11 (with knob) Keymap v1.0.1 ## Features: -- Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. +- Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. - Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) - Activated by double tapping left Shift @@ -23,20 +23,18 @@ - Fn2+C (keycode: TKTOG) will toggle turning off RGB for keys with no definition (default: RGB off) - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color off) -All custom keycodes described above can be moved to different keys in VIA by using the following keycodes: -- CUSTOM(64) = LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle -- CUSTOM(65) = LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle -- CUSTOM(66) = TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle -- CUSTOM(67) = FCTOG (default: Fn2+V) Fn layer Color Toggle +All custom keycodes described in this readme can be moved to different keys in VIA by using the following keycodes: +- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. -## Optional .json Configuration File - - -I have included an optional .json configuration file which can be loaded in VIA on the Configure Tab (keyboard icon) to make the following layout changes: +## This keymap also makes the following layout changes over the factory firmware. - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) @@ -44,7 +42,8 @@ I have included an optional .json configuration file which can be loaded in VIA - Uses Grave Escape on key to the left of the 1 key: - Base Layer: key functions as ESC, shift+key gives ~ - - Fn1 and Fn2 Layer: Fn+key gives ` + - Fn1 Layer: Fn1+key gives ` + - Fn2 Layer: Fn2+key gives ~ - Changes the two vertical keys under the knob as follows: - Base Layer: PGUP and PGDN @@ -55,18 +54,22 @@ I have included an optional .json configuration file which can be loaded in VIA - Base Layer: volume up, down Press: mute - Fn1 Layer: zoom in, out Press: return to 100% zoom - Fn2 Layer: LED brighness inc, dec Press: backlight toggle - + ## Known Issues -1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working +1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working 2. Keychron LED test Fn1+Home+Right is not working It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. - + #### USE AT YOUR OWN RISK ## Changelog: -v1.0.0 March 19, 2023 +v1.0.1 April 4, 2023 +- made requested changes by QMK reveiwers +- removed optional .json file and baked my layout changes into the firmware + +v1.0.0 March 19, 2023 - Carried over features from my Q1V2 keymap. \ No newline at end of file From 91b96c274cd7c572a53d77f09d347fc42599078e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 18:29:06 -0400 Subject: [PATCH 032/160] removed period --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 0a1f50c387ee..a15c4f1a49b2 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -34,7 +34,7 @@ RGB must be toggled on for all indicators to function. If you do not want an RGB Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. -## This keymap also makes the following layout changes over the factory firmware. +## This keymap also makes the following layout changes over the factory firmware - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) From 4d38e3ab149880f32d6063b0fb02e7ca4bd96629 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 21:07:44 -0400 Subject: [PATCH 033/160] initial commit --- .../q2/ansi_encoder/keymaps/mkillewald/config.h | 2 ++ .../keymaps/mkillewald/rgb_matrix_user.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 430e0b89d6b0..7e7c1aa69076 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -23,6 +23,8 @@ #endif #ifdef RGB_MATRIX_ENABLE +# define HUE_MAC_BASE 170 // HSV blue hue component +# define HUE_WIN_BASE 80 // HSV green hue component # define CAPS_LOCK_INDICATOR_COLOR RGB_RED # define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 # define FN2_LAYER_COLOR RGB_GREEN diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 32f52f2ca02a..54588e2570f6 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -21,6 +21,7 @@ #include "keymap_user_config.h" keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; +static bool win_mode; void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { @@ -33,11 +34,27 @@ void rgb_matrix_init_user(void) { } } +bool dip_switch_update_user(uint8_t index, bool active) { + if(index == 0 && active) { + win_mode = true; + } else { + win_mode = false; + } + return true; +} + bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { uint8_t current_layer = get_highest_layer(layer_state); switch (current_layer) { case MAC_BASE: case WIN_BASE: +#if defined HUE_WIN_BASE && defined HUE_MAC_BASE + if (win_mode) { + rgb_matrix_sethsv_noeeprom(HUE_WIN_BASE, rgb_matrix_get_sat(), rgb_matrix_get_val()); + } else { + rgb_matrix_sethsv_noeeprom(HUE_MAC_BASE, rgb_matrix_get_sat(), rgb_matrix_get_val()); + } +#endif #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); From 4598e1f3992c6f6eaaa55f255e2b41cba18106d1 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 21:11:54 -0400 Subject: [PATCH 034/160] added QK_BOOT to Fn2+BKSP --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index fc174d63c17d..be5869e774f2 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -80,7 +80,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Combined Mac Win Fn2 [_FN3] = LAYOUT_ansi_67( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, RGB_TOG, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, From 77601dde6702c92d6103fb97d3b321049231878b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 21:18:15 -0400 Subject: [PATCH 035/160] change Fn2 layer to yellow --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 7e7c1aa69076..bcd0b19e70c5 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -27,5 +27,5 @@ # define HUE_WIN_BASE 80 // HSV green hue component # define CAPS_LOCK_INDICATOR_COLOR RGB_RED # define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 -# define FN2_LAYER_COLOR RGB_GREEN +# define FN2_LAYER_COLOR RGB_YELLOW #endif \ No newline at end of file From bac629c51c2dc572ad5080f57c4c68d761a6ea3b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 21:36:05 -0400 Subject: [PATCH 036/160] added my shortcuts for display rotation --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index be5869e774f2..8f1624dfa937 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -64,11 +64,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Mac Fn1 [_FN1] = LAYOUT_ansi_67( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, G(KC_0), - _______, KC_LBMAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_LEFT), - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_RGHT), - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, G(KC_0), + _______, KC_LBMAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_LEFT), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_RGHT), + _______, _______, _______, _______, _______, _______, _______, _______, LCAG(KC_W), LCAG(KC_D), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), // Win Fn1 [_FN2] = LAYOUT_ansi_67( @@ -80,11 +80,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Combined Mac Win Fn2 [_FN3] = LAYOUT_ansi_67( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, RGB_TOG, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, - _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; // clang-format on From ed173ef8274170b57fc68b5c3efc12492da9b87c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 21:36:15 -0400 Subject: [PATCH 037/160] updated readme --- .../q2/ansi_encoder/keymaps/mkillewald/readme.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index a15c4f1a49b2..0df24e74b043 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,8 +1,14 @@ ## Keychron Q2 ANSI STM32L432 ENC11 (with knob) Keymap v1.0.1 +## This is my personal build with custom layout changes and different base layer LED colors + ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. +- Different hues set for Mac Base and Win Base layers in config.h + - Set Mac Base hue using HUE_MAC_BASE in config.h + - Set Win Base hue using HUE_WIN_BASE in config.h + - Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) - Activated by double tapping left Shift - can change activation to tapping both left and right Shift by replacing define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD with #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD in config.h @@ -40,6 +46,12 @@ Please make sure to save any customizations you have made in VIA to a .json file - Fn1+Q in Mac mode will lock and sleep display +- Mac mode + - Fn1+< sets my secondary display to 0° rotation + - Fn1+> sets my secondary display to 90° rotation + +- Fn2+Backspace enters DFU mode (but does not reset eeprom) + - Uses Grave Escape on key to the left of the 1 key: - Base Layer: key functions as ESC, shift+key gives ~ - Fn1 Layer: Fn1+key gives ` From 05625b01417540634e1edf680a5d58f3c24a430c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 21:38:58 -0400 Subject: [PATCH 038/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 0df24e74b043..86f7ff587705 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -44,9 +44,8 @@ Please make sure to save any customizations you have made in VIA to a .json file - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) -- Fn1+Q in Mac mode will lock and sleep display - - Mac mode + - Fn1+Q will lock and sleep display - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation @@ -80,6 +79,7 @@ It seems Keychron has not pushed the relavant code to the main QMK repo yet. I s ## Changelog: v1.0.1 April 4, 2023 +- added different hue for Mac Base and Win Base layers - made requested changes by QMK reveiwers - removed optional .json file and baked my layout changes into the firmware From a10d6590569b804b48ca63542c18e1ed30a87dcf Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 4 Apr 2023 23:26:06 -0400 Subject: [PATCH 039/160] reduced if/else to one line --- .../q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 54588e2570f6..f6997df0d804 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -35,11 +35,7 @@ void rgb_matrix_init_user(void) { } bool dip_switch_update_user(uint8_t index, bool active) { - if(index == 0 && active) { - win_mode = true; - } else { - win_mode = false; - } + win_mode = (index == 0 && active ? true : false); return true; } From 2b4506778b5b0242fc31c31216133b1d0e1ad2fa Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 5 Apr 2023 06:43:02 -0400 Subject: [PATCH 040/160] enabled auto-correct --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c | 2 +- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 8f1624dfa937..90efeccd8544 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -83,7 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, RGB_TOG, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, - _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, + AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk index 3ebb5793fa51..b54f6bf491b3 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk @@ -1,6 +1,7 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes +AUTOCORRECT_ENABLE = yes SRC += keymap_user_config.c From 0f092918b272b14581ee78178004dfeb60f1c6c6 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 5 Apr 2023 15:18:42 -0400 Subject: [PATCH 041/160] using getreuer's 400-entry autocorrection dictionary data --- .../keymaps/mkillewald/autocorrect_data.h | 809 ++++++++++++++++++ .../mkillewald/autocorrection_dict_extra.txt | 473 ++++++++++ 2 files changed, 1282 insertions(+) create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrect_data.h create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrect_data.h new file mode 100644 index 000000000000..ff25efaf6cba --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrect_data.h @@ -0,0 +1,809 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once + +// Autocorrection dictionary (400 entries): +// :htere -> there +// abbout -> about +// abotu -> about +// baout -> about +// :theri -> their +// :thier -> their +// :owudl -> would +// woudl -> would +// peaple -> people +// peolpe -> people +// peopel -> people +// poeple -> people +// poeople -> people +// :hwihc -> which +// whcih -> which +// whihc -> which +// whlch -> which +// wihch -> which +// coudl -> could +// :htikn -> think +// :htink -> think +// thikn -> think +// thiunk -> think +// tihkn -> think +// :olther -> other +// :otehr -> other +// baceause -> because +// beacuse -> because +// becasue -> because +// beccause -> because +// becouse -> because +// becuase -> because +// theese -> these +// :goign -> going +// :gonig -> going +// :yaers -> years +// :yeasr -> years +// :thsoe -> those +// shoudl -> should +// raelly -> really +// realy -> really +// relaly -> really +// bedore -> before +// befoer -> before +// littel -> little +// beeing -> being +// :hwile -> while +// aroud -> around +// arround -> around +// arund -> around +// thign -> thing +// thigsn -> things +// thnigs -> things +// anohter -> another +// beteen -> between +// beween -> between +// bewteen -> between +// :eveyr -> every +// :graet -> great +// :agian -> again +// :sicne -> since +// alwasy -> always +// alwyas -> always +// throught -> thought +// :acheiv -> achiev +// almsot -> almost +// alomst -> almost +// chnage -> change +// chekc -> check +// childen -> children +// claer -> clear +// comapny -> company +// contian -> contain +// elasped -> elapsed +// feild -> field +// fitler -> filter +// firts -> first +// follwo -> follow +// :foudn -> found +// frequecy -> frequency +// firend -> friend +// freind -> friend +// heigth -> height +// iamge -> image +// inital -> initial +// intput -> input +// laguage -> language +// lenght -> length +// levle -> level +// libary -> library +// :moeny -> money +// mysefl -> myself +// ouptut -> output +// ouput -> output +// probaly -> probably +// probelm -> problem +// recrod -> record +// reponse -> response +// reprot -> report +// singel -> single +// stregth -> strength +// strengh -> strength +// tkaes -> takes +// therfore -> therefore +// todya -> today +// toghether -> together +// unkown -> unknown +// unqiue -> unique +// widht -> width +// aberation -> aberration +// accross -> across +// adviced -> advised +// aledge -> allege +// alledge -> allege +// amature -> amateur +// anomolous -> anomalous +// anomoly -> anomaly +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// asthetic -> aesthetic +// auxilary -> auxiliary +// auxillary -> auxiliary +// auxilliary -> auxiliary +// bankrupcy -> bankruptcy +// busness -> business +// bussiness -> business +// calander -> calendar +// commitee -> committee +// comittee -> committee +// competance -> competence +// competant -> competent +// concensus -> consensus +// cognizent -> cognizant +// copywrite: -> copyright +// choosen -> chosen +// collegue -> colleague +// excercise -> exercise +// :grammer -> grammar +// :guage -> gauge +// govement -> government +// govenment -> government +// goverment -> government +// governmnet -> government +// govorment -> government +// govornment -> government +// guaratee -> guarantee +// garantee -> guarantee +// gaurantee -> guarantee +// heirarchy -> hierarchy +// hygeine -> hygiene +// hypocracy -> hypocrisy +// hypocrasy -> hypocrisy +// hypocricy -> hypocrisy +// hypocrit: -> hypocrite +// looses: -> loses +// maintence -> maintenance +// morgage -> mortgage +// neccesary -> necessary +// necesary -> necessary +// pallete -> palette +// paralel -> parallel +// parralel -> parallel +// parrallel -> parallel +// priviledge -> privilege +// probablly -> probably +// prominant -> prominent +// propogate -> propagate +// proove -> prove +// psuedo -> pseudo +// reciept -> receipt +// receiev -> receiv +// reciev -> receiv +// recepient -> recipient +// recipiant -> recipient +// relevent -> relevant +// repitition -> repetition +// safty -> safety +// saftey -> safety +// seperat -> separat +// spectogram -> spectrogram +// symetric -> symmetric +// tolerence -> tolerance +// cacheing -> caching +// complier -> compiler +// doulbe -> double +// dyanmic -> dynamic +// excecut -> execut +// failse -> false +// fales -> false +// fasle -> false +// flase -> false +// indeces -> indices +// indecies -> indices +// indicies -> indices +// interator -> iterator +// looup -> lookup +// namesapce -> namespace +// namespcae -> namespace +// nulltpr -> nullptr +// operaotr -> operator +// overide -> override +// ovveride -> override +// poitner -> pointer +// :rference -> reference +// referece -> reference +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// teamplate -> template +// tempalte -> template +// :ture -> true +// retrun -> return +// retun -> return +// reutrn -> return +// cosnt -> const +// virutal -> virtual +// vitual -> virtual +// yeild -> yield +// :alot: -> a lot +// :andteh -> and the +// :andthe -> and the +// :asthe -> as the +// :atthe -> at the +// abouta -> about a +// aboutit -> about it +// aboutthe -> about the +// :tothe -> to the +// didnot -> did not +// fromthe -> from the +// :agred -> agreed +// :ajust -> adjust +// :anual -> annual +// :asign -> assign +// :aslo: -> also +// :casue -> cause +// :choses -> chooses +// :gaurd -> guard +// :haev -> have +// :hapen -> happen +// :idaes -> ideas +// :jsut: -> just +// :jstu: -> just +// :knwo -> know +// :konw -> know +// :kwno -> know +// :ocuntry -> country +// :ocur -> occur +// :socre -> score +// :szie -> size +// :the:the: -> the +// :turth -> truth +// :uesd: -> used +// :usally -> usually +// abilties -> abilities +// abilty -> ability +// abvove -> above +// accesories -> accessories +// accomodate -> accommodate +// acommodate -> accommodate +// acomplish -> accomplish +// actualy -> actually +// acurate -> accurate +// acutally -> actually +// addtion -> addition +// againnst -> against +// aganist -> against +// aggreed -> agreed +// agianst -> against +// ahppn -> happen +// allign -> align +// anytying -> anything +// aquire -> acquire +// availabe -> available +// availaible -> available +// availalbe -> available +// availble -> available +// availiable -> available +// avalable -> available +// avaliable -> available +// avilable -> available +// bandwith -> bandwidth +// begginer -> beginner +// beleif -> belief +// beleive -> believe +// belive -> believe +// breif -> brief +// burried -> buried +// caluclate -> calculate +// caluculate -> calculate +// calulate -> calculate +// catagory -> category +// cauhgt -> caught +// ceratin -> certain +// certian -> certain +// cheif -> chief +// cieling -> ceiling +// circut -> circuit +// clasic -> classic +// cmoputer -> computer +// coform -> conform +// comming: -> coming +// considerd -> considered +// dervied -> derived +// desicion -> decision +// diferent -> different +// diferrent -> different +// differnt -> different +// diffrent -> different +// divison -> division +// effecient -> efficient +// eligable -> eligible +// elpased -> elapsed +// embarass -> embarrass +// embeded -> embedded +// encypt -> encrypt +// finaly -> finally +// foriegn -> foreign +// foward -> forward +// fraciton -> fraction +// fucntion -> function +// fufill -> fulfill +// fullfill -> fulfill +// futher -> further +// ganerate -> generate +// generaly -> generally +// greatful -> grateful +// heigher -> higher +// higest -> highest +// howver -> however +// hydogen -> hydrogen +// importamt -> important +// inclued -> include +// insted -> instead +// intrest -> interest +// invliad -> invalid +// largst -> largest +// learnign -> learning +// liasion -> liaison +// likly -> likely +// lisense -> license +// listner -> listener +// macthing -> matching +// manefist -> manifest +// mesage -> message +// naturual -> natural +// occassion -> occasion +// occured -> occurred +// particualr -> particular +// paticular -> particular +// peice -> piece +// perhasp -> perhaps +// perheaps -> perhaps +// perhpas -> perhaps +// perphas -> perhaps +// persue -> pursue +// posess -> possess +// postion -> position +// preiod -> period +// primarly -> primarily +// privte -> private +// proccess -> process +// proeprty -> property +// propery -> property +// realtion -> relation +// reasearch -> research +// recuring -> recurring +// refered -> referred +// regluar -> regular +// releated -> related +// resutl -> result +// reuslt -> result +// reveiw -> review +// satisifed -> satisfied +// scheduel -> schedule +// sequnce -> sequence +// similiar -> similar +// simmilar -> similar +// slighly -> slightly +// somehwat -> somewhat +// statment -> statement +// sucess -> success +// succsess -> success +// sugest -> suggest +// sumary -> summary +// supress -> suppress +// surpress -> suppress +// thresold -> threshold +// tongiht -> tonight +// tranpose -> transpose +// typcial -> typical +// udpate -> update +// ususally -> usually +// verticies -> vertices +// whereever -> wherever +// wherre -> where +// wierd -> weird + +#define AUTOCORRECT_MIN_LENGTH 5 // "abotu" +#define AUTOCORRECT_MAX_LENGTH 10 // "auxilliary" +#define DICTIONARY_SIZE 5967 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { + 0x6C, 0x43, 0x00, 0x04, 0xD4, 0x00, 0x06, 0xEC, 0x00, 0x07, 0x64, 0x01, 0x08, 0x0F, 0x03, 0x09, + 0xA9, 0x08, 0x0A, 0xCC, 0x08, 0x0B, 0x44, 0x09, 0x0C, 0xF6, 0x09, 0x0E, 0x00, 0x0A, 0x0F, 0x1C, + 0x0A, 0x10, 0x4F, 0x0B, 0x11, 0x81, 0x0B, 0x12, 0xAF, 0x0D, 0x13, 0xE3, 0x0D, 0x15, 0xFD, 0x0D, + 0x16, 0xC2, 0x0F, 0x17, 0x79, 0x11, 0x18, 0xC9, 0x14, 0x19, 0xD2, 0x14, 0x1A, 0x08, 0x15, 0x1C, + 0x22, 0x15, 0x00, 0x47, 0x59, 0x00, 0x08, 0x63, 0x00, 0x0A, 0x82, 0x00, 0x12, 0x8E, 0x00, 0x16, + 0x98, 0x00, 0x17, 0xA3, 0x00, 0x18, 0xCA, 0x00, 0x00, 0x16, 0x08, 0x18, 0x2C, 0x00, 0x83, 0x73, + 0x65, 0x64, 0x00, 0x4B, 0x6A, 0x00, 0x17, 0x73, 0x00, 0x00, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, + 0x00, 0x84, 0x00, 0x0C, 0x15, 0x1A, 0x1C, 0x13, 0x12, 0x06, 0x00, 0x85, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x00, 0x11, 0x0C, 0x10, 0x10, 0x12, 0x06, 0x00, 0x84, 0x69, 0x6E, 0x67, 0x00, 0x0F, 0x16, + 0x04, 0x2C, 0x00, 0x83, 0x6C, 0x73, 0x6F, 0x00, 0x08, 0x16, 0x12, 0x12, 0x0F, 0x00, 0x84, 0x73, + 0x65, 0x73, 0x00, 0x4C, 0xAD, 0x00, 0x12, 0xB7, 0x00, 0x18, 0xC1, 0x00, 0x00, 0x15, 0x06, 0x12, + 0x13, 0x1C, 0x0B, 0x00, 0x80, 0x65, 0x00, 0x0F, 0x04, 0x2C, 0x00, 0x83, 0x20, 0x6C, 0x6F, 0x74, + 0x00, 0x16, 0x0D, 0x2C, 0x00, 0x83, 0x75, 0x73, 0x74, 0x00, 0x17, 0x16, 0x0D, 0x2C, 0x00, 0x83, + 0x75, 0x73, 0x74, 0x00, 0x57, 0xDB, 0x00, 0x1C, 0xE4, 0x00, 0x00, 0x18, 0x12, 0x05, 0x04, 0x00, + 0x80, 0x20, 0x61, 0x00, 0x07, 0x12, 0x17, 0x00, 0x81, 0x61, 0x79, 0x00, 0x4B, 0xF6, 0x00, 0x0C, + 0x1C, 0x01, 0x0E, 0x5C, 0x01, 0x00, 0x4C, 0xFD, 0x00, 0x17, 0x14, 0x01, 0x00, 0x4B, 0x04, 0x01, + 0x1A, 0x0A, 0x01, 0x00, 0x1A, 0x00, 0x81, 0x63, 0x68, 0x00, 0x0B, 0x2C, 0x00, 0x84, 0x77, 0x68, + 0x69, 0x63, 0x68, 0x00, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, 0x00, 0x50, 0x29, 0x01, 0x15, + 0x35, 0x01, 0x16, 0x43, 0x01, 0x17, 0x4C, 0x01, 0x00, 0x11, 0x04, 0x1C, 0x07, 0x00, 0x84, 0x6E, + 0x61, 0x6D, 0x69, 0x63, 0x00, 0x17, 0x08, 0x10, 0x1C, 0x16, 0x00, 0x84, 0x6D, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x00, 0x04, 0x0F, 0x06, 0x00, 0x81, 0x73, 0x69, 0x63, 0x00, 0x08, 0x0B, 0x17, 0x16, + 0x04, 0x00, 0x86, 0x65, 0x73, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x00, 0x08, 0x0B, 0x06, 0x00, + 0x81, 0x63, 0x6B, 0x00, 0x44, 0x7A, 0x01, 0x08, 0x86, 0x01, 0x0F, 0x54, 0x02, 0x11, 0x7C, 0x02, + 0x12, 0xB4, 0x02, 0x15, 0xCF, 0x02, 0x18, 0x07, 0x03, 0x00, 0x0C, 0x0F, 0x19, 0x11, 0x0C, 0x00, + 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x46, 0xA8, 0x01, 0x07, 0xB2, 0x01, 0x08, 0xBC, 0x01, 0x09, + 0xC7, 0x01, 0x0A, 0xD4, 0x01, 0x0C, 0xDE, 0x01, 0x13, 0xF8, 0x01, 0x15, 0x03, 0x02, 0x16, 0x26, + 0x02, 0x17, 0x32, 0x02, 0x18, 0x4B, 0x02, 0x00, 0x0C, 0x19, 0x07, 0x04, 0x00, 0x82, 0x73, 0x65, + 0x64, 0x00, 0x08, 0x05, 0x10, 0x08, 0x00, 0x81, 0x64, 0x65, 0x64, 0x00, 0x15, 0x0A, 0x0A, 0x04, + 0x00, 0x84, 0x72, 0x65, 0x65, 0x64, 0x00, 0x0C, 0x16, 0x0C, 0x17, 0x04, 0x16, 0x00, 0x83, 0x66, + 0x69, 0x65, 0x64, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, 0x00, 0x55, 0xE5, + 0x01, 0x19, 0xEE, 0x01, 0x00, 0x15, 0x18, 0x05, 0x00, 0x83, 0x69, 0x65, 0x64, 0x00, 0x15, 0x08, + 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x16, 0x04, 0x0F, 0x08, 0x00, 0x83, 0x70, 0x73, + 0x65, 0x64, 0x00, 0x48, 0x0D, 0x02, 0x0A, 0x16, 0x02, 0x18, 0x1D, 0x02, 0x00, 0x09, 0x08, 0x15, + 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x04, 0x2C, 0x00, 0x80, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, + 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x04, 0x13, 0x0F, 0x08, 0x00, 0x84, 0x61, 0x70, 0x73, 0x65, + 0x64, 0x00, 0x44, 0x39, 0x02, 0x16, 0x44, 0x02, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x84, 0x61, + 0x74, 0x65, 0x64, 0x00, 0x11, 0x0C, 0x00, 0x80, 0x61, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, + 0x81, 0x64, 0x65, 0x00, 0x4C, 0x5B, 0x02, 0x12, 0x70, 0x02, 0x00, 0x08, 0x00, 0x49, 0x64, 0x02, + 0x1C, 0x6A, 0x02, 0x00, 0x83, 0x69, 0x65, 0x6C, 0x64, 0x00, 0x83, 0x69, 0x65, 0x6C, 0x64, 0x00, + 0x16, 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x48, 0x86, 0x02, 0x0C, + 0x91, 0x02, 0x18, 0x9B, 0x02, 0x00, 0x15, 0x0C, 0x09, 0x00, 0x84, 0x72, 0x69, 0x65, 0x6E, 0x64, + 0x00, 0x08, 0x15, 0x09, 0x00, 0x83, 0x69, 0x65, 0x6E, 0x64, 0x00, 0x52, 0xA2, 0x02, 0x15, 0xAC, + 0x02, 0x00, 0x15, 0x15, 0x04, 0x00, 0x84, 0x6F, 0x75, 0x6E, 0x64, 0x00, 0x04, 0x00, 0x82, 0x6F, + 0x75, 0x6E, 0x64, 0x00, 0x4C, 0xBB, 0x02, 0x15, 0xC6, 0x02, 0x00, 0x08, 0x15, 0x13, 0x00, 0x84, + 0x65, 0x72, 0x69, 0x6F, 0x64, 0x00, 0x06, 0x08, 0x15, 0x00, 0x82, 0x6F, 0x72, 0x64, 0x00, 0x44, + 0xD9, 0x02, 0x08, 0xE4, 0x02, 0x18, 0xFD, 0x02, 0x00, 0x1A, 0x12, 0x09, 0x00, 0x83, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x00, 0x47, 0xEB, 0x02, 0x0C, 0xF5, 0x02, 0x00, 0x0C, 0x16, 0x11, 0x12, 0x06, + 0x00, 0x80, 0x65, 0x64, 0x00, 0x1A, 0x00, 0x83, 0x65, 0x69, 0x72, 0x64, 0x00, 0x04, 0x0A, 0x2C, + 0x00, 0x83, 0x75, 0x61, 0x72, 0x64, 0x00, 0x12, 0x15, 0x04, 0x00, 0x80, 0x6E, 0x64, 0x00, 0x44, + 0x43, 0x03, 0x05, 0x50, 0x03, 0x06, 0x7B, 0x03, 0x07, 0xFB, 0x03, 0x08, 0x17, 0x04, 0x0A, 0x6B, + 0x04, 0x0B, 0xE3, 0x04, 0x0C, 0x34, 0x05, 0x0F, 0x3D, 0x05, 0x11, 0x00, 0x06, 0x12, 0x1B, 0x06, + 0x13, 0x25, 0x06, 0x15, 0x2F, 0x06, 0x16, 0x9C, 0x06, 0x17, 0x52, 0x07, 0x18, 0x2D, 0x08, 0x19, + 0x73, 0x08, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, + 0x44, 0x57, 0x03, 0x0F, 0x61, 0x03, 0x00, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x80, 0x6C, 0x65, + 0x00, 0x44, 0x68, 0x03, 0x18, 0x73, 0x03, 0x00, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x82, 0x62, + 0x6C, 0x65, 0x00, 0x12, 0x07, 0x00, 0x82, 0x62, 0x6C, 0x65, 0x00, 0x48, 0x88, 0x03, 0x0C, 0x93, + 0x03, 0x11, 0x9C, 0x03, 0x13, 0xEE, 0x03, 0x00, 0x15, 0x08, 0x09, 0x08, 0x15, 0x00, 0x81, 0x6E, + 0x63, 0x65, 0x00, 0x08, 0x13, 0x00, 0x83, 0x69, 0x65, 0x63, 0x65, 0x00, 0x44, 0xA6, 0x03, 0x08, + 0xB3, 0x03, 0x18, 0xE4, 0x03, 0x00, 0x17, 0x08, 0x13, 0x10, 0x12, 0x06, 0x00, 0x83, 0x65, 0x6E, + 0x63, 0x65, 0x00, 0x55, 0xBA, 0x03, 0x17, 0xD9, 0x03, 0x00, 0x08, 0x00, 0x49, 0xC3, 0x03, 0x0F, + 0xD0, 0x03, 0x00, 0x15, 0x2C, 0x00, 0x86, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x63, 0x65, 0x00, + 0x12, 0x17, 0x00, 0x83, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x11, 0x0C, 0x04, 0x10, 0x00, 0x81, 0x61, + 0x6E, 0x63, 0x65, 0x00, 0x14, 0x08, 0x16, 0x00, 0x82, 0x65, 0x6E, 0x63, 0x65, 0x00, 0x04, 0x16, + 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x00, + 0x52, 0x07, 0x04, 0x19, 0x0D, 0x04, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, 0x12, 0x00, 0x85, + 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x00, 0x17, 0x00, 0x44, 0x26, 0x04, 0x0C, 0x31, 0x04, 0x11, + 0x3B, 0x04, 0x17, 0x5E, 0x04, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, 0x74, 0x65, 0x65, + 0x00, 0x10, 0x10, 0x12, 0x06, 0x00, 0x81, 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x00, 0x44, 0x45, + 0x04, 0x18, 0x51, 0x04, 0x00, 0x0A, 0x00, 0x86, 0x75, 0x61, 0x72, 0x61, 0x6E, 0x74, 0x65, 0x65, + 0x00, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, 0x74, 0x65, 0x65, 0x00, 0x0C, 0x10, + 0x12, 0x06, 0x00, 0x84, 0x6D, 0x69, 0x74, 0x74, 0x65, 0x65, 0x00, 0x44, 0x75, 0x04, 0x07, 0xB8, + 0x04, 0x10, 0xDA, 0x04, 0x00, 0x4A, 0x82, 0x04, 0x11, 0x8D, 0x04, 0x16, 0x96, 0x04, 0x18, 0x9F, + 0x04, 0x00, 0x15, 0x12, 0x10, 0x00, 0x83, 0x74, 0x67, 0x61, 0x67, 0x65, 0x00, 0x0B, 0x06, 0x00, + 0x83, 0x61, 0x6E, 0x67, 0x65, 0x00, 0x08, 0x10, 0x00, 0x82, 0x73, 0x61, 0x67, 0x65, 0x00, 0x0A, + 0x00, 0x6C, 0xA8, 0x04, 0x04, 0xAE, 0x04, 0x00, 0x83, 0x61, 0x75, 0x67, 0x65, 0x00, 0x0F, 0x00, + 0x84, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x00, 0x44, 0xC5, 0x04, 0x0C, 0xCB, + 0x04, 0x0F, 0xD4, 0x04, 0x00, 0x83, 0x6C, 0x65, 0x67, 0x65, 0x00, 0x19, 0x0C, 0x15, 0x13, 0x00, + 0x82, 0x67, 0x65, 0x00, 0x04, 0x00, 0x82, 0x67, 0x65, 0x00, 0x04, 0x0C, 0x00, 0x83, 0x6D, 0x61, + 0x67, 0x65, 0x00, 0x17, 0x00, 0x47, 0xF5, 0x04, 0x10, 0xFF, 0x04, 0x12, 0x09, 0x05, 0x16, 0x12, + 0x05, 0x17, 0x1B, 0x05, 0x00, 0x11, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x12, + 0x15, 0x09, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x17, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, + 0x65, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x44, 0x22, 0x05, 0x18, 0x2A, + 0x05, 0x00, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x12, 0x05, 0x04, 0x00, 0x82, 0x20, + 0x74, 0x68, 0x65, 0x00, 0x1D, 0x16, 0x2C, 0x00, 0x82, 0x69, 0x7A, 0x65, 0x00, 0x45, 0x4D, 0x05, + 0x0C, 0xBE, 0x05, 0x13, 0xC9, 0x05, 0x16, 0xF1, 0x05, 0x19, 0xF9, 0x05, 0x00, 0x44, 0x57, 0x05, + 0x0C, 0xA7, 0x05, 0x0F, 0xB3, 0x05, 0x00, 0x4A, 0x61, 0x05, 0x0C, 0x6B, 0x05, 0x0F, 0x89, 0x05, + 0x00, 0x0C, 0x0F, 0x08, 0x00, 0x83, 0x69, 0x62, 0x6C, 0x65, 0x00, 0x0F, 0x00, 0x44, 0x74, 0x05, + 0x0C, 0x7F, 0x05, 0x00, 0x19, 0x04, 0x00, 0x85, 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x04, + 0x19, 0x04, 0x00, 0x84, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x44, 0x90, 0x05, 0x0C, 0x9B, 0x05, 0x00, + 0x19, 0x04, 0x00, 0x84, 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x19, 0x04, 0x00, 0x85, 0x61, + 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x04, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x83, 0x62, + 0x6C, 0x65, 0x00, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x82, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x1A, 0x0B, + 0x2C, 0x00, 0x84, 0x77, 0x68, 0x69, 0x6C, 0x65, 0x00, 0x44, 0xD3, 0x05, 0x08, 0xDC, 0x05, 0x12, + 0xE6, 0x05, 0x00, 0x08, 0x13, 0x00, 0x83, 0x6F, 0x70, 0x6C, 0x65, 0x00, 0x12, 0x13, 0x00, 0x84, + 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x00, 0x08, 0x12, 0x13, 0x00, 0x85, 0x65, 0x6F, 0x70, 0x6C, 0x65, + 0x00, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x08, 0x0F, 0x00, 0x81, 0x65, 0x6C, 0x00, + 0x46, 0x07, 0x06, 0x0C, 0x10, 0x06, 0x00, 0x0C, 0x16, 0x2C, 0x00, 0x82, 0x6E, 0x63, 0x65, 0x00, + 0x08, 0x0A, 0x1C, 0x0B, 0x00, 0x83, 0x69, 0x65, 0x6E, 0x65, 0x00, 0x16, 0x0B, 0x17, 0x2C, 0x00, + 0x82, 0x6F, 0x73, 0x65, 0x00, 0x0F, 0x12, 0x08, 0x13, 0x00, 0x82, 0x70, 0x6C, 0x65, 0x00, 0x46, + 0x42, 0x06, 0x08, 0x4C, 0x06, 0x0C, 0x57, 0x06, 0x12, 0x63, 0x06, 0x15, 0x7F, 0x06, 0x18, 0x86, + 0x06, 0x00, 0x12, 0x16, 0x2C, 0x00, 0x83, 0x63, 0x6F, 0x72, 0x65, 0x00, 0x17, 0x0B, 0x2C, 0x00, + 0x84, 0x74, 0x68, 0x65, 0x72, 0x65, 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x00, 0x47, 0x6A, 0x06, 0x09, 0x73, 0x06, 0x00, 0x08, 0x05, 0x00, 0x83, 0x66, 0x6F, + 0x72, 0x65, 0x00, 0x15, 0x08, 0x0B, 0x17, 0x00, 0x83, 0x65, 0x66, 0x6F, 0x72, 0x65, 0x00, 0x08, + 0x0B, 0x1A, 0x00, 0x81, 0x65, 0x00, 0x17, 0x00, 0x6C, 0x8F, 0x06, 0x04, 0x94, 0x06, 0x00, 0x82, + 0x72, 0x75, 0x65, 0x00, 0x10, 0x04, 0x00, 0x82, 0x65, 0x75, 0x72, 0x00, 0x44, 0xB2, 0x06, 0x08, + 0xCB, 0x06, 0x0C, 0xD3, 0x06, 0x0F, 0xE2, 0x06, 0x11, 0xEB, 0x06, 0x12, 0x09, 0x07, 0x18, 0x16, + 0x07, 0x00, 0x4F, 0xB9, 0x06, 0x18, 0xC1, 0x06, 0x00, 0x09, 0x00, 0x83, 0x61, 0x6C, 0x73, 0x65, + 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, 0x08, 0x0B, 0x17, 0x00, 0x82, + 0x73, 0x65, 0x00, 0x06, 0x15, 0x08, 0x06, 0x1B, 0x08, 0x00, 0x86, 0x65, 0x72, 0x63, 0x69, 0x73, + 0x65, 0x00, 0x0C, 0x04, 0x09, 0x00, 0x83, 0x6C, 0x73, 0x65, 0x00, 0x48, 0xF2, 0x06, 0x12, 0xFD, + 0x06, 0x00, 0x16, 0x0C, 0x0F, 0x00, 0x84, 0x63, 0x65, 0x6E, 0x73, 0x65, 0x00, 0x13, 0x08, 0x15, + 0x00, 0x84, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x00, 0x13, 0x11, 0x04, 0x15, 0x17, 0x00, 0x83, + 0x73, 0x70, 0x6F, 0x73, 0x65, 0x00, 0x44, 0x20, 0x07, 0x06, 0x3D, 0x07, 0x12, 0x48, 0x07, 0x00, + 0x46, 0x27, 0x07, 0x08, 0x31, 0x07, 0x00, 0x06, 0x08, 0x05, 0x00, 0x84, 0x61, 0x75, 0x73, 0x65, + 0x00, 0x06, 0x04, 0x05, 0x00, 0x86, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x00, 0x04, 0x08, 0x05, + 0x00, 0x84, 0x63, 0x61, 0x75, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, + 0x65, 0x00, 0x44, 0x5F, 0x07, 0x08, 0x0D, 0x08, 0x0F, 0x18, 0x08, 0x19, 0x24, 0x08, 0x00, 0x47, + 0x6F, 0x07, 0x0A, 0x94, 0x07, 0x0F, 0xA1, 0x07, 0x13, 0xE4, 0x07, 0x15, 0xEE, 0x07, 0x00, 0x12, + 0x10, 0x00, 0x50, 0x79, 0x07, 0x12, 0x88, 0x07, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, + 0x6D, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, + 0x61, 0x74, 0x65, 0x00, 0x12, 0x13, 0x12, 0x15, 0x13, 0x00, 0x84, 0x61, 0x67, 0x61, 0x74, 0x65, + 0x00, 0x46, 0xAB, 0x07, 0x13, 0xB8, 0x07, 0x18, 0xC5, 0x07, 0x00, 0x18, 0x0F, 0x04, 0x06, 0x00, + 0x85, 0x63, 0x75, 0x6C, 0x61, 0x74, 0x65, 0x00, 0x10, 0x04, 0x08, 0x17, 0x00, 0x86, 0x6D, 0x70, + 0x6C, 0x61, 0x74, 0x65, 0x00, 0x46, 0xCC, 0x07, 0x0F, 0xD9, 0x07, 0x00, 0x18, 0x0F, 0x04, 0x06, + 0x00, 0x86, 0x63, 0x75, 0x6C, 0x61, 0x74, 0x65, 0x00, 0x04, 0x06, 0x00, 0x84, 0x63, 0x75, 0x6C, + 0x61, 0x74, 0x65, 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x48, 0xF5, + 0x07, 0x18, 0x02, 0x08, 0x00, 0x11, 0x04, 0x0A, 0x00, 0x86, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x00, 0x06, 0x04, 0x00, 0x84, 0x63, 0x75, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0F, 0x0F, 0x04, + 0x13, 0x00, 0x83, 0x65, 0x74, 0x74, 0x65, 0x00, 0x04, 0x13, 0x10, 0x08, 0x17, 0x00, 0x83, 0x6C, + 0x61, 0x74, 0x65, 0x00, 0x0C, 0x15, 0x13, 0x00, 0x81, 0x61, 0x74, 0x65, 0x00, 0x4A, 0x37, 0x08, + 0x0C, 0x43, 0x08, 0x16, 0x4D, 0x08, 0x00, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, 0x67, + 0x75, 0x65, 0x00, 0x14, 0x11, 0x18, 0x00, 0x83, 0x69, 0x71, 0x75, 0x65, 0x00, 0x44, 0x54, 0x08, + 0x15, 0x69, 0x08, 0x00, 0x06, 0x00, 0x6C, 0x5D, 0x08, 0x08, 0x62, 0x08, 0x00, 0x82, 0x75, 0x73, + 0x65, 0x00, 0x05, 0x00, 0x82, 0x75, 0x73, 0x65, 0x00, 0x08, 0x13, 0x00, 0x84, 0x75, 0x72, 0x73, + 0x75, 0x65, 0x00, 0x4C, 0x7A, 0x08, 0x12, 0x93, 0x08, 0x00, 0x48, 0x81, 0x08, 0x0F, 0x8B, 0x08, + 0x00, 0x0F, 0x08, 0x05, 0x00, 0x83, 0x69, 0x65, 0x76, 0x65, 0x00, 0x08, 0x05, 0x00, 0x81, 0x65, + 0x76, 0x65, 0x00, 0x52, 0x9A, 0x08, 0x19, 0xA1, 0x08, 0x00, 0x15, 0x13, 0x00, 0x82, 0x76, 0x65, + 0x00, 0x05, 0x04, 0x00, 0x83, 0x6F, 0x76, 0x65, 0x00, 0x0C, 0x08, 0x00, 0x4B, 0xB6, 0x08, 0x0F, + 0xBD, 0x08, 0x15, 0xC5, 0x08, 0x00, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x08, 0x05, 0x00, + 0x82, 0x69, 0x65, 0x66, 0x00, 0x05, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x4C, 0xD3, 0x08, 0x11, + 0xDD, 0x08, 0x00, 0x11, 0x12, 0x0A, 0x2C, 0x00, 0x82, 0x69, 0x6E, 0x67, 0x00, 0x4C, 0xE4, 0x08, + 0x15, 0x3A, 0x09, 0x00, 0x48, 0xF4, 0x08, 0x0B, 0x0B, 0x09, 0x0F, 0x18, 0x09, 0x15, 0x24, 0x09, + 0x1C, 0x2F, 0x09, 0x00, 0x48, 0xFB, 0x08, 0x0B, 0x02, 0x09, 0x00, 0x05, 0x00, 0x83, 0x69, 0x6E, + 0x67, 0x00, 0x06, 0x04, 0x06, 0x00, 0x83, 0x69, 0x6E, 0x67, 0x00, 0x17, 0x06, 0x04, 0x10, 0x00, + 0x85, 0x74, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, + 0x69, 0x6E, 0x67, 0x00, 0x18, 0x06, 0x08, 0x15, 0x00, 0x82, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x17, + 0x1C, 0x11, 0x04, 0x00, 0x83, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, + 0x69, 0x6E, 0x67, 0x00, 0x46, 0x57, 0x09, 0x08, 0x8E, 0x09, 0x0A, 0x9A, 0x09, 0x0C, 0xA4, 0x09, + 0x16, 0xAD, 0x09, 0x17, 0xBF, 0x09, 0x00, 0x4B, 0x64, 0x09, 0x0C, 0x6D, 0x09, 0x0F, 0x77, 0x09, + 0x15, 0x7F, 0x09, 0x00, 0x0C, 0x1A, 0x00, 0x83, 0x68, 0x69, 0x63, 0x68, 0x00, 0x17, 0x1A, 0x16, + 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0B, 0x1A, 0x00, 0x82, 0x69, 0x63, 0x68, 0x00, 0x04, + 0x08, 0x16, 0x04, 0x08, 0x15, 0x00, 0x86, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x00, 0x17, 0x07, + 0x11, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x11, 0x08, 0x15, 0x17, 0x16, 0x00, + 0x80, 0x74, 0x68, 0x00, 0x06, 0x0B, 0x1A, 0x00, 0x82, 0x69, 0x63, 0x68, 0x00, 0x0C, 0x0F, 0x13, + 0x10, 0x12, 0x06, 0x04, 0x00, 0x86, 0x63, 0x6F, 0x6D, 0x70, 0x6C, 0x69, 0x73, 0x68, 0x00, 0x4A, + 0xC9, 0x09, 0x0C, 0xE1, 0x09, 0x15, 0xEC, 0x09, 0x00, 0x48, 0xD0, 0x09, 0x0C, 0xDA, 0x09, 0x00, + 0x15, 0x17, 0x16, 0x00, 0x82, 0x6E, 0x67, 0x74, 0x68, 0x00, 0x08, 0x0B, 0x00, 0x81, 0x68, 0x74, + 0x00, 0x1A, 0x07, 0x11, 0x04, 0x05, 0x00, 0x81, 0x64, 0x74, 0x68, 0x00, 0x18, 0x17, 0x2C, 0x00, + 0x83, 0x72, 0x75, 0x74, 0x68, 0x00, 0x15, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x81, 0x69, 0x72, 0x00, + 0x11, 0x00, 0x4C, 0x09, 0x0A, 0x18, 0x14, 0x0A, 0x00, 0x17, 0x0B, 0x2C, 0x00, 0x84, 0x74, 0x68, + 0x69, 0x6E, 0x6B, 0x00, 0x0C, 0x0B, 0x17, 0x00, 0x82, 0x6E, 0x6B, 0x00, 0x44, 0x32, 0x0A, 0x07, + 0x86, 0x0A, 0x08, 0xB1, 0x0A, 0x09, 0x11, 0x0B, 0x0F, 0x1A, 0x0B, 0x17, 0x37, 0x0B, 0x18, 0x40, + 0x0B, 0x00, 0x4C, 0x3C, 0x0A, 0x17, 0x47, 0x0A, 0x18, 0x60, 0x0A, 0x00, 0x06, 0x13, 0x1C, 0x17, + 0x00, 0x83, 0x69, 0x63, 0x61, 0x6C, 0x00, 0x4C, 0x4E, 0x0A, 0x18, 0x56, 0x0A, 0x00, 0x11, 0x0C, + 0x00, 0x81, 0x69, 0x61, 0x6C, 0x00, 0x15, 0x0C, 0x19, 0x00, 0x83, 0x74, 0x75, 0x61, 0x6C, 0x00, + 0x51, 0x6A, 0x0A, 0x15, 0x73, 0x0A, 0x17, 0x7C, 0x0A, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x6E, 0x75, + 0x61, 0x6C, 0x00, 0x18, 0x17, 0x04, 0x11, 0x00, 0x82, 0x61, 0x6C, 0x00, 0x0C, 0x19, 0x00, 0x83, + 0x72, 0x74, 0x75, 0x61, 0x6C, 0x00, 0x18, 0x00, 0x52, 0x8F, 0x0A, 0x1A, 0xA7, 0x0A, 0x00, 0x46, + 0x99, 0x0A, 0x0B, 0x9D, 0x0A, 0x1A, 0xA3, 0x0A, 0x00, 0x81, 0x6C, 0x64, 0x00, 0x16, 0x00, 0x81, + 0x6C, 0x64, 0x00, 0x81, 0x6C, 0x64, 0x00, 0x12, 0x2C, 0x00, 0x84, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x00, 0x4A, 0xC1, 0x0A, 0x0F, 0xC9, 0x0A, 0x13, 0xF7, 0x0A, 0x17, 0xFF, 0x0A, 0x18, 0x07, 0x0B, + 0x00, 0x11, 0x0C, 0x16, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x44, 0xD0, 0x0A, 0x0F, 0xEA, 0x0A, 0x00, + 0x15, 0x00, 0x44, 0xD9, 0x0A, 0x15, 0xE0, 0x0A, 0x00, 0x13, 0x00, 0x81, 0x6C, 0x65, 0x6C, 0x00, + 0x04, 0x13, 0x00, 0x84, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x00, 0x04, 0x15, 0x15, 0x04, 0x13, 0x00, + 0x85, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x00, 0x12, 0x08, 0x13, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x17, + 0x0C, 0x0F, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x07, 0x08, 0x0B, 0x06, 0x16, 0x00, 0x81, 0x6C, 0x65, + 0x00, 0x08, 0x16, 0x1C, 0x10, 0x00, 0x81, 0x6C, 0x66, 0x00, 0x0C, 0x09, 0x00, 0x4F, 0x24, 0x0B, + 0x18, 0x2E, 0x0B, 0x00, 0x0F, 0x18, 0x09, 0x00, 0x84, 0x66, 0x69, 0x6C, 0x6C, 0x00, 0x09, 0x00, + 0x83, 0x6C, 0x66, 0x69, 0x6C, 0x6C, 0x00, 0x18, 0x16, 0x08, 0x15, 0x00, 0x81, 0x6C, 0x74, 0x00, + 0x09, 0x17, 0x04, 0x08, 0x15, 0x0A, 0x00, 0x85, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6C, 0x00, 0x44, + 0x59, 0x0B, 0x0F, 0x6A, 0x0B, 0x15, 0x75, 0x0B, 0x00, 0x15, 0x0A, 0x12, 0x17, 0x06, 0x08, 0x13, + 0x16, 0x00, 0x84, 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x00, 0x08, 0x05, 0x12, 0x15, 0x13, 0x00, + 0x82, 0x6C, 0x65, 0x6D, 0x00, 0x12, 0x09, 0x12, 0x06, 0x00, 0x83, 0x6E, 0x66, 0x6F, 0x72, 0x6D, + 0x00, 0x44, 0xA6, 0x0B, 0x07, 0xCE, 0x0B, 0x08, 0xD7, 0x0B, 0x0A, 0x3A, 0x0C, 0x0C, 0x8D, 0x0C, + 0x0E, 0x99, 0x0C, 0x12, 0xC0, 0x0C, 0x13, 0x6C, 0x0D, 0x15, 0x78, 0x0D, 0x16, 0x83, 0x0D, 0x18, + 0x8D, 0x0D, 0x1A, 0xA4, 0x0D, 0x00, 0x0C, 0x00, 0x4A, 0xAF, 0x0B, 0x17, 0xB7, 0x0B, 0x00, 0x04, + 0x2C, 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x51, 0xBE, 0x0B, 0x15, 0xC6, 0x0B, 0x00, 0x12, 0x06, + 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x08, 0x06, 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x18, 0x12, + 0x09, 0x2C, 0x00, 0x81, 0x6E, 0x64, 0x00, 0x47, 0xE7, 0x0B, 0x08, 0xF1, 0x0B, 0x0A, 0x1B, 0x0C, + 0x13, 0x27, 0x0C, 0x16, 0x30, 0x0C, 0x00, 0x0F, 0x0C, 0x0B, 0x06, 0x00, 0x81, 0x72, 0x65, 0x6E, + 0x00, 0x57, 0xF8, 0x0B, 0x1A, 0x11, 0x0C, 0x00, 0x48, 0xFF, 0x0B, 0x1A, 0x07, 0x0C, 0x00, 0x05, + 0x00, 0x82, 0x77, 0x65, 0x65, 0x6E, 0x00, 0x08, 0x05, 0x00, 0x84, 0x74, 0x77, 0x65, 0x65, 0x6E, + 0x00, 0x08, 0x05, 0x00, 0x83, 0x74, 0x77, 0x65, 0x65, 0x6E, 0x00, 0x12, 0x07, 0x1C, 0x0B, 0x00, + 0x83, 0x72, 0x6F, 0x67, 0x65, 0x6E, 0x00, 0x04, 0x0B, 0x2C, 0x00, 0x81, 0x70, 0x65, 0x6E, 0x00, + 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, 0x48, 0x41, 0x0C, 0x0C, 0x4C, 0x0C, + 0x00, 0x0C, 0x15, 0x12, 0x09, 0x00, 0x83, 0x65, 0x69, 0x67, 0x6E, 0x00, 0x4B, 0x5F, 0x0C, 0x0F, + 0x65, 0x0C, 0x11, 0x6D, 0x0C, 0x12, 0x76, 0x0C, 0x15, 0x7D, 0x0C, 0x16, 0x84, 0x0C, 0x00, 0x17, + 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0F, 0x04, 0x00, 0x83, 0x69, 0x67, 0x6E, 0x00, 0x15, 0x04, 0x08, + 0x0F, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0A, 0x2C, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x17, 0x16, 0x00, + 0x81, 0x6E, 0x67, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x73, 0x69, 0x67, 0x6E, 0x00, 0x17, 0x04, 0x15, + 0x08, 0x06, 0x00, 0x83, 0x74, 0x61, 0x69, 0x6E, 0x00, 0x4B, 0xA0, 0x0C, 0x0C, 0xA9, 0x0C, 0x00, + 0x0C, 0x17, 0x00, 0x83, 0x68, 0x69, 0x6E, 0x6B, 0x00, 0x4B, 0xB0, 0x0C, 0x17, 0xB6, 0x0C, 0x00, + 0x17, 0x00, 0x81, 0x6E, 0x6B, 0x00, 0x0B, 0x2C, 0x00, 0x84, 0x74, 0x68, 0x69, 0x6E, 0x6B, 0x00, + 0x4C, 0xCA, 0x0C, 0x16, 0x56, 0x0D, 0x17, 0x60, 0x0D, 0x00, 0x46, 0xD4, 0x0C, 0x16, 0xE1, 0x0C, + 0x17, 0xFB, 0x0C, 0x00, 0x0C, 0x16, 0x08, 0x07, 0x00, 0x85, 0x63, 0x69, 0x73, 0x69, 0x6F, 0x6E, + 0x00, 0x44, 0xE8, 0x0C, 0x16, 0xF1, 0x0C, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, 0x6E, + 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x44, 0x0E, 0x0D, 0x07, 0x1B, + 0x0D, 0x0C, 0x25, 0x0D, 0x0F, 0x34, 0x0D, 0x11, 0x40, 0x0D, 0x16, 0x4C, 0x0D, 0x00, 0x15, 0x08, + 0x05, 0x04, 0x00, 0x84, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x07, 0x04, 0x00, 0x83, 0x69, + 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, + 0x69, 0x6F, 0x6E, 0x00, 0x04, 0x08, 0x15, 0x00, 0x85, 0x6C, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, + 0x06, 0x18, 0x09, 0x00, 0x85, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, + 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x0C, 0x19, 0x0C, 0x07, 0x00, 0x81, 0x69, 0x6F, 0x6E, 0x00, + 0x0C, 0x06, 0x04, 0x15, 0x09, 0x00, 0x83, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x13, 0x0B, 0x04, 0x00, + 0x84, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, 0x00, 0x83, 0x74, 0x75, + 0x72, 0x6E, 0x00, 0x0A, 0x0C, 0x0B, 0x17, 0x00, 0x82, 0x6E, 0x67, 0x73, 0x00, 0x55, 0x94, 0x0D, + 0x17, 0x9D, 0x0D, 0x00, 0x17, 0x08, 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, + 0x80, 0x72, 0x6E, 0x00, 0x12, 0x0E, 0x11, 0x18, 0x00, 0x82, 0x6E, 0x6F, 0x77, 0x6E, 0x00, 0x47, + 0xB9, 0x0D, 0x11, 0xC4, 0x0D, 0x1A, 0xCD, 0x0D, 0x00, 0x08, 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, + 0x75, 0x64, 0x6F, 0x00, 0x1A, 0x0E, 0x2C, 0x00, 0x82, 0x6E, 0x6F, 0x77, 0x00, 0x4F, 0xD4, 0x0D, + 0x11, 0xDC, 0x0D, 0x00, 0x0F, 0x12, 0x09, 0x00, 0x81, 0x6F, 0x77, 0x00, 0x0E, 0x2C, 0x00, 0x81, + 0x6F, 0x77, 0x00, 0x56, 0xEA, 0x0D, 0x18, 0xF4, 0x0D, 0x00, 0x04, 0x0B, 0x15, 0x08, 0x13, 0x00, + 0x81, 0x70, 0x73, 0x00, 0x12, 0x12, 0x0F, 0x00, 0x81, 0x6B, 0x75, 0x70, 0x00, 0x44, 0x1C, 0x0E, + 0x08, 0x5D, 0x0E, 0x0B, 0x67, 0x0F, 0x0F, 0x71, 0x0F, 0x12, 0x7F, 0x0F, 0x13, 0x90, 0x0F, 0x16, + 0x9B, 0x0F, 0x17, 0xA4, 0x0F, 0x18, 0xB0, 0x0F, 0x1C, 0xB9, 0x0F, 0x00, 0x4C, 0x26, 0x0E, 0x0F, + 0x30, 0x0E, 0x18, 0x52, 0x0E, 0x00, 0x0F, 0x0C, 0x10, 0x0C, 0x16, 0x00, 0x82, 0x61, 0x72, 0x00, + 0x4C, 0x37, 0x0E, 0x18, 0x42, 0x0E, 0x00, 0x10, 0x10, 0x0C, 0x16, 0x00, 0x84, 0x69, 0x6C, 0x61, + 0x72, 0x00, 0x06, 0x0C, 0x17, 0x04, 0x13, 0x00, 0x86, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6C, 0x61, + 0x72, 0x00, 0x0F, 0x0A, 0x08, 0x15, 0x00, 0x83, 0x75, 0x6C, 0x61, 0x72, 0x00, 0x44, 0x7C, 0x0E, + 0x07, 0x84, 0x0E, 0x0B, 0x91, 0x0E, 0x0C, 0xCB, 0x0E, 0x0F, 0xE5, 0x0E, 0x10, 0xEF, 0x0E, 0x11, + 0xF9, 0x0E, 0x12, 0x25, 0x0F, 0x17, 0x2D, 0x0F, 0x19, 0x4C, 0x0F, 0x00, 0x0F, 0x06, 0x00, 0x82, + 0x65, 0x61, 0x72, 0x00, 0x11, 0x04, 0x0F, 0x04, 0x06, 0x00, 0x84, 0x65, 0x6E, 0x64, 0x61, 0x72, + 0x00, 0x4A, 0x98, 0x0E, 0x17, 0xA3, 0x0E, 0x00, 0x0C, 0x08, 0x0B, 0x00, 0x85, 0x69, 0x67, 0x68, + 0x65, 0x72, 0x00, 0x48, 0xAD, 0x0E, 0x0F, 0xB9, 0x0E, 0x18, 0xC2, 0x0E, 0x00, 0x0B, 0x0A, 0x12, + 0x17, 0x00, 0x85, 0x65, 0x74, 0x68, 0x65, 0x72, 0x00, 0x12, 0x2C, 0x00, 0x84, 0x74, 0x68, 0x65, + 0x72, 0x00, 0x09, 0x00, 0x83, 0x72, 0x74, 0x68, 0x65, 0x72, 0x00, 0x4B, 0xD2, 0x0E, 0x0F, 0xDA, + 0x0E, 0x00, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x13, 0x10, 0x12, 0x06, 0x00, 0x83, + 0x69, 0x6C, 0x65, 0x72, 0x00, 0x17, 0x0C, 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x10, + 0x04, 0x15, 0x0A, 0x2C, 0x00, 0x81, 0x61, 0x72, 0x00, 0x4C, 0x00, 0x0F, 0x17, 0x0C, 0x0F, 0x00, + 0x0A, 0x0A, 0x08, 0x05, 0x00, 0x84, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x00, 0x4C, 0x13, 0x0F, 0x16, + 0x1C, 0x0F, 0x00, 0x12, 0x13, 0x00, 0x83, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x0C, 0x0F, 0x00, 0x82, + 0x65, 0x6E, 0x65, 0x72, 0x00, 0x09, 0x08, 0x05, 0x00, 0x81, 0x72, 0x65, 0x00, 0x4B, 0x34, 0x0F, + 0x18, 0x3E, 0x0F, 0x00, 0x12, 0x11, 0x04, 0x00, 0x83, 0x74, 0x68, 0x65, 0x72, 0x00, 0x13, 0x12, + 0x10, 0x06, 0x00, 0x86, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x72, 0x00, 0x48, 0x53, 0x0F, 0x1A, + 0x5E, 0x0F, 0x00, 0x08, 0x15, 0x08, 0x0B, 0x1A, 0x00, 0x83, 0x76, 0x65, 0x72, 0x00, 0x12, 0x0B, + 0x00, 0x82, 0x65, 0x76, 0x65, 0x72, 0x00, 0x08, 0x17, 0x12, 0x2C, 0x00, 0x82, 0x68, 0x65, 0x72, + 0x00, 0x04, 0x18, 0x06, 0x0C, 0x17, 0x15, 0x04, 0x13, 0x00, 0x82, 0x6C, 0x61, 0x72, 0x00, 0x17, + 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, 0x74, 0x6F, 0x72, 0x00, + 0x17, 0x0F, 0x0F, 0x18, 0x11, 0x00, 0x82, 0x70, 0x74, 0x72, 0x00, 0x04, 0x08, 0x1C, 0x2C, 0x00, + 0x81, 0x72, 0x73, 0x00, 0x12, 0x04, 0x15, 0x08, 0x13, 0x12, 0x00, 0x82, 0x74, 0x6F, 0x72, 0x00, + 0x06, 0x12, 0x2C, 0x00, 0x81, 0x63, 0x75, 0x72, 0x00, 0x08, 0x19, 0x08, 0x2C, 0x00, 0x81, 0x72, + 0x79, 0x00, 0x44, 0xDB, 0x0F, 0x08, 0x03, 0x10, 0x0A, 0x93, 0x10, 0x13, 0x9E, 0x10, 0x15, 0xAA, + 0x10, 0x16, 0xB5, 0x10, 0x17, 0x4D, 0x11, 0x18, 0x55, 0x11, 0x00, 0x4B, 0xE5, 0x0F, 0x13, 0xF0, + 0x0F, 0x1C, 0xFA, 0x0F, 0x00, 0x13, 0x15, 0x08, 0x13, 0x00, 0x83, 0x68, 0x61, 0x70, 0x73, 0x00, + 0x0B, 0x15, 0x08, 0x13, 0x00, 0x82, 0x61, 0x70, 0x73, 0x00, 0x1A, 0x0F, 0x04, 0x00, 0x82, 0x61, + 0x79, 0x73, 0x00, 0x44, 0x13, 0x10, 0x06, 0x2A, 0x10, 0x0C, 0x35, 0x10, 0x0F, 0x81, 0x10, 0x16, + 0x88, 0x10, 0x00, 0x47, 0x1A, 0x10, 0x0E, 0x22, 0x10, 0x00, 0x0C, 0x2C, 0x00, 0x82, 0x65, 0x61, + 0x73, 0x00, 0x17, 0x00, 0x83, 0x61, 0x6B, 0x65, 0x73, 0x00, 0x08, 0x07, 0x11, 0x0C, 0x00, 0x83, + 0x69, 0x63, 0x65, 0x73, 0x00, 0x46, 0x3F, 0x10, 0x15, 0x66, 0x10, 0x17, 0x75, 0x10, 0x00, 0x48, + 0x46, 0x10, 0x0C, 0x50, 0x10, 0x00, 0x07, 0x11, 0x0C, 0x00, 0x84, 0x69, 0x63, 0x65, 0x73, 0x00, + 0x47, 0x57, 0x10, 0x17, 0x5E, 0x10, 0x00, 0x11, 0x0C, 0x00, 0x82, 0x65, 0x73, 0x00, 0x15, 0x08, + 0x19, 0x00, 0x82, 0x65, 0x73, 0x00, 0x12, 0x16, 0x08, 0x06, 0x06, 0x04, 0x00, 0x84, 0x73, 0x6F, + 0x72, 0x69, 0x65, 0x73, 0x00, 0x0F, 0x0C, 0x05, 0x04, 0x00, 0x83, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x00, 0x04, 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x12, 0x0B, 0x06, 0x2C, 0x00, 0x82, 0x6F, 0x73, + 0x65, 0x73, 0x00, 0x0C, 0x11, 0x0B, 0x17, 0x00, 0x83, 0x69, 0x6E, 0x67, 0x73, 0x00, 0x04, 0x08, + 0x0B, 0x15, 0x08, 0x13, 0x00, 0x83, 0x61, 0x70, 0x73, 0x00, 0x08, 0x04, 0x1C, 0x2C, 0x00, 0x83, + 0x65, 0x61, 0x72, 0x73, 0x00, 0x44, 0xBF, 0x10, 0x08, 0xCB, 0x10, 0x12, 0x42, 0x11, 0x00, 0x15, + 0x04, 0x05, 0x10, 0x08, 0x00, 0x82, 0x72, 0x61, 0x73, 0x73, 0x00, 0x46, 0xD8, 0x10, 0x11, 0xF0, + 0x10, 0x15, 0x0D, 0x11, 0x16, 0x2A, 0x11, 0x00, 0x46, 0xDF, 0x10, 0x18, 0xE8, 0x10, 0x00, 0x12, + 0x15, 0x13, 0x00, 0x83, 0x65, 0x73, 0x73, 0x00, 0x16, 0x00, 0x82, 0x63, 0x65, 0x73, 0x73, 0x00, + 0x4C, 0xF7, 0x10, 0x16, 0x03, 0x11, 0x00, 0x16, 0x16, 0x18, 0x05, 0x00, 0x85, 0x69, 0x6E, 0x65, + 0x73, 0x73, 0x00, 0x18, 0x05, 0x00, 0x83, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x13, 0x00, 0x55, + 0x16, 0x11, 0x18, 0x21, 0x11, 0x00, 0x18, 0x16, 0x00, 0x85, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x00, 0x16, 0x00, 0x83, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x46, 0x31, 0x11, 0x12, 0x3A, 0x11, + 0x00, 0x06, 0x18, 0x16, 0x00, 0x83, 0x65, 0x73, 0x73, 0x00, 0x13, 0x00, 0x82, 0x73, 0x65, 0x73, + 0x73, 0x00, 0x15, 0x06, 0x06, 0x04, 0x00, 0x84, 0x72, 0x6F, 0x73, 0x73, 0x00, 0x15, 0x0C, 0x09, + 0x00, 0x81, 0x73, 0x74, 0x00, 0x52, 0x5C, 0x11, 0x16, 0x6A, 0x11, 0x00, 0x0F, 0x12, 0x10, 0x12, + 0x11, 0x04, 0x00, 0x84, 0x61, 0x6C, 0x6F, 0x75, 0x73, 0x00, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, + 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, 0x75, 0x73, 0x00, 0x44, 0x9E, 0x11, 0x08, 0xBC, 0x11, 0x0A, + 0xD9, 0x11, 0x0B, 0xE3, 0x11, 0x0C, 0x19, 0x12, 0x0F, 0x24, 0x12, 0x10, 0x2F, 0x12, 0x11, 0x3B, + 0x12, 0x12, 0x97, 0x13, 0x13, 0xBD, 0x13, 0x16, 0xD9, 0x13, 0x18, 0x6B, 0x14, 0x00, 0x55, 0xA5, + 0x11, 0x1A, 0xB0, 0x11, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, 0x83, 0x61, 0x72, 0x61, 0x74, 0x00, + 0x0B, 0x08, 0x10, 0x12, 0x16, 0x00, 0x83, 0x77, 0x68, 0x61, 0x74, 0x00, 0x44, 0xC3, 0x11, 0x11, + 0xCC, 0x11, 0x00, 0x15, 0x0A, 0x2C, 0x00, 0x82, 0x65, 0x61, 0x74, 0x00, 0x10, 0x11, 0x15, 0x08, + 0x19, 0x12, 0x0A, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, + 0x68, 0x74, 0x00, 0x47, 0xED, 0x11, 0x0A, 0xF4, 0x11, 0x0C, 0x0E, 0x12, 0x00, 0x0C, 0x1A, 0x00, + 0x81, 0x74, 0x68, 0x00, 0x51, 0xFB, 0x11, 0x18, 0x02, 0x12, 0x00, 0x08, 0x0F, 0x00, 0x81, 0x74, + 0x68, 0x00, 0x12, 0x15, 0x0B, 0x17, 0x00, 0x85, 0x6F, 0x75, 0x67, 0x68, 0x74, 0x00, 0x0A, 0x11, + 0x12, 0x17, 0x00, 0x83, 0x69, 0x67, 0x68, 0x74, 0x00, 0x17, 0x18, 0x12, 0x05, 0x04, 0x00, 0x81, + 0x20, 0x69, 0x74, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, 0x00, 0x04, + 0x17, 0x15, 0x12, 0x13, 0x10, 0x0C, 0x00, 0x81, 0x6E, 0x74, 0x00, 0x44, 0x48, 0x12, 0x08, 0x80, + 0x12, 0x15, 0x84, 0x13, 0x16, 0x8F, 0x13, 0x00, 0x4C, 0x55, 0x12, 0x11, 0x60, 0x12, 0x15, 0x6B, + 0x12, 0x17, 0x75, 0x12, 0x00, 0x13, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, + 0x0C, 0x10, 0x12, 0x15, 0x13, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x13, 0x13, 0x04, 0x00, + 0x82, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x13, 0x10, 0x12, 0x06, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, + 0x4C, 0x90, 0x12, 0x10, 0xB1, 0x12, 0x15, 0x15, 0x13, 0x19, 0x6F, 0x13, 0x1D, 0x79, 0x13, 0x00, + 0x46, 0x97, 0x12, 0x13, 0xA4, 0x12, 0x00, 0x08, 0x09, 0x09, 0x08, 0x00, 0x85, 0x69, 0x63, 0x69, + 0x65, 0x6E, 0x74, 0x00, 0x08, 0x06, 0x08, 0x15, 0x00, 0x85, 0x69, 0x70, 0x69, 0x65, 0x6E, 0x74, + 0x00, 0x48, 0xBE, 0x12, 0x11, 0xCA, 0x12, 0x15, 0xEB, 0x12, 0x17, 0x0A, 0x13, 0x00, 0x19, 0x12, + 0x0A, 0x00, 0x83, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x48, 0xD1, 0x12, 0x15, 0xDD, 0x12, + 0x00, 0x19, 0x12, 0x0A, 0x00, 0x84, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x12, 0x19, 0x12, + 0x0A, 0x00, 0x86, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x48, 0xF2, 0x12, 0x12, 0xFD, + 0x12, 0x00, 0x19, 0x12, 0x0A, 0x00, 0x83, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x19, 0x12, 0x0A, + 0x00, 0x85, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x17, 0x16, 0x00, 0x83, 0x65, + 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x44, 0x22, 0x13, 0x08, 0x2D, 0x13, 0x09, 0x39, 0x13, 0x15, 0x44, + 0x13, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, + 0x00, 0x84, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, 0x00, 0x83, 0x65, 0x72, + 0x65, 0x6E, 0x74, 0x00, 0x44, 0x4B, 0x13, 0x08, 0x63, 0x13, 0x00, 0x13, 0x00, 0x44, 0x54, 0x13, + 0x13, 0x5C, 0x13, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x00, 0x83, 0x65, + 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, 0x00, 0x85, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x08, + 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, 0x74, 0x00, 0x0C, 0x11, 0x0A, 0x12, 0x06, 0x00, 0x82, + 0x61, 0x6E, 0x74, 0x00, 0x08, 0x09, 0x09, 0x0C, 0x07, 0x00, 0x81, 0x65, 0x6E, 0x74, 0x00, 0x12, + 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x51, 0xA1, 0x13, 0x15, 0xAB, 0x13, 0x16, 0xB4, 0x13, + 0x00, 0x07, 0x0C, 0x07, 0x00, 0x82, 0x20, 0x6E, 0x6F, 0x74, 0x00, 0x13, 0x08, 0x15, 0x00, 0x82, + 0x6F, 0x72, 0x74, 0x00, 0x10, 0x0F, 0x04, 0x00, 0x82, 0x6F, 0x73, 0x74, 0x00, 0x48, 0xC4, 0x13, + 0x1C, 0xCF, 0x13, 0x00, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x70, 0x74, 0x00, 0x06, + 0x11, 0x08, 0x00, 0x82, 0x72, 0x79, 0x70, 0x74, 0x00, 0x48, 0xEC, 0x13, 0x0A, 0x15, 0x14, 0x0C, + 0x1E, 0x14, 0x10, 0x3B, 0x14, 0x11, 0x45, 0x14, 0x18, 0x60, 0x14, 0x00, 0x4A, 0xF3, 0x13, 0x15, + 0x0A, 0x14, 0x00, 0x4C, 0xFA, 0x13, 0x18, 0x02, 0x14, 0x00, 0x0B, 0x00, 0x82, 0x68, 0x65, 0x73, + 0x74, 0x00, 0x16, 0x00, 0x82, 0x67, 0x65, 0x73, 0x74, 0x00, 0x17, 0x11, 0x0C, 0x00, 0x83, 0x65, + 0x72, 0x65, 0x73, 0x74, 0x00, 0x15, 0x04, 0x0F, 0x00, 0x81, 0x65, 0x73, 0x74, 0x00, 0x49, 0x25, + 0x14, 0x11, 0x31, 0x14, 0x00, 0x08, 0x11, 0x04, 0x10, 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x00, 0x04, 0x0A, 0x04, 0x00, 0x83, 0x69, 0x6E, 0x73, 0x74, 0x00, 0x12, 0x0F, 0x04, 0x00, 0x83, + 0x6D, 0x6F, 0x73, 0x74, 0x00, 0x44, 0x4C, 0x14, 0x11, 0x57, 0x14, 0x00, 0x0C, 0x0A, 0x04, 0x00, + 0x84, 0x61, 0x69, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x04, 0x0A, 0x04, 0x00, 0x82, 0x73, 0x74, 0x00, + 0x0D, 0x04, 0x2C, 0x00, 0x83, 0x64, 0x6A, 0x75, 0x73, 0x74, 0x00, 0x46, 0x78, 0x14, 0x12, 0x90, + 0x14, 0x13, 0xA8, 0x14, 0x17, 0xBF, 0x14, 0x00, 0x48, 0x7F, 0x14, 0x15, 0x89, 0x14, 0x00, 0x06, + 0x1B, 0x08, 0x00, 0x84, 0x65, 0x63, 0x75, 0x74, 0x00, 0x0C, 0x06, 0x00, 0x80, 0x69, 0x74, 0x00, + 0x44, 0x97, 0x14, 0x05, 0xA0, 0x14, 0x00, 0x05, 0x00, 0x84, 0x61, 0x62, 0x6F, 0x75, 0x74, 0x00, + 0x05, 0x04, 0x00, 0x83, 0x6F, 0x75, 0x74, 0x00, 0x57, 0xAF, 0x14, 0x18, 0xB7, 0x14, 0x00, 0x11, + 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, + 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, 0x17, 0x12, 0x05, 0x04, 0x00, 0x81, 0x75, + 0x74, 0x00, 0x48, 0xD9, 0x14, 0x0C, 0xFD, 0x14, 0x00, 0x44, 0xE0, 0x14, 0x0C, 0xE7, 0x14, 0x00, + 0x0B, 0x2C, 0x00, 0x81, 0x76, 0x65, 0x00, 0x46, 0xEE, 0x14, 0x08, 0xF6, 0x14, 0x00, 0x08, 0x15, + 0x00, 0x82, 0x65, 0x69, 0x76, 0x00, 0x06, 0x08, 0x15, 0x00, 0x81, 0x76, 0x00, 0x08, 0x0B, 0x06, + 0x04, 0x2C, 0x00, 0x82, 0x69, 0x65, 0x76, 0x00, 0x4C, 0x0F, 0x15, 0x11, 0x19, 0x15, 0x00, 0x08, + 0x19, 0x08, 0x15, 0x00, 0x82, 0x69, 0x65, 0x77, 0x00, 0x12, 0x0E, 0x2C, 0x00, 0x82, 0x6E, 0x6F, + 0x77, 0x00, 0x46, 0x3B, 0x15, 0x08, 0x76, 0x15, 0x0B, 0x80, 0x15, 0x0F, 0x92, 0x15, 0x11, 0x57, + 0x16, 0x15, 0x72, 0x16, 0x16, 0x0C, 0x17, 0x17, 0x27, 0x17, 0x00, 0x44, 0x48, 0x15, 0x08, 0x54, + 0x15, 0x0C, 0x5F, 0x15, 0x13, 0x6A, 0x15, 0x00, 0x15, 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x82, + 0x69, 0x73, 0x79, 0x00, 0x18, 0x14, 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x15, + 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x81, 0x73, 0x79, 0x00, 0x18, 0x15, 0x0E, 0x11, 0x04, 0x05, + 0x00, 0x81, 0x74, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, 0x74, 0x79, 0x00, + 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, + 0x79, 0x00, 0x44, 0xA5, 0x15, 0x0B, 0xE8, 0x15, 0x0E, 0xF2, 0x15, 0x0F, 0xFA, 0x15, 0x12, 0x42, + 0x16, 0x15, 0x4C, 0x16, 0x00, 0x45, 0xB8, 0x15, 0x08, 0xC1, 0x15, 0x0F, 0xC7, 0x15, 0x11, 0xD0, + 0x15, 0x15, 0xD7, 0x15, 0x18, 0xE0, 0x15, 0x00, 0x12, 0x15, 0x13, 0x00, 0x81, 0x62, 0x6C, 0x79, + 0x00, 0x15, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x08, 0x15, 0x00, 0x83, 0x61, 0x6C, 0x6C, 0x79, 0x00, + 0x0C, 0x09, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x08, 0x11, 0x08, 0x0A, 0x00, 0x80, 0x6C, 0x79, 0x00, + 0x17, 0x06, 0x04, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x0A, 0x0C, 0x0F, 0x16, 0x00, 0x81, 0x74, 0x6C, + 0x79, 0x00, 0x0C, 0x0F, 0x00, 0x81, 0x65, 0x6C, 0x79, 0x00, 0x44, 0x04, 0x16, 0x05, 0x2F, 0x16, + 0x08, 0x38, 0x16, 0x00, 0x56, 0x0B, 0x16, 0x17, 0x23, 0x16, 0x00, 0x18, 0x00, 0x6C, 0x14, 0x16, + 0x16, 0x1B, 0x16, 0x00, 0x83, 0x75, 0x61, 0x6C, 0x6C, 0x79, 0x00, 0x18, 0x00, 0x84, 0x61, 0x6C, + 0x6C, 0x79, 0x00, 0x18, 0x06, 0x04, 0x00, 0x85, 0x74, 0x75, 0x61, 0x6C, 0x6C, 0x79, 0x00, 0x04, + 0x05, 0x12, 0x15, 0x13, 0x00, 0x81, 0x79, 0x00, 0x04, 0x15, 0x00, 0x84, 0x65, 0x61, 0x6C, 0x6C, + 0x79, 0x00, 0x10, 0x12, 0x11, 0x04, 0x00, 0x82, 0x61, 0x6C, 0x79, 0x00, 0x04, 0x10, 0x0C, 0x15, + 0x13, 0x00, 0x81, 0x69, 0x6C, 0x79, 0x00, 0x48, 0x5E, 0x16, 0x13, 0x67, 0x16, 0x00, 0x12, 0x10, + 0x2C, 0x00, 0x82, 0x6E, 0x65, 0x79, 0x00, 0x04, 0x10, 0x12, 0x06, 0x00, 0x83, 0x70, 0x61, 0x6E, + 0x79, 0x00, 0x44, 0x7F, 0x16, 0x08, 0xE7, 0x16, 0x12, 0xF0, 0x16, 0x17, 0xFD, 0x16, 0x00, 0x45, + 0x8F, 0x16, 0x0C, 0x98, 0x16, 0x0F, 0xA5, 0x16, 0x10, 0xC1, 0x16, 0x16, 0xCA, 0x16, 0x00, 0x0C, + 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00, 0x0F, 0x0F, 0x0C, 0x1B, 0x18, 0x04, 0x00, 0x84, + 0x69, 0x61, 0x72, 0x79, 0x00, 0x4C, 0xAC, 0x16, 0x0F, 0xB6, 0x16, 0x00, 0x1B, 0x18, 0x04, 0x00, + 0x82, 0x69, 0x61, 0x72, 0x79, 0x00, 0x0C, 0x1B, 0x18, 0x04, 0x00, 0x83, 0x69, 0x61, 0x72, 0x79, + 0x00, 0x18, 0x16, 0x00, 0x82, 0x6D, 0x61, 0x72, 0x79, 0x00, 0x08, 0x06, 0x00, 0x46, 0xD4, 0x16, + 0x08, 0xDF, 0x16, 0x00, 0x08, 0x11, 0x00, 0x85, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x00, 0x11, + 0x00, 0x82, 0x73, 0x61, 0x72, 0x79, 0x00, 0x13, 0x12, 0x15, 0x13, 0x00, 0x80, 0x74, 0x79, 0x00, + 0x0A, 0x04, 0x17, 0x04, 0x06, 0x00, 0x84, 0x65, 0x67, 0x6F, 0x72, 0x79, 0x00, 0x11, 0x18, 0x06, + 0x12, 0x2C, 0x00, 0x86, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x00, 0x04, 0x00, 0x55, 0x15, + 0x17, 0x1A, 0x20, 0x17, 0x00, 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x82, 0x69, 0x73, 0x79, 0x00, + 0x0F, 0x04, 0x00, 0x81, 0x79, 0x73, 0x00, 0x49, 0x31, 0x17, 0x0F, 0x39, 0x17, 0x15, 0x42, 0x17, + 0x00, 0x04, 0x16, 0x00, 0x81, 0x65, 0x74, 0x79, 0x00, 0x0C, 0x05, 0x04, 0x00, 0x81, 0x69, 0x74, + 0x79, 0x00, 0x13, 0x08, 0x12, 0x15, 0x13, 0x00, 0x84, 0x70, 0x65, 0x72, 0x74, 0x79, 0x00 +}; + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt new file mode 100644 index 000000000000..b5f293d96cb1 --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt @@ -0,0 +1,473 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# This is a larger example typo dictionary containing 400 entries. It builds to +# a table of about 6000 bytes, so you'll need a keyboard with a generous +# amount of free firmware space to use the full dictionary. Alternatively, pick +# out a subset of entries to a separate file, then build a table from that. +# +# Dictionary syntax: +# Each line of this file defines one typo correction entry with the syntax +# "typo -> correction". Typos and corrections are case insensitive, and any +# whitespace before or after the typo and correction is ignored. The typo must be +# only the letters a-z, or the special character : representing a word break. +# +# For documentation about how to use this dictionary, see +# https://getreuer.info/posts/keyboards/autocorrection +# +# Further resources: +# * Wikipedia has a large list of common typos at +# https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines +# +# * EmacsWiki has another list of typos at +# https://www.emacswiki.org/emacs/autocorrection_abbrev_defs +# +# * You can find data on English word frequencies at +# https://www.wordfrequency.info/samples.asp + + +## 10 most common words. +# The words "there", "about", "their", "would", "people", "which", "could", +# "think", "other", and "because" are among the most common words in English +# that are 5 letters or longer. (We don't include entries for words shorter than +# that to avoid false triggering.) +:htere -> there +abbout -> about +abotu -> about +baout -> about +:theri -> their +:thier -> their +:owudl -> would +woudl -> would +peaple -> people +peolpe -> people +peopel -> people +poeple -> people +poeople -> people +:hwihc -> which +whcih -> which +whihc -> which +whlch -> which +wihch -> which +coudl -> could +:htikn -> think +:htink -> think +thikn -> think +thiunk -> think +tihkn -> think +:olther -> other +:otehr -> other +baceause -> because +beacuse -> because +becasue -> because +beccause -> because +becouse -> because +becuase -> because + +## Common words, 11-20. +theese -> these +:goign -> going +:gonig -> going +:yaers -> years +:yeasr -> years +:thsoe -> those +shoudl -> should +raelly -> really +realy -> really +relaly -> really +bedore -> before +befoer -> before +littel -> little +beeing -> being +:hwile -> while + +## Common words, 21-30. +aroud -> around +arround -> around +arund -> around +thign -> thing +thigsn -> things +thnigs -> things +anohter -> another +beteen -> between +beween -> between +bewteen -> between +:eveyr -> every +:graet -> great +:agian -> again +:sicne -> since +alwasy -> always +alwyas -> always +throught -> thought + + +## Words especially susceptible to skipping or transposing a letter. +# These entries are for words that are easy enough to spell, but not necessarily +# easy to press the keys in the right order. +# Catch misspellings of "achieves", "achieving", etc. +:acheiv -> achiev +almsot -> almost +alomst -> almost +chnage -> change +chekc -> check +childen -> children +claer -> clear +comapny -> company +contian -> contain +elasped -> elapsed +feild -> field +fitler -> filter +firts -> first +follwo -> follow +:foudn -> found +frequecy -> frequency +firend -> friend +freind -> friend +heigth -> height +iamge -> image +inital -> initial +intput -> input +laguage -> language +lenght -> length +levle -> level +libary -> library +:moeny -> money +mysefl -> myself +ouptut -> output +ouput -> output +probaly -> probably +probelm -> problem +recrod -> record +reponse -> response +reprot -> report +singel -> single +stregth -> strength +strengh -> strength +tkaes -> takes +therfore -> therefore +todya -> today +toghether -> together +unkown -> unknown +unqiue -> unique +widht -> width + + +## Words with tricky spelling. +# If you are a good speller, you could drop this section. +aberation -> aberration +accross -> across +adviced -> advised +aledge -> allege +alledge -> allege +amature -> amateur +anomolous -> anomalous +anomoly -> anomaly +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +asthetic -> aesthetic +auxilary -> auxiliary +auxillary -> auxiliary +auxilliary -> auxiliary +bankrupcy -> bankruptcy +busness -> business +bussiness -> business +calander -> calendar +commitee -> committee +comittee -> committee +competance -> competence +competant -> competent +concensus -> consensus +cognizent -> cognizant +copywrite: -> copyright +choosen -> chosen +collegue -> colleague +excercise -> exercise +:grammer -> grammar +:guage -> gauge +govement -> government +govenment -> government +goverment -> government +governmnet -> government +govorment -> government +govornment -> government +guaratee -> guarantee +garantee -> guarantee +gaurantee -> guarantee +heirarchy -> hierarchy +hygeine -> hygiene +hypocracy -> hypocrisy +hypocrasy -> hypocrisy +hypocricy -> hypocrisy +hypocrit: -> hypocrite +looses: -> loses +maintence -> maintenance +morgage -> mortgage +neccesary -> necessary +necesary -> necessary +pallete -> palette +paralel -> parallel +parralel -> parallel +parrallel -> parallel +priviledge -> privilege +probablly -> probably +prominant -> prominent +propogate -> propagate +proove -> prove +psuedo -> pseudo +reciept -> receipt +# Catch misspellings of "receives", "receiving", etc. +receiev -> receiv +reciev -> receiv +recepient -> recipient +recipiant -> recipient +relevent -> relevant +repitition -> repetition +safty -> safety +saftey -> safety +# Catch misspellings of "separate", "separating", etc. +seperat -> separat +spectogram -> spectrogram +symetric -> symmetric +tolerence -> tolerance + + +## Words particularly for coding. +# Entries for common code keywords ("const") and terminology ("lookup"). +cacheing -> caching +complier -> compiler +doulbe -> double +dyanmic -> dynamic +# As in "execute", "executable", "executing", ... +excecut -> execut +failse -> false +fales -> false +fasle -> false +flase -> false +indeces -> indices +indecies -> indices +indicies -> indices +interator -> iterator +looup -> lookup +namesapce -> namespace +namespcae -> namespace +nulltpr -> nullptr +operaotr -> operator +overide -> override +ovveride -> override +poitner -> pointer +:rference -> reference +referece -> reference +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +teamplate -> template +tempalte -> template +:ture -> true +retrun -> return +retun -> return +reutrn -> return +cosnt -> const +virutal -> virtual +vitual -> virtual +yeild -> yield + + +## Catch skipped spaces between common words. +:alot: -> a lot +:andteh -> and the +:andthe -> and the +:asthe -> as the +:atthe -> at the +abouta -> about a +aboutit -> about it +aboutthe -> about the +:tothe -> to the +didnot -> did not +fromthe -> from the + + +## Various additional entries. +:agred -> agreed +:ajust -> adjust +:anual -> annual +:asign -> assign +:aslo: -> also +:casue -> cause +:choses -> chooses +:gaurd -> guard +:haev -> have +:hapen -> happen +:idaes -> ideas +:jsut: -> just +:jstu: -> just +:knwo -> know +:konw -> know +:kwno -> know +:ocuntry -> country +:ocur -> occur +:socre -> score +:szie -> size +:the:the: -> the +:turth -> truth +:uesd: -> used +:usally -> usually +abilties -> abilities +abilty -> ability +abvove -> above +accesories -> accessories +accomodate -> accommodate +acommodate -> accommodate +acomplish -> accomplish +actualy -> actually +acurate -> accurate +acutally -> actually +addtion -> addition +againnst -> against +aganist -> against +aggreed -> agreed +agianst -> against +ahppn -> happen +allign -> align +anytying -> anything +aquire -> acquire +availabe -> available +availaible -> available +availalbe -> available +availble -> available +availiable -> available +avalable -> available +avaliable -> available +avilable -> available +bandwith -> bandwidth +begginer -> beginner +beleif -> belief +beleive -> believe +belive -> believe +breif -> brief +burried -> buried +caluclate -> calculate +caluculate -> calculate +calulate -> calculate +catagory -> category +cauhgt -> caught +ceratin -> certain +certian -> certain +cheif -> chief +cieling -> ceiling +circut -> circuit +clasic -> classic +cmoputer -> computer +coform -> conform +comming: -> coming +considerd -> considered +dervied -> derived +desicion -> decision +diferent -> different +diferrent -> different +differnt -> different +diffrent -> different +divison -> division +effecient -> efficient +eligable -> eligible +elpased -> elapsed +embarass -> embarrass +embeded -> embedded +encypt -> encrypt +finaly -> finally +foriegn -> foreign +foward -> forward +fraciton -> fraction +fucntion -> function +fufill -> fulfill +fullfill -> fulfill +futher -> further +ganerate -> generate +generaly -> generally +greatful -> grateful +heigher -> higher +higest -> highest +howver -> however +hydogen -> hydrogen +importamt -> important +inclued -> include +insted -> instead +intrest -> interest +invliad -> invalid +largst -> largest +learnign -> learning +liasion -> liaison +likly -> likely +lisense -> license +listner -> listener +macthing -> matching +manefist -> manifest +mesage -> message +naturual -> natural +occassion -> occasion +occured -> occurred +particualr -> particular +paticular -> particular +peice -> piece +perhasp -> perhaps +perheaps -> perhaps +perhpas -> perhaps +perphas -> perhaps +persue -> pursue +posess -> possess +postion -> position +preiod -> period +primarly -> primarily +privte -> private +proccess -> process +proeprty -> property +propery -> property +realtion -> relation +reasearch -> research +recuring -> recurring +refered -> referred +regluar -> regular +releated -> related +resutl -> result +reuslt -> result +reveiw -> review +satisifed -> satisfied +scheduel -> schedule +sequnce -> sequence +similiar -> similar +simmilar -> similar +slighly -> slightly +somehwat -> somewhat +statment -> statement +sucess -> success +succsess -> success +sugest -> suggest +sumary -> summary +supress -> suppress +surpress -> suppress +thresold -> threshold +tongiht -> tonight +tranpose -> transpose +typcial -> typical +udpate -> update +ususally -> usually +verticies -> vertices +whereever -> wherever +wherre -> where +wierd -> weird + From 8107e4f63a8209784c41c36c861a91e7a788ee16 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 5 Apr 2023 15:30:01 -0400 Subject: [PATCH 042/160] adding default RGB values --- .../q2/ansi_encoder/keymaps/mkillewald/config.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index bcd0b19e70c5..671fc4f3c219 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -23,9 +23,11 @@ #endif #ifdef RGB_MATRIX_ENABLE -# define HUE_MAC_BASE 170 // HSV blue hue component -# define HUE_WIN_BASE 80 // HSV green hue component -# define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 -# define FN2_LAYER_COLOR RGB_YELLOW +# define HUE_MAC_BASE 170 // HSV blue hue +# define HUE_WIN_BASE 80 // HSV green hue +# define CAPS_LOCK_INDICATOR_COLOR RGB_RED +# define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 +# define FN2_LAYER_COLOR RGB_YELLOW +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING +# define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue #endif \ No newline at end of file From 35d465dd767b7b2b9d4e83edabf4502673353210 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 5 Apr 2023 15:31:51 -0400 Subject: [PATCH 043/160] changed to my preferred default options stored in eeprom --- .../q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 676a2424d86f..472a98af7119 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -32,9 +32,9 @@ user_config_t user_config; void eeconfig_init_user(void) { user_config.raw = 0; user_config.caps_lock_light_tab = false; - user_config.caps_lock_light_alphas = false; - user_config.fn_layer_transparent_keys_off = true; - user_config.fn_layer_color_enable = false; + user_config.caps_lock_light_alphas = true; + user_config.fn_layer_transparent_keys_off = false; + user_config.fn_layer_color_enable = true; eeconfig_update_user(user_config.raw); } From 8c125c46c8a7832d7a4de5628820def2f0e62445 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 5 Apr 2023 16:40:37 -0400 Subject: [PATCH 044/160] removed HUE_MAC_BASE. Mac Base layer will use hue saved in eeprom --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 3 +-- .../q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 671fc4f3c219..b42c75d04a93 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -23,11 +23,10 @@ #endif #ifdef RGB_MATRIX_ENABLE -# define HUE_MAC_BASE 170 // HSV blue hue -# define HUE_WIN_BASE 80 // HSV green hue # define CAPS_LOCK_INDICATOR_COLOR RGB_RED # define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 # define FN2_LAYER_COLOR RGB_YELLOW # define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING # define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue +# define HUE_WIN_BASE 80 // HSV green hue #endif \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index f6997df0d804..d3b255b30d34 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -44,11 +44,9 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: -#if defined HUE_WIN_BASE && defined HUE_MAC_BASE +#ifdef HUE_WIN_BASE if (win_mode) { rgb_matrix_sethsv_noeeprom(HUE_WIN_BASE, rgb_matrix_get_sat(), rgb_matrix_get_val()); - } else { - rgb_matrix_sethsv_noeeprom(HUE_MAC_BASE, rgb_matrix_get_sat(), rgb_matrix_get_val()); } #endif #ifdef CAPS_LOCK_INDICATOR_COLOR From 89e937639d76f8bc1cb2c1d0eacb77026c200dc5 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 5 Apr 2023 18:10:01 -0400 Subject: [PATCH 045/160] fixed Mac Base not returning to saved RGB color --- .../q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index d3b255b30d34..f668b6a49fa1 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -22,6 +22,7 @@ keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; static bool win_mode; +static bool win_mode_was_activated; void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { @@ -46,7 +47,13 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { case WIN_BASE: #ifdef HUE_WIN_BASE if (win_mode) { + win_mode_was_activated = true; rgb_matrix_sethsv_noeeprom(HUE_WIN_BASE, rgb_matrix_get_sat(), rgb_matrix_get_val()); + } else { + if (win_mode_was_activated) { + win_mode_was_activated = false; + rgb_matrix_reload_from_eeprom(); + } } #endif #ifdef CAPS_LOCK_INDICATOR_COLOR From 8b7f1855c2e5d036b45d91c7adcf92e63455f0d9 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 6 Apr 2023 11:42:20 -0400 Subject: [PATCH 046/160] adding separate user configurable colors for Mac Base and Win Base layers --- .../ansi_encoder/keymaps/mkillewald/config.h | 2 + .../ansi_encoder/keymaps/mkillewald/keymap.c | 70 +++++++++++++++--- .../keymaps/mkillewald/keymap_user.h | 4 +- .../keymaps/mkillewald/keymap_user_config.c | 74 +++++++++++++++++-- .../keymaps/mkillewald/keymap_user_config.h | 19 ++++- .../keymaps/mkillewald/rgb_matrix_user.c | 21 +++--- .../keymaps/mkillewald/rgb_matrix_user.h | 1 + 7 files changed, 156 insertions(+), 35 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index b42c75d04a93..db27fe291246 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -28,5 +28,7 @@ # define FN2_LAYER_COLOR RGB_YELLOW # define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING # define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue +# define RGB_MATRIX_DEFAULT_SAT 255 +# define RGB_MATRIX_DEFAULT_VAL 255 # define HUE_WIN_BASE 80 // HSV green hue #endif \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 90efeccd8544..76f2185ddeed 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -47,6 +47,8 @@ enum my_keycodes { #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE #define KC_LBMAC KC_LOCK_BLANK_MAC +static bool win_mode; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, @@ -99,6 +101,16 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { }; #endif +void matrix_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} + +void keyboard_post_init_user(void) { + user_config_read_eeprom(); +} + void housekeeping_task_user(void) { #ifdef RGB_MATRIX_ENABLE switch(bootloader_state) { @@ -127,29 +139,67 @@ void housekeeping_task_user(void) { housekeeping_task_keychron(); } -void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init_user(); -#endif +bool dip_switch_update_user(uint8_t index, bool active) { + win_mode = (index == 0 && active ? true : false); + return true; } -void keyboard_post_init_user(void) { - user_config_read(); -} +bool is_win_mode(void) { return win_mode; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { - case QK_BOOT: #ifdef RGB_MATRIX_ENABLE + case QK_BOOT: // We want to turn off LEDs before calling bootloader, so here // we call rgb_matrix_disable_noeeprom() and set a flag because // the LEDs won't be updated until the next frame. rgb_matrix_disable_noeeprom(); bootloader_state = BOOTLOADER_PRESSED; return false; // Skip all further processing of this key -#endif - return true; // Allow further processing of this key + case RGB_HUI: + if (win_mode) { + rgb_matrix_increase_hue_noeeprom(); + user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_HUD: + if (win_mode) { + rgb_matrix_decrease_hue_noeeprom(); + user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_SAI: + if (win_mode) { + rgb_matrix_increase_sat_noeeprom(); + user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_SAD: + if (win_mode) { + rgb_matrix_decrease_sat_noeeprom(); + user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_VAI: + if (win_mode) { + rgb_matrix_increase_val_noeeprom(); + user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_VAD: + if (win_mode) { + rgb_matrix_decrease_val_noeeprom(); + user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key +#endif // RGB_MATRIX_ENABLE case KC_LIGHT_TAB_TOGGLE: if (record->event.pressed) { user_config_toggle_caps_lock_light_tab(); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h index bf430da5158b..05f8f5511a55 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h @@ -22,4 +22,6 @@ enum layers{ _FN1, // Mac Fn1 (layer 2) _FN2, // Win Fn1 (layer 3) _FN3 // Mac/Win Fn2 (layer 4) -}; \ No newline at end of file +}; + +bool is_win_mode(void); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 472a98af7119..09b224954f7f 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + #include QMK_KEYBOARD_H #include "keymap_user_config.h" @@ -29,6 +29,15 @@ typedef union { user_config_t user_config; +typedef struct { + HSV hsv_win_base; + HSV hsv_mac_fn1; + HSV hsv_win_fn1; + HSV hsv_fn2; +} user_colors_t; + +user_colors_t user_colors; + void eeconfig_init_user(void) { user_config.raw = 0; user_config.caps_lock_light_tab = false; @@ -36,13 +45,17 @@ void eeconfig_init_user(void) { user_config.fn_layer_transparent_keys_off = false; user_config.fn_layer_color_enable = true; eeconfig_update_user(user_config.raw); + + user_colors.hsv_win_base.h = HUE_WIN_BASE; + user_colors.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; + user_colors.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; } -void user_config_read(void) { +void user_config_read_eeprom(void) { user_config.raw = eeconfig_read_user(); } -void user_config_write(void) { +void user_config_write_eeprom(void) { eeconfig_update_user(user_config.raw); } @@ -64,20 +77,65 @@ bool user_config_get_fn_layer_color_enable(void) { void user_config_toggle_caps_lock_light_tab(void) { user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit - user_config_write(); + user_config_write_eeprom(); } void user_config_toggle_caps_lock_light_alphas(void) { user_config.caps_lock_light_alphas ^= 1; - user_config_write(); + user_config_write_eeprom(); } void user_config_toggle_fn_layer_transparent_keys_off(void) { user_config.fn_layer_transparent_keys_off ^= 1; - user_config_write(); + user_config_write_eeprom(); } void user_config_toggle_fn_layer_color_enable(void) { user_config.fn_layer_color_enable ^= 1; - user_config_write(); -} \ No newline at end of file + user_config_write_eeprom(); +} + +void user_colors_read_eeprom(void) { + eeconfig_read_user_datablock(&user_colors); +} + +void user_colors_write_eeprom(void) { + eeconfig_update_user_datablock(&user_colors); +} + +HSV user_colors_get_hsv_win_base(void) { + return user_colors.hsv_win_base; +} + +HSV user_colors_get_hsv_mac_fn1(void) { + return user_colors.hsv_mac_fn1; +} + +HSV user_colors_get_hsv_win_fn1(void) { + return user_colors.hsv_win_fn1; +} + +HSV user_colors_get_hsv_fn2(void) { + return user_colors.hsv_fn2; +} + +void user_colors_set_hsv_win_base(HSV hsv) { + user_colors.hsv_win_base = hsv; + user_colors_write_eeprom(); +} + +void user_colors_set_hsv_mac_fn1(HSV hsv) { + user_colors.hsv_mac_fn1 = hsv; + user_colors_write_eeprom(); +} + +void user_colors_set_hsv_win_fn1(HSV hsv) { + user_colors.hsv_win_fn1 = hsv; + user_colors_write_eeprom(); +} + +void user_colors_set_hsv_fn2(HSV hsv) { + user_colors.hsv_fn2 = hsv; + user_colors_write_eeprom(); +} + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index 5e7eb50b671c..9996747b894a 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -13,11 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + #pragma once -void user_config_read(void); -void user_config_write(void); +void user_config_read_eeprom(void); +void user_config_write_eeprom(void); bool user_config_get_caps_lock_light_tab(void); bool user_config_get_caps_lock_light_alphas(void); bool user_config_get_fn_layer_transparent_keys_off(void); @@ -25,4 +25,15 @@ bool user_config_get_fn_layer_color_enable(void); void user_config_toggle_caps_lock_light_tab(void); void user_config_toggle_caps_lock_light_alphas(void); void user_config_toggle_fn_layer_transparent_keys_off(void); -void user_config_toggle_fn_layer_color_enable(void); \ No newline at end of file +void user_config_toggle_fn_layer_color_enable(void); + +void user_colors_read_eeprom(void); +void user_colors_write_eeprom(void); +HSV user_colors_get_hsv_win_base(void); +HSV user_colors_get_hsv_mac_fn1(void); +HSV user_colors_get_hsv_win_fn1(void); +HSV user_colors_get_hsv_fn2(void); +void user_colors_set_hsv_win_base(HSV hsv); +void user_colors_set_hsv_mac_fn1(HSV hsv); +void user_colors_set_hsv_win_fn1(HSV hsv); +void user_colors_set_hsv_fn2(HSV hsv); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index f668b6a49fa1..36f037feb1d9 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -21,7 +21,7 @@ #include "keymap_user_config.h" keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; -static bool win_mode; + static bool win_mode_was_activated; void rgb_matrix_init_user(void) { @@ -35,20 +35,17 @@ void rgb_matrix_init_user(void) { } } -bool dip_switch_update_user(uint8_t index, bool active) { - win_mode = (index == 0 && active ? true : false); - return true; -} - -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { uint8_t current_layer = get_highest_layer(layer_state); switch (current_layer) { case MAC_BASE: case WIN_BASE: #ifdef HUE_WIN_BASE - if (win_mode) { + if (is_win_mode()) { win_mode_was_activated = true; - rgb_matrix_sethsv_noeeprom(HUE_WIN_BASE, rgb_matrix_get_sat(), rgb_matrix_get_val()); + rgb_matrix_sethsv_noeeprom(user_colors_get_hsv_win_base.h, + user_colors_get_hsv_win_base.s, + user_colors_get_hsv_win_base.h); } else { if (win_mode_was_activated) { win_mode_was_activated = false; @@ -63,9 +60,9 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { #endif #ifdef CAPS_WORD_INDICATOR_COLOR if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); } -#endif +#endif break; case _FN1: case _FN2: @@ -124,4 +121,4 @@ bool is_caps_word_indicator(uint16_t keycode) { } bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } -bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } +bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h index 9081f92be488..9daf9f59f4c1 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h @@ -25,3 +25,4 @@ bool is_caps_word_indicator(uint16_t keycode); bool is_transparent(uint16_t keycode); bool is_not_transparent(uint16_t keycode); +void set_hsv_win_base(HSV hsv); From 79959fdbfd9de4e6c153f35c75347be31e78291a Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 6 Apr 2023 12:05:53 -0400 Subject: [PATCH 047/160] separate Mac Base and Win Base colors working --- .../ansi_encoder/keymaps/mkillewald/config.h | 2 + .../ansi_encoder/keymaps/mkillewald/keymap.c | 12 +- .../keymaps/mkillewald/keymap_user_config.c | 105 ++++++++---------- .../keymaps/mkillewald/keymap_user_config.h | 22 ++-- .../keymaps/mkillewald/rgb_matrix_user.c | 6 +- 5 files changed, 71 insertions(+), 76 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index db27fe291246..7c8a03c28067 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -16,6 +16,8 @@ #pragma once +#define EECONFIG_USER_DATA_SIZE 13 + #ifdef CAPS_WORD_ENABLE # define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD # define CAPS_WORD_INDICATOR_COLOR RGB_RED diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 76f2185ddeed..eba04f20bb05 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -160,42 +160,42 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case RGB_HUI: if (win_mode) { rgb_matrix_increase_hue_noeeprom(); - user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_HUD: if (win_mode) { rgb_matrix_decrease_hue_noeeprom(); - user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_SAI: if (win_mode) { rgb_matrix_increase_sat_noeeprom(); - user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_SAD: if (win_mode) { rgb_matrix_decrease_sat_noeeprom(); - user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_VAI: if (win_mode) { rgb_matrix_increase_val_noeeprom(); - user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_VAD: if (win_mode) { rgb_matrix_decrease_val_noeeprom(); - user_colors_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 09b224954f7f..daa01a0b23b5 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -17,48 +17,41 @@ #include QMK_KEYBOARD_H #include "keymap_user_config.h" -typedef union { - uint32_t raw; - struct { +typedef struct { bool caps_lock_light_tab :1; bool caps_lock_light_alphas :1; bool fn_layer_transparent_keys_off :1; bool fn_layer_color_enable :1; - }; -} user_config_t; - -user_config_t user_config; - -typedef struct { HSV hsv_win_base; HSV hsv_mac_fn1; HSV hsv_win_fn1; HSV hsv_fn2; -} user_colors_t; +} user_config_t; -user_colors_t user_colors; +user_config_t user_config; void eeconfig_init_user(void) { - user_config.raw = 0; user_config.caps_lock_light_tab = false; user_config.caps_lock_light_alphas = true; user_config.fn_layer_transparent_keys_off = false; user_config.fn_layer_color_enable = true; - eeconfig_update_user(user_config.raw); - user_colors.hsv_win_base.h = HUE_WIN_BASE; - user_colors.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; - user_colors.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; + user_config.hsv_win_base.h = HUE_WIN_BASE; + user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; + user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; + + user_config_write_eeprom(); } void user_config_read_eeprom(void) { - user_config.raw = eeconfig_read_user(); + eeconfig_read_user_datablock(&user_config); } void user_config_write_eeprom(void) { - eeconfig_update_user(user_config.raw); + eeconfig_update_user_datablock(&user_config); } +// getters bool user_config_get_caps_lock_light_tab(void) { return user_config.caps_lock_light_tab; } @@ -75,67 +68,67 @@ bool user_config_get_fn_layer_color_enable(void) { return user_config.fn_layer_color_enable; } -void user_config_toggle_caps_lock_light_tab(void) { - user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit - user_config_write_eeprom(); +HSV user_config_get_hsv_win_base(void) { + return user_config.hsv_win_base; } -void user_config_toggle_caps_lock_light_alphas(void) { - user_config.caps_lock_light_alphas ^= 1; - user_config_write_eeprom(); +HSV user_config_get_hsv_mac_fn1(void) { + return user_config.hsv_mac_fn1; } -void user_config_toggle_fn_layer_transparent_keys_off(void) { - user_config.fn_layer_transparent_keys_off ^= 1; - user_config_write_eeprom(); +HSV user_config_get_hsv_win_fn1(void) { + return user_config.hsv_win_fn1; } -void user_config_toggle_fn_layer_color_enable(void) { - user_config.fn_layer_color_enable ^= 1; - user_config_write_eeprom(); +HSV user_config_get_hsv_fn2(void) { + return user_config.hsv_fn2; } -void user_colors_read_eeprom(void) { - eeconfig_read_user_datablock(&user_colors); +// setters +void user_config_set_hsv_win_base(HSV hsv) { + user_config.hsv_win_base = hsv; + user_config_write_eeprom(); } -void user_colors_write_eeprom(void) { - eeconfig_update_user_datablock(&user_colors); +void user_config_set_hsv_mac_fn1(HSV hsv) { + user_config.hsv_mac_fn1 = hsv; + user_config_write_eeprom(); } -HSV user_colors_get_hsv_win_base(void) { - return user_colors.hsv_win_base; +void user_config_set_hsv_win_fn1(HSV hsv) { + user_config.hsv_win_fn1 = hsv; + user_config_write_eeprom(); } -HSV user_colors_get_hsv_mac_fn1(void) { - return user_colors.hsv_mac_fn1; +void user_config_set_hsv_fn2(HSV hsv) { + user_config.hsv_fn2 = hsv; + user_config_write_eeprom(); } -HSV user_colors_get_hsv_win_fn1(void) { - return user_colors.hsv_win_fn1; +// toggles +void user_config_toggle_caps_lock_light_tab(void) { + user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit + user_config_write_eeprom(); } -HSV user_colors_get_hsv_fn2(void) { - return user_colors.hsv_fn2; +void user_config_toggle_caps_lock_light_alphas(void) { + user_config.caps_lock_light_alphas ^= 1; + user_config_write_eeprom(); } -void user_colors_set_hsv_win_base(HSV hsv) { - user_colors.hsv_win_base = hsv; - user_colors_write_eeprom(); +void user_config_toggle_fn_layer_transparent_keys_off(void) { + user_config.fn_layer_transparent_keys_off ^= 1; + user_config_write_eeprom(); } -void user_colors_set_hsv_mac_fn1(HSV hsv) { - user_colors.hsv_mac_fn1 = hsv; - user_colors_write_eeprom(); +void user_config_toggle_fn_layer_color_enable(void) { + user_config.fn_layer_color_enable ^= 1; + user_config_write_eeprom(); } -void user_colors_set_hsv_win_fn1(HSV hsv) { - user_colors.hsv_win_fn1 = hsv; - user_colors_write_eeprom(); -} -void user_colors_set_hsv_fn2(HSV hsv) { - user_colors.hsv_fn2 = hsv; - user_colors_write_eeprom(); -} + + + + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index 9996747b894a..cf3562c4d6f9 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -18,22 +18,22 @@ void user_config_read_eeprom(void); void user_config_write_eeprom(void); + bool user_config_get_caps_lock_light_tab(void); bool user_config_get_caps_lock_light_alphas(void); bool user_config_get_fn_layer_transparent_keys_off(void); bool user_config_get_fn_layer_color_enable(void); +HSV user_config_get_hsv_win_base(void); +HSV user_config_get_hsv_mac_fn1(void); +HSV user_config_get_hsv_win_fn1(void); +HSV user_config_get_hsv_fn2(void); + +void user_config_set_hsv_win_base(HSV hsv); +void user_config_set_hsv_mac_fn1(HSV hsv); +void user_config_set_hsv_win_fn1(HSV hsv); +void user_config_set_hsv_fn2(HSV hsv); + void user_config_toggle_caps_lock_light_tab(void); void user_config_toggle_caps_lock_light_alphas(void); void user_config_toggle_fn_layer_transparent_keys_off(void); void user_config_toggle_fn_layer_color_enable(void); - -void user_colors_read_eeprom(void); -void user_colors_write_eeprom(void); -HSV user_colors_get_hsv_win_base(void); -HSV user_colors_get_hsv_mac_fn1(void); -HSV user_colors_get_hsv_win_fn1(void); -HSV user_colors_get_hsv_fn2(void); -void user_colors_set_hsv_win_base(HSV hsv); -void user_colors_set_hsv_mac_fn1(HSV hsv); -void user_colors_set_hsv_win_fn1(HSV hsv); -void user_colors_set_hsv_fn2(HSV hsv); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 36f037feb1d9..db642e94a50c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -43,9 +43,9 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { #ifdef HUE_WIN_BASE if (is_win_mode()) { win_mode_was_activated = true; - rgb_matrix_sethsv_noeeprom(user_colors_get_hsv_win_base.h, - user_colors_get_hsv_win_base.s, - user_colors_get_hsv_win_base.h); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); } else { if (win_mode_was_activated) { win_mode_was_activated = false; From 91c4a8b66c9e8b004da0b913f585eadc182a1b83 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 6 Apr 2023 14:44:17 -0400 Subject: [PATCH 048/160] added separate Mac base / Win base RGB mode and speed --- .../ansi_encoder/keymaps/mkillewald/config.h | 11 ++-- .../ansi_encoder/keymaps/mkillewald/keymap.c | 34 ++++++++++- .../keymaps/mkillewald/keymap_user_config.c | 60 +++++++++++++------ .../keymaps/mkillewald/keymap_user_config.h | 21 +++++-- .../keymaps/mkillewald/rgb_matrix_user.c | 12 ++-- 5 files changed, 106 insertions(+), 32 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 7c8a03c28067..31054ae24cbf 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -16,7 +16,7 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 13 +#define EECONFIG_USER_DATA_SIZE 15 #ifdef CAPS_WORD_ENABLE # define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD @@ -25,12 +25,15 @@ #endif #ifdef RGB_MATRIX_ENABLE -# define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 -# define FN2_LAYER_COLOR RGB_YELLOW # define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING +# define RGB_MATRIX_DEFAULT_SPD 127 # define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue # define RGB_MATRIX_DEFAULT_SAT 255 # define RGB_MATRIX_DEFAULT_VAL 255 + # define HUE_WIN_BASE 80 // HSV green hue + +# define CAPS_LOCK_INDICATOR_COLOR RGB_RED +# define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange +# define FN2_LAYER_COLOR RGB_YELLOW #endif \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index eba04f20bb05..0bb9274a50c7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -157,10 +157,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { rgb_matrix_disable_noeeprom(); bootloader_state = BOOTLOADER_PRESSED; return false; // Skip all further processing of this key + case RGB_MOD: + if (win_mode) { + // need to fix mode indexing, currently hosed + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_step_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_RMOD: + if (win_mode) { + // need to fix mode indexing, currently hosed + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_step_reverse_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key case RGB_HUI: if (win_mode) { rgb_matrix_increase_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + user_config_set_mode_win_base(rgb_matrix_get_mode()); return false; // Skip all further processing of this key } return true; // Allow further processing of this key @@ -199,6 +217,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; // Skip all further processing of this key } return true; // Allow further processing of this key + case RGB_SPI: + if (win_mode) { + rgb_matrix_increase_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key + case RGB_SPD: + if (win_mode) { + rgb_matrix_decrease_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + return false; // Skip all further processing of this key + } + return true; // Allow further processing of this key #endif // RGB_MATRIX_ENABLE case KC_LIGHT_TAB_TOGGLE: if (record->event.pressed) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index daa01a0b23b5..0f09d77694d1 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -22,6 +22,8 @@ typedef struct { bool caps_lock_light_alphas :1; bool fn_layer_transparent_keys_off :1; bool fn_layer_color_enable :1; + uint8_t mode_win_base; + uint8_t spd_win_base; HSV hsv_win_base; HSV hsv_mac_fn1; HSV hsv_win_fn1; @@ -35,6 +37,9 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_alphas = true; user_config.fn_layer_transparent_keys_off = false; user_config.fn_layer_color_enable = true; + + user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; + user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = HUE_WIN_BASE; user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; @@ -52,6 +57,7 @@ void user_config_write_eeprom(void) { } // getters + bool user_config_get_caps_lock_light_tab(void) { return user_config.caps_lock_light_tab; } @@ -68,6 +74,14 @@ bool user_config_get_fn_layer_color_enable(void) { return user_config.fn_layer_color_enable; } +uint8_t user_config_get_mode_win_base(void) { + return user_config.mode_win_base; +} + +uint8_t user_config_get_spd_win_base(void) { + return user_config.spd_win_base; +} + HSV user_config_get_hsv_win_base(void) { return user_config.hsv_win_base; } @@ -85,47 +99,59 @@ HSV user_config_get_hsv_fn2(void) { } // setters -void user_config_set_hsv_win_base(HSV hsv) { - user_config.hsv_win_base = hsv; + +void user_config_toggle_caps_lock_light_tab(void) { + user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit user_config_write_eeprom(); } -void user_config_set_hsv_mac_fn1(HSV hsv) { - user_config.hsv_mac_fn1 = hsv; +void user_config_toggle_caps_lock_light_alphas(void) { + user_config.caps_lock_light_alphas ^= 1; user_config_write_eeprom(); } -void user_config_set_hsv_win_fn1(HSV hsv) { - user_config.hsv_win_fn1 = hsv; +void user_config_toggle_fn_layer_transparent_keys_off(void) { + user_config.fn_layer_transparent_keys_off ^= 1; user_config_write_eeprom(); } -void user_config_set_hsv_fn2(HSV hsv) { - user_config.hsv_fn2 = hsv; +void user_config_toggle_fn_layer_color_enable(void) { + user_config.fn_layer_color_enable ^= 1; user_config_write_eeprom(); } -// toggles -void user_config_toggle_caps_lock_light_tab(void) { - user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit +void user_config_set_mode_win_base(uint8_t mode) { + user_config.mode_win_base = mode; user_config_write_eeprom(); } -void user_config_toggle_caps_lock_light_alphas(void) { - user_config.caps_lock_light_alphas ^= 1; +void user_config_set_spd_win_base(uint8_t spd) { + user_config.spd_win_base = spd; user_config_write_eeprom(); } -void user_config_toggle_fn_layer_transparent_keys_off(void) { - user_config.fn_layer_transparent_keys_off ^= 1; +void user_config_set_hsv_win_base(HSV hsv) { + user_config.hsv_win_base = hsv; user_config_write_eeprom(); } -void user_config_toggle_fn_layer_color_enable(void) { - user_config.fn_layer_color_enable ^= 1; +void user_config_set_hsv_mac_fn1(HSV hsv) { + user_config.hsv_mac_fn1 = hsv; user_config_write_eeprom(); } +void user_config_set_hsv_win_fn1(HSV hsv) { + user_config.hsv_win_fn1 = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_fn2(HSV hsv) { + user_config.hsv_fn2 = hsv; + user_config_write_eeprom(); +} + + + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index cf3562c4d6f9..a92645407031 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -19,21 +19,34 @@ void user_config_read_eeprom(void); void user_config_write_eeprom(void); +// getters + bool user_config_get_caps_lock_light_tab(void); bool user_config_get_caps_lock_light_alphas(void); bool user_config_get_fn_layer_transparent_keys_off(void); bool user_config_get_fn_layer_color_enable(void); + +uint8_t user_config_get_mode_win_base(void); +uint8_t user_config_get_spd_win_base(void); + HSV user_config_get_hsv_win_base(void); HSV user_config_get_hsv_mac_fn1(void); HSV user_config_get_hsv_win_fn1(void); HSV user_config_get_hsv_fn2(void); -void user_config_set_hsv_win_base(HSV hsv); -void user_config_set_hsv_mac_fn1(HSV hsv); -void user_config_set_hsv_win_fn1(HSV hsv); -void user_config_set_hsv_fn2(HSV hsv); +// setters void user_config_toggle_caps_lock_light_tab(void); void user_config_toggle_caps_lock_light_alphas(void); void user_config_toggle_fn_layer_transparent_keys_off(void); void user_config_toggle_fn_layer_color_enable(void); + +void user_config_set_mode_win_base(uint8_t mode); +void user_config_set_spd_win_base(uint8_t spd); + +void user_config_set_hsv_win_base(HSV hsv); +void user_config_set_hsv_mac_fn1(HSV hsv); +void user_config_set_hsv_win_fn1(HSV hsv); +void user_config_set_hsv_fn2(HSV hsv); + + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index db642e94a50c..fbee75721204 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -41,16 +41,16 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { case MAC_BASE: case WIN_BASE: #ifdef HUE_WIN_BASE - if (is_win_mode()) { + if (is_win_mode() && !win_mode_was_activated) { win_mode_was_activated = true; + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, user_config_get_hsv_win_base().s, user_config_get_hsv_win_base().v); - } else { - if (win_mode_was_activated) { - win_mode_was_activated = false; - rgb_matrix_reload_from_eeprom(); - } + } else if (!is_win_mode() && win_mode_was_activated) { + win_mode_was_activated = false; + rgb_matrix_reload_from_eeprom(); } #endif #ifdef CAPS_LOCK_INDICATOR_COLOR From d389ea2aedf364289b44ccb4d062e635e40f3b49 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 12:22:59 -0400 Subject: [PATCH 049/160] version 2.0.0 SEVERED! Different RGB settings for Mac/Win base layers --- .../ansi_encoder/keymaps/mkillewald/config.h | 5 +- .../ansi_encoder/keymaps/mkillewald/keymap.c | 76 +++++++++++-------- .../keymaps/mkillewald/keymap_user_config.c | 10 +-- .../ansi_encoder/keymaps/mkillewald/readme.md | 22 ++++-- .../keymaps/mkillewald/rgb_matrix_user.c | 2 - 5 files changed, 67 insertions(+), 48 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 31054ae24cbf..46bee997b6d4 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -27,12 +27,11 @@ #ifdef RGB_MATRIX_ENABLE # define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING # define RGB_MATRIX_DEFAULT_SPD 127 -# define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue +# define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) +# define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) # define RGB_MATRIX_DEFAULT_SAT 255 # define RGB_MATRIX_DEFAULT_VAL 255 -# define HUE_WIN_BASE 80 // HSV green hue - # define CAPS_LOCK_INDICATOR_COLOR RGB_RED # define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange # define FN2_LAYER_COLOR RGB_YELLOW diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 0bb9274a50c7..fb52cf440beb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -24,14 +24,12 @@ // clang-format off -#ifdef RGB_MATRIX_ENABLE enum my_bootloader_state { BOOTLOADER_INACTIVE, BOOTLOADER_PRESSED, BOOTLOADER_WAIT, BOOTLOADER_DO } bootloader_state; -#endif enum my_keycodes { KC_LIGHT_TAB_TOGGLE = QK_USER_0, @@ -112,7 +110,6 @@ void keyboard_post_init_user(void) { } void housekeeping_task_user(void) { -#ifdef RGB_MATRIX_ENABLE switch(bootloader_state) { case BOOTLOADER_DO: // bootloader was pressed two frames ago. RGB should now be off, @@ -134,7 +131,6 @@ void housekeeping_task_user(void) { default: break; } -#endif housekeeping_task_keychron(); } @@ -149,89 +145,105 @@ bool is_win_mode(void) { return win_mode; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { -#ifdef RGB_MATRIX_ENABLE case QK_BOOT: // We want to turn off LEDs before calling bootloader, so here // we call rgb_matrix_disable_noeeprom() and set a flag because // the LEDs won't be updated until the next frame. - rgb_matrix_disable_noeeprom(); - bootloader_state = BOOTLOADER_PRESSED; + if (record->event.pressed) { + rgb_matrix_disable_noeeprom(); + bootloader_state = BOOTLOADER_PRESSED; + } return false; // Skip all further processing of this key case RGB_MOD: if (win_mode) { - // need to fix mode indexing, currently hosed - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_step_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); + if (record->event.pressed) { + rgb_matrix_step_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_RMOD: if (win_mode) { - // need to fix mode indexing, currently hosed - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_step_reverse_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); + if (record->event.pressed) { + rgb_matrix_step_reverse_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_HUI: if (win_mode) { - rgb_matrix_increase_hue_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); + if (record->event.pressed) { + rgb_matrix_increase_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_HUD: if (win_mode) { - rgb_matrix_decrease_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + if (record->event.pressed) { + rgb_matrix_decrease_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_SAI: if (win_mode) { - rgb_matrix_increase_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + if (record->event.pressed) { + rgb_matrix_increase_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_SAD: if (win_mode) { - rgb_matrix_decrease_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + if (record->event.pressed) { + rgb_matrix_decrease_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_VAI: if (win_mode) { - rgb_matrix_increase_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + if (record->event.pressed) { + rgb_matrix_increase_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_VAD: if (win_mode) { - rgb_matrix_decrease_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + if (record->event.pressed) { + rgb_matrix_decrease_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_SPI: if (win_mode) { - rgb_matrix_increase_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); + if (record->event.pressed) { + rgb_matrix_increase_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key case RGB_SPD: if (win_mode) { - rgb_matrix_decrease_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); + if (record->event.pressed) { + rgb_matrix_decrease_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } return false; // Skip all further processing of this key } return true; // Allow further processing of this key -#endif // RGB_MATRIX_ENABLE case KC_LIGHT_TAB_TOGGLE: if (record->event.pressed) { user_config_toggle_caps_lock_light_tab(); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 0f09d77694d1..05d56ba822cd 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -18,10 +18,10 @@ #include "keymap_user_config.h" typedef struct { - bool caps_lock_light_tab :1; - bool caps_lock_light_alphas :1; - bool fn_layer_transparent_keys_off :1; - bool fn_layer_color_enable :1; + bool caps_lock_light_tab; + bool caps_lock_light_alphas; + bool fn_layer_transparent_keys_off; + bool fn_layer_color_enable; uint8_t mode_win_base; uint8_t spd_win_base; HSV hsv_win_base; @@ -41,7 +41,7 @@ void eeconfig_init_user(void) { user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; - user_config.hsv_win_base.h = HUE_WIN_BASE; + user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 86f7ff587705..9510d7dc6538 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,13 +1,21 @@ -## Keychron Q2 ANSI STM32L432 ENC11 (with knob) Keymap v1.0.1 +## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0.0 -## This is my personal build with custom layout changes and different base layer LED colors +## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cord, this should reset your eeprom. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- Different hues set for Mac Base and Win Base layers in config.h - - Set Mac Base hue using HUE_MAC_BASE in config.h - - Set Win Base hue using HUE_WIN_BASE in config.h +- SEVERED! Different RGB settings for Mac Base and Win Base layers + - You can set different animations, colors, brightness and speed for each base layer using the standard RGB keyboard shortcuts + + - There following default settings can be changed in config.h (these defaults will be applied when the eeprom is reset): + + #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING + #define RGB_MATRIX_DEFAULT_SPD 127 + #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) + #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_SAT 255 + #define RGB_MATRIX_DEFAULT_VAL 255 - Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) - Activated by double tapping left Shift @@ -78,8 +86,10 @@ It seems Keychron has not pushed the relavant code to the main QMK repo yet. I s ## Changelog: +v2.0.0 April 7, 2023 +- added different RGB settings for Mac Base and Win Base layers + v1.0.1 April 4, 2023 -- added different hue for Mac Base and Win Base layers - made requested changes by QMK reveiwers - removed optional .json file and baked my layout changes into the firmware diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index fbee75721204..11cd816fced6 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -40,7 +40,6 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: -#ifdef HUE_WIN_BASE if (is_win_mode() && !win_mode_was_activated) { win_mode_was_activated = true; rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); @@ -52,7 +51,6 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { win_mode_was_activated = false; rgb_matrix_reload_from_eeprom(); } -#endif #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); From b996358f0ad34882e7b1480a3dd0b4983b687f99 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 12:26:31 -0400 Subject: [PATCH 050/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 9510d7dc6538..0fdb0aba9598 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ -## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0.0 +## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0. -## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cord, this should reset your eeprom. +## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should reset your eeprom. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. @@ -10,12 +10,14 @@ - There following default settings can be changed in config.h (these defaults will be applied when the eeprom is reset): +``` #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING #define RGB_MATRIX_DEFAULT_SPD 127 #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 - #define RGB_MATRIX_DEFAULT_VAL 255 + #define RGB_MATRIX_DEFAULT_VAL 25 +``` - Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) - Activated by double tapping left Shift From 125a5318de1c202155338da6b3cb650363a8b069 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 12:36:24 -0400 Subject: [PATCH 051/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 0fdb0aba9598..9e5f8b44c5f3 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -19,6 +19,11 @@ #define RGB_MATRIX_DEFAULT_VAL 25 ``` +- Autocorrect is enabled ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) + - Use Fn1+Shift to toggle it on/off. + - Uses getreuer's 400 entry library + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) + - Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) - Activated by double tapping left Shift - can change activation to tapping both left and right Shift by replacing define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD with #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD in config.h From 1d09927a53bccf0c1e1b3326698a5a3d119993ec Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 12:37:22 -0400 Subject: [PATCH 052/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 9e5f8b44c5f3..be1423e83899 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,4 +1,4 @@ -## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0. +## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0.0 ## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should reset your eeprom. From 16c95b0f590af98e30b12d8f29f2ef06a555fdfc Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:34:15 -0400 Subject: [PATCH 053/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index be1423e83899..c1768334ba50 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -19,6 +19,8 @@ #define RGB_MATRIX_DEFAULT_VAL 25 ``` + - Note: RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. + - Autocorrect is enabled ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Use Fn1+Shift to toggle it on/off. - Uses getreuer's 400 entry library @@ -35,14 +37,14 @@ - the Caps Lock key will light when Caps Lock is enabled with the following options: - #define CAPS_LOCK_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Lock is enabled (default: red) - Fn2+Z (keycode: LTTOG) will toggle lighting the TAB key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. (default: off) - - Fn2+X (keycode: LATOG) will toggle lighting all the alpha keys when Caps Lock is enabled. (default: off) + - Fn2+X (keycode: LATOG) will toggle lighting all the alpha keys when Caps Lock is enabled. (default: on) - Dynamic Fn layer RGB indicator - When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted with the following options: - #define FN1_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn1 layer (default: orange) - - #define FN2_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn2 layer (default: green) + - #define FN2_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn2 layer (default: yellow) - Fn2+C (keycode: TKTOG) will toggle turning off RGB for keys with no definition (default: RGB off) - - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color off) + - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color on) All custom keycodes described in this readme can be moved to different keys in VIA by using the following keycodes: - CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle From 64209db91ddba69887cea10f6d6406ccf5afb8b4 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:35:31 -0400 Subject: [PATCH 054/160] disabled RGB toggle when keyboard mode switch is set to Win mode due to issues with Win mode settings creeping into Mac mode settings if RGB was toggled when on Win mode --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 59 ++++++++++++------- .../keymaps/mkillewald/keymap_user_config.c | 3 - .../keymaps/mkillewald/keymap_user_config.h | 6 +- .../keymaps/mkillewald/rgb_matrix_user.c | 6 ++ 4 files changed, 46 insertions(+), 28 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index fb52cf440beb..dcf29e8f3857 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -154,6 +154,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bootloader_state = BOOTLOADER_PRESSED; } return false; // Skip all further processing of this key + case RGB_TOG: + if (win_mode) { + if (record->event.pressed) { + // disable RGB toggle if switch is on Win mode + return false; // Skip all further processing of this key + } + } else { + return true; // Allow further processing of this key + } case RGB_MOD: if (win_mode) { if (record->event.pressed) { @@ -161,8 +170,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_mode_win_base(rgb_matrix_get_mode()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_RMOD: if (win_mode) { if (record->event.pressed) { @@ -170,8 +180,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_mode_win_base(rgb_matrix_get_mode()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_HUI: if (win_mode) { if (record->event.pressed) { @@ -179,8 +190,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_hsv_win_base(rgb_matrix_get_hsv()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_HUD: if (win_mode) { if (record->event.pressed) { @@ -188,8 +200,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_hsv_win_base(rgb_matrix_get_hsv()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_SAI: if (win_mode) { if (record->event.pressed) { @@ -197,8 +210,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_hsv_win_base(rgb_matrix_get_hsv()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_SAD: if (win_mode) { if (record->event.pressed) { @@ -206,8 +220,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_hsv_win_base(rgb_matrix_get_hsv()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_VAI: if (win_mode) { if (record->event.pressed) { @@ -215,8 +230,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_hsv_win_base(rgb_matrix_get_hsv()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_VAD: if (win_mode) { if (record->event.pressed) { @@ -224,8 +240,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_hsv_win_base(rgb_matrix_get_hsv()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_SPI: if (win_mode) { if (record->event.pressed) { @@ -233,8 +250,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_spd_win_base(rgb_matrix_get_speed()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case RGB_SPD: if (win_mode) { if (record->event.pressed) { @@ -242,8 +260,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { user_config_set_spd_win_base(rgb_matrix_get_speed()); } return false; // Skip all further processing of this key - } - return true; // Allow further processing of this key + } else { + return true; // Allow further processing of this key + } case KC_LIGHT_TAB_TOGGLE: if (record->event.pressed) { user_config_toggle_caps_lock_light_tab(); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 05d56ba822cd..4cfdf33c77b6 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -37,14 +37,11 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_alphas = true; user_config.fn_layer_transparent_keys_off = false; user_config.fn_layer_color_enable = true; - user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; - user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; - user_config_write_eeprom(); } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index a92645407031..8adf82a0650b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -25,25 +25,21 @@ bool user_config_get_caps_lock_light_tab(void); bool user_config_get_caps_lock_light_alphas(void); bool user_config_get_fn_layer_transparent_keys_off(void); bool user_config_get_fn_layer_color_enable(void); - uint8_t user_config_get_mode_win_base(void); uint8_t user_config_get_spd_win_base(void); - HSV user_config_get_hsv_win_base(void); HSV user_config_get_hsv_mac_fn1(void); HSV user_config_get_hsv_win_fn1(void); HSV user_config_get_hsv_fn2(void); -// setters +// setters void user_config_toggle_caps_lock_light_tab(void); void user_config_toggle_caps_lock_light_alphas(void); void user_config_toggle_fn_layer_transparent_keys_off(void); void user_config_toggle_fn_layer_color_enable(void); - void user_config_set_mode_win_base(uint8_t mode); void user_config_set_spd_win_base(uint8_t spd); - void user_config_set_hsv_win_base(HSV hsv); void user_config_set_hsv_mac_fn1(HSV hsv); void user_config_set_hsv_win_fn1(HSV hsv); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 11cd816fced6..c4ecb5da0c84 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -41,14 +41,20 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { case MAC_BASE: case WIN_BASE: if (is_win_mode() && !win_mode_was_activated) { + // switch was moved to win mode win_mode_was_activated = true; + + // load win base settings rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, user_config_get_hsv_win_base().s, user_config_get_hsv_win_base().v); } else if (!is_win_mode() && win_mode_was_activated) { + // switch was moved to mac mode win_mode_was_activated = false; + + // load mac base settings rgb_matrix_reload_from_eeprom(); } #ifdef CAPS_LOCK_INDICATOR_COLOR From 585bd5a40b3f963282316afb3a74e7e6fb1c71d8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:36:34 -0400 Subject: [PATCH 055/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index c1768334ba50..e15c4c1c09bb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -17,7 +17,7 @@ #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 #define RGB_MATRIX_DEFAULT_VAL 25 -``` +``` - Note: RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. From 648dd22d64e2e91199e4e9a791cb220808ceb492 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:39:23 -0400 Subject: [PATCH 056/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index e15c4c1c09bb..c0b1e25e43b2 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0.0 -## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should reset your eeprom. +## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. @@ -19,7 +19,7 @@ #define RGB_MATRIX_DEFAULT_VAL 25 ``` - - Note: RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. +Note: RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. - Autocorrect is enabled ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Use Fn1+Shift to toggle it on/off. From 814dd182fa0ead552edd46ee0c580338d175958d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:43:30 -0400 Subject: [PATCH 057/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index c0b1e25e43b2..a4ad08989b7a 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -65,7 +65,10 @@ Please make sure to save any customizations you have made in VIA to a .json file - Fn1+Q will lock and sleep display - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation - + + Note: display rotation requires additional software and changes made, see this link for more information: + [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + - Fn2+Backspace enters DFU mode (but does not reset eeprom) - Uses Grave Escape on key to the left of the 1 key: From 1479248e3d60669e40000a6a55981d7fbd8e4fc0 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:43:55 -0400 Subject: [PATCH 058/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index a4ad08989b7a..67cecd581b8f 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -66,7 +66,7 @@ Please make sure to save any customizations you have made in VIA to a .json file - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation - Note: display rotation requires additional software and changes made, see this link for more information: + Note: display rotation requires additional software and changes made, see this link for more information: [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) - Fn2+Backspace enters DFU mode (but does not reset eeprom) From b6046d9de1c2fd37b8228669fc4753740a18aa70 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 7 Apr 2023 14:45:57 -0400 Subject: [PATCH 059/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 67cecd581b8f..337b6089e2d7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -23,7 +23,7 @@ Note: RGB mode can only be toggled on/off when keyboard mode switch set to Mac. - Autocorrect is enabled ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Use Fn1+Shift to toggle it on/off. - - Uses getreuer's 400 entry library + - Uses getreuer's 400 entry autocorrect dictionary [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) - Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) From c845804a8d5bf4528e34aeabac3f2e53d67173fa Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 11:42:04 -0400 Subject: [PATCH 060/160] revamped readme to be less confusing --- .../ansi_encoder/keymaps/mkillewald/readme.md | 141 +++++++++++------- 1 file changed, 84 insertions(+), 57 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 337b6089e2d7..c19257f2b6c3 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,75 +1,87 @@ -## Keychron Q2 SVR'd RGB ANSI STM32L432 ENC11 (with knob) Keymap v2.0.0 +## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.0 -## Highly Recommended: you should clear your eeprom before or after flashing this firmware. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom. +### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- SEVERED! Different RGB settings for Mac Base and Win Base layers - - You can set different animations, colors, brightness and speed for each base layer using the standard RGB keyboard shortcuts +- SEVERED! Different RGB settings for Mac Base and Win Base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) - - There following default settings can be changed in config.h (these defaults will be applied when the eeprom is reset): +- Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) + - Uses getreuer's 400 entry autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) + +- Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) + +- Caps Lock RGB indicator. Will light Caps Lock key with options to also light Tab key (useful for some keycap sets), and/or light all alpha keys. + +- Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. + +##### Notes: + +###### RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. +###### Toggling RGB mode off will disable RGB for all layers and indicators. RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off for each base layer. The indicators will remain at full brightness. + + +## Config.h options + +Default options (these defaults will be applied whenever the eeprom is cleared): ``` - #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING - #define RGB_MATRIX_DEFAULT_SPD 127 - #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) - #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) - #define RGB_MATRIX_DEFAULT_SAT 255 - #define RGB_MATRIX_DEFAULT_VAL 25 + #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable + #define DEFAULT_FN_LAYER_COLOR true // true=enable, false=disable + #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) + #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_VAL 25 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers + ``` -Note: RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. - -- Autocorrect is enabled ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - - Use Fn1+Shift to toggle it on/off. - - Uses getreuer's 400 entry autocorrect dictionary - [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) - -- Caps Word enabled with RGB indicator ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) - - Activated by double tapping left Shift - - can change activation to tapping both left and right Shift by replacing define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD with #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD in config.h - - Left Shift, left Control and left Option (or left Windows key) will light when Caps Word is enabled - - #define CAPS_WORD_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Word is enabled (default: red) - - remove #define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER from config.h if you wish for the indicator to only light left Shift - -- Caps Lock RGB indicator - - the Caps Lock key will light when Caps Lock is enabled with the following options: - - #define CAPS_LOCK_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Lock is enabled (default: red) - - Fn2+Z (keycode: LTTOG) will toggle lighting the TAB key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. (default: off) - - Fn2+X (keycode: LATOG) will toggle lighting all the alpha keys when Caps Lock is enabled. (default: on) - -- Dynamic Fn layer RGB indicator - - When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted with the following options: - - #define FN1_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn1 layer (default: orange) - - #define FN2_LAYER_COLOR [color] in config.h to set a static color for defined keys on Fn2 layer (default: yellow) - - Fn2+C (keycode: TKTOG) will toggle turning off RGB for keys with no definition (default: RGB off) - - Fn2+V (keycode: FCTOG) will toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR (default: static color on) - -All custom keycodes described in this readme can be moved to different keys in VIA by using the following keycodes: -- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle -- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle -- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Toggle -- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle -- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac +Caps Lock RGB indicator option: +``` + #define CAPS_LOCK_INDICATOR_COLOR RGB_RED +``` + +Dynamic Fn Layer RGB indicator options: +``` + #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange + #define FN2_LAYER_COLOR RGB_YELLOW +``` -RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. +Caps Word options: -Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the custom keycodes back in. +``` + // Caps Word is activated by double-tapping left Shift. Replace this with + // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word + // by single-tapping both left and right Shift togeter. + #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_RED + + // Caps Word will light left Shift, left Control and left Option (or left Windows + // key) when acitvated. Remove this line if you want Caps Word to only light left + // Shift when enabled. + #define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER +``` -## This keymap also makes the following layout changes over the factory firmware +## This keymap makes the following layout changes over the factory firmware - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - -- Mac mode - - Fn1+Q will lock and sleep display - - Fn1+< sets my secondary display to 0° rotation - - Fn1+> sets my secondary display to 90° rotation - - Note: display rotation requires additional software and changes made, see this link for more information: - [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) - +- Fn2+Left Shift toggles Autocorrect on/off - Fn2+Backspace enters DFU mode (but does not reset eeprom) +- Fn2+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) + - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. +- Fn2+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) + - toggle lighting all the alpha keys when Caps Lock is enabled. +- Fn2+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) + - toggle turning off RGB for keys with no definition +- Fn2+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR - Uses Grave Escape on key to the left of the 1 key: - Base Layer: key functions as ESC, shift+key gives ~ @@ -86,6 +98,21 @@ Please make sure to save any customizations you have made in VIA to a .json file - Fn1 Layer: zoom in, out Press: return to 100% zoom - Fn2 Layer: LED brighness inc, dec Press: backlight toggle +- Mac mode only + - Fn1+Q (KC_LBMAC) will lock and sleep display + - Fn1+< sets my secondary display to 0° rotation + - Fn1+> sets my secondary display to 90° rotation + + Note: display rotation requires additional software and changes made, see this link for more information: + [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + +All custom keycodes can be moved to different keys in VIA by using the following: +- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Off Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac + ## Known Issues 1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working @@ -106,4 +133,4 @@ v1.0.1 April 4, 2023 - removed optional .json file and baked my layout changes into the firmware v1.0.0 March 19, 2023 -- Carried over features from my Q1V2 keymap. \ No newline at end of file +- Carried over features from my Q1V2 keymap. From a4d8885d748b220d36f847dc89cfa4e11642fa18 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 11:47:27 -0400 Subject: [PATCH 061/160] code cleanup/reorg --- .../ansi_encoder/keymaps/mkillewald/config.h | 53 ++++++++++++------- .../ansi_encoder/keymaps/mkillewald/keymap.c | 4 +- .../keymaps/mkillewald/keymap_user_config.c | 8 +-- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 46bee997b6d4..b210a36c4920 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -16,23 +16,36 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 15 - -#ifdef CAPS_WORD_ENABLE -# define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD -# define CAPS_WORD_INDICATOR_COLOR RGB_RED -# define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER -#endif - -#ifdef RGB_MATRIX_ENABLE -# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING -# define RGB_MATRIX_DEFAULT_SPD 127 -# define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) -# define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) -# define RGB_MATRIX_DEFAULT_SAT 255 -# define RGB_MATRIX_DEFAULT_VAL 255 - -# define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange -# define FN2_LAYER_COLOR RGB_YELLOW -#endif \ No newline at end of file +#define EECONFIG_USER_DATA_SIZE 15 // size of eeprom data, do not change. + +// default options applied when eeprom is cleared +#define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable +#define DEFAULT_FN_LAYER_COLOR true // true=enable, false=disable +#define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) +#define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) +#define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_VAL 25 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers + +// Caps Lock RGB indicator color +#define CAPS_LOCK_INDICATOR_COLOR RGB_RED + +// Dynamic Fn Layer RGB indicator options +#define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange +#define FN2_LAYER_COLOR RGB_YELLOW + +// Caps Word is activated by double-tapping left Shift. Replace this with +// #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word +// by single-tapping both left and right Shift togeter. +#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_RED + +// Caps Word will light left Shift, left Control and left Option (or left Windows +// key) when acitvated. Remove this line if you want Caps Word to only light left +// Shift when enabled. +#define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index dcf29e8f3857..ca07ea935a94 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -157,7 +157,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case RGB_TOG: if (win_mode) { if (record->event.pressed) { - // disable RGB toggle if switch is on Win mode + // disables RGB toggle if switch is on Win mode. If RGB is toggled + // off while on win mode, it can cause Win mode RGB settings to + // overwrite the Mac mode RGB settings. return false; // Skip all further processing of this key } } else { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 4cfdf33c77b6..61bb3cc9a63c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -33,10 +33,10 @@ typedef struct { user_config_t user_config; void eeconfig_init_user(void) { - user_config.caps_lock_light_tab = false; - user_config.caps_lock_light_alphas = true; - user_config.fn_layer_transparent_keys_off = false; - user_config.fn_layer_color_enable = true; + user_config.caps_lock_light_tab = DEFAULT_CAPS_LOCK_LIGHT_TAB; + user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; + user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; + user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_COLOR; user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; From 16b099189476c1e5fc94ba5dd1c3d3faf203a415 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 11:54:06 -0400 Subject: [PATCH 062/160] moved line up, because ocd --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index b210a36c4920..9d3e3db46530 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -23,8 +23,8 @@ #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable #define DEFAULT_FN_LAYER_COLOR true // true=enable, false=disable -#define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) +#define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_VAL 25 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index c19257f2b6c3..5bc43ba5edb0 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -32,8 +32,8 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable #define DEFAULT_FN_LAYER_COLOR true // true=enable, false=disable - #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_VAL 25 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers From 768a1a86781c76c76f8c6047cab7ff81e02d85bd Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 11:57:38 -0400 Subject: [PATCH 063/160] renamed config option for clarity --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- .../q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c | 2 +- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 9d3e3db46530..bd8358352702 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -22,7 +22,7 @@ #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable -#define DEFAULT_FN_LAYER_COLOR true // true=enable, false=disable +#define DEFAULT_FN_LAYER_SHOW_COLOR true // true=enable, false=disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 61bb3cc9a63c..30098591e4a1 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -36,7 +36,7 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_tab = DEFAULT_CAPS_LOCK_LIGHT_TAB; user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; - user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_COLOR; + user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 5bc43ba5edb0..674df80bdcd2 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -31,7 +31,7 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable - #define DEFAULT_FN_LAYER_COLOR true // true=enable, false=disable + #define DEFAULT_FN_LAYER_SHOW_COLOR true // true=enable, false=disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers From 218b84b06a4345405e98ca70c501cc8a82c0912e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 11:58:27 -0400 Subject: [PATCH 064/160] fixed alignment --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index bd8358352702..ee84b245858c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -22,7 +22,7 @@ #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable -#define DEFAULT_FN_LAYER_SHOW_COLOR true // true=enable, false=disable +#define DEFAULT_FN_LAYER_SHOW_COLOR true // true=enable, false=disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers From d5de11b215b67f8251ff8a8b61411d3680ebb326 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 12:06:30 -0400 Subject: [PATCH 065/160] corrected typo on default brighness from 25 to 255 --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index ee84b245858c..ff1e6cd8f283 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -26,7 +26,7 @@ #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers -#define RGB_MATRIX_DEFAULT_VAL 25 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 674df80bdcd2..714b1ba37bf0 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -35,7 +35,7 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers - #define RGB_MATRIX_DEFAULT_VAL 25 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers From 313a5246419a21d258460d2ff7a1fd89664d1f62 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 12:07:55 -0400 Subject: [PATCH 066/160] added whitespace --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 714b1ba37bf0..b2d3e0de0599 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -42,11 +42,13 @@ Default options (these defaults will be applied whenever the eeprom is cleared): ``` Caps Lock RGB indicator option: + ``` #define CAPS_LOCK_INDICATOR_COLOR RGB_RED ``` Dynamic Fn Layer RGB indicator options: + ``` #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange #define FN2_LAYER_COLOR RGB_YELLOW From b853584b730f666ac32a873bdd0a9925dcdb1ced Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sat, 8 Apr 2023 13:15:12 -0400 Subject: [PATCH 067/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index b2d3e0de0599..d9ce19b56b7c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -19,9 +19,9 @@ ##### Notes: -###### RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. -###### Toggling RGB mode off will disable RGB for all layers and indicators. RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off for each base layer. The indicators will remain at full brightness. - +###### RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. +###### Toggling RGB mode off will disable RGB for all layers and indicators. RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off for each base layer. The indicators will remain at full brightness. +###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. ## Config.h options From f6d7bbe4da47dbe0e22bc51cb735d10e63f37807 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 10 Apr 2023 10:37:33 -0400 Subject: [PATCH 068/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index d9ce19b56b7c..d40034391672 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -5,7 +5,7 @@ ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- SEVERED! Different RGB settings for Mac Base and Win Base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) +- SEVERED! Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Uses getreuer's 400 entry autocorrect dictionary. From 6cc416da2931cab0dfff12bec808a53a9eeae7db Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 10 Apr 2023 12:34:58 -0400 Subject: [PATCH 069/160] enabled RGB toggle for each Mac / Win base layer --- .../ansi_encoder/keymaps/mkillewald/config.h | 18 +++++----- .../ansi_encoder/keymaps/mkillewald/keymap.c | 15 ++++---- .../keymaps/mkillewald/keymap_user_config.c | 22 ++++++++++++ .../keymaps/mkillewald/keymap_user_config.h | 4 +++ .../keymaps/mkillewald/rgb_matrix_user.c | 36 +++++++++++++------ 5 files changed, 69 insertions(+), 26 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index ff1e6cd8f283..d2b035c8d11d 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -16,13 +16,15 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 15 // size of eeprom data, do not change. +#define EECONFIG_USER_DATA_SIZE 17 // size of eeprom data, do not change. // default options applied when eeprom is cleared -#define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable -#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable -#define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable -#define DEFAULT_FN_LAYER_SHOW_COLOR true // true=enable, false=disable +#define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable +#define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable +#define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers @@ -37,9 +39,9 @@ #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange #define FN2_LAYER_COLOR RGB_YELLOW -// Caps Word is activated by double-tapping left Shift. Replace this with -// #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word -// by single-tapping both left and right Shift togeter. +// Caps Word is activated by double-tapping left Shift. Replace this with +// #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word +// by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD // Caps Word RGB indicator color diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index ca07ea935a94..71ba843063af 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -155,16 +155,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; // Skip all further processing of this key case RGB_TOG: - if (win_mode) { - if (record->event.pressed) { - // disables RGB toggle if switch is on Win mode. If RGB is toggled - // off while on win mode, it can cause Win mode RGB settings to - // overwrite the Mac mode RGB settings. - return false; // Skip all further processing of this key + if (record->event.pressed) { + rgb_matrix_toggle_noeeprom(); + if (win_mode) { + user_config_toggle_enable_win_base(); + } else { + user_config_toggle_enable_mac_base(); } - } else { - return true; // Allow further processing of this key } + return false; // Skip all further processing of this key case RGB_MOD: if (win_mode) { if (record->event.pressed) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 30098591e4a1..a15c91712346 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -22,6 +22,8 @@ typedef struct { bool caps_lock_light_alphas; bool fn_layer_transparent_keys_off; bool fn_layer_color_enable; + uint8_t enable_mac_base; + uint8_t enable_win_base; uint8_t mode_win_base; uint8_t spd_win_base; HSV hsv_win_base; @@ -37,6 +39,8 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; + user_config.enable_mac_base = DEFAULT_ENABLE_MAC_BASE; + user_config.enable_win_base = DEFAULT_ENABLE_WIN_BASE; user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; @@ -71,6 +75,14 @@ bool user_config_get_fn_layer_color_enable(void) { return user_config.fn_layer_color_enable; } +uint8_t user_config_get_enable_mac_base(void) { + return user_config.enable_mac_base; +} + +uint8_t user_config_get_enable_win_base(void) { + return user_config.enable_win_base; +} + uint8_t user_config_get_mode_win_base(void) { return user_config.mode_win_base; } @@ -117,6 +129,16 @@ void user_config_toggle_fn_layer_color_enable(void) { user_config_write_eeprom(); } +void user_config_toggle_enable_mac_base(void) { + user_config.enable_mac_base ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_enable_win_base(void) { + user_config.enable_win_base ^= 1; + user_config_write_eeprom(); +} + void user_config_set_mode_win_base(uint8_t mode) { user_config.mode_win_base = mode; user_config_write_eeprom(); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index 8adf82a0650b..f07d4eb427fa 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -25,6 +25,8 @@ bool user_config_get_caps_lock_light_tab(void); bool user_config_get_caps_lock_light_alphas(void); bool user_config_get_fn_layer_transparent_keys_off(void); bool user_config_get_fn_layer_color_enable(void); +uint8_t user_config_get_enable_mac_base(void); +uint8_t user_config_get_enable_win_base(void); uint8_t user_config_get_mode_win_base(void); uint8_t user_config_get_spd_win_base(void); HSV user_config_get_hsv_win_base(void); @@ -38,6 +40,8 @@ void user_config_toggle_caps_lock_light_tab(void); void user_config_toggle_caps_lock_light_alphas(void); void user_config_toggle_fn_layer_transparent_keys_off(void); void user_config_toggle_fn_layer_color_enable(void); +void user_config_toggle_enable_mac_base(void); +void user_config_toggle_enable_win_base(void); void user_config_set_mode_win_base(uint8_t mode); void user_config_set_spd_win_base(uint8_t spd); void user_config_set_hsv_win_base(HSV hsv); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index c4ecb5da0c84..20b4b22fbd77 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -43,19 +43,35 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { if (is_win_mode() && !win_mode_was_activated) { // switch was moved to win mode win_mode_was_activated = true; - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); + + // check enable/disable + if (user_config_get_enable_win_base()) { + rgb_matrix_enable_noeeprom(); + + // load win base settings + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + } else { + rgb_matrix_disable_noeeprom(); + } } else if (!is_win_mode() && win_mode_was_activated) { // switch was moved to mac mode win_mode_was_activated = false; - - // load mac base settings - rgb_matrix_reload_from_eeprom(); + + // check enable/disable + if (user_config_get_enable_mac_base()) { + rgb_matrix_enable_noeeprom(); + + // load mac base settings + rgb_matrix_reload_from_eeprom(); + + rgb_matrix_enable_noeeprom(); + } else { + rgb_matrix_disable_noeeprom(); + } } #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { From f2b33c49125c6e6282b7bda461df42873203ca7d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 10 Apr 2023 12:35:08 -0400 Subject: [PATCH 070/160] updated readme --- .../ansi_encoder/keymaps/mkillewald/readme.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index d40034391672..55a792f47e05 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -28,17 +28,18 @@ Default options (these defaults will be applied whenever the eeprom is cleared): ``` - #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true=enable, false=disable - #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true=enable, false=disable - #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true=enable, false=disable - #define DEFAULT_FN_LAYER_SHOW_COLOR true // true=enable, false=disable + #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable + #define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable + #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) - #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers - #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers - #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers - #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers - + #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers ``` Caps Lock RGB indicator option: From 332180e1101cc3e5769f0d2a52e604190d925299 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 01:29:01 -0400 Subject: [PATCH 071/160] code reorg. moved layer stuff into keymap.c --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 47 +++++++++++++++++++ .../keymaps/mkillewald/rgb_matrix_user.c | 35 -------------- .../keymaps/mkillewald/rgb_matrix_user.h | 4 -- 3 files changed, 47 insertions(+), 39 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 71ba843063af..966a79f0182c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -46,6 +46,7 @@ enum my_keycodes { #define KC_LBMAC KC_LOCK_BLANK_MAC static bool win_mode; +static bool win_mode_was_activated; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( @@ -142,6 +143,52 @@ bool dip_switch_update_user(uint8_t index, bool active) { bool is_win_mode(void) { return win_mode; } +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case MAC_BASE: + if (!is_win_mode() && win_mode_was_activated) { + // switch was moved to mac mode + win_mode_was_activated = false; + + // check enable/disable + if (user_config_get_enable_mac_base()) { +// rgb_matrix_enable_noeeprom(); + + // load mac base settings + rgb_matrix_reload_from_eeprom(); + + rgb_matrix_enable_noeeprom(); + } else { + rgb_matrix_disable_noeeprom(); + } + } + break; + case WIN_BASE: + if (is_win_mode() && !win_mode_was_activated) { + // switch was moved to win mode + win_mode_was_activated = true; + + // check enable/disable + if (user_config_get_enable_win_base()) { + rgb_matrix_enable_noeeprom(); + + // load win base settings + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + } else { + rgb_matrix_disable_noeeprom(); + } + } + break; + default: // for any other layers, or the default layer + break; + } + return state; +} + bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 20b4b22fbd77..f7c44f8d63cb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -22,8 +22,6 @@ keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; -static bool win_mode_was_activated; - void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { @@ -40,39 +38,6 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: - if (is_win_mode() && !win_mode_was_activated) { - // switch was moved to win mode - win_mode_was_activated = true; - - // check enable/disable - if (user_config_get_enable_win_base()) { - rgb_matrix_enable_noeeprom(); - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - } else { - rgb_matrix_disable_noeeprom(); - } - } else if (!is_win_mode() && win_mode_was_activated) { - // switch was moved to mac mode - win_mode_was_activated = false; - - // check enable/disable - if (user_config_get_enable_mac_base()) { - rgb_matrix_enable_noeeprom(); - - // load mac base settings - rgb_matrix_reload_from_eeprom(); - - rgb_matrix_enable_noeeprom(); - } else { - rgb_matrix_disable_noeeprom(); - } - } #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h index 9daf9f59f4c1..c6d5e65548d6 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h @@ -17,12 +17,8 @@ #pragma once void rgb_matrix_init_user(void); -void rgb_matrix_set_cyber_colors(void); void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); - bool is_caps_lock_indicator(uint16_t keycode); bool is_caps_word_indicator(uint16_t keycode); bool is_transparent(uint16_t keycode); bool is_not_transparent(uint16_t keycode); - -void set_hsv_win_base(HSV hsv); From 590d47db67f4e009395b7f74f95d7f83355e731f Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 01:32:45 -0400 Subject: [PATCH 072/160] fixed eeprom data size --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index d2b035c8d11d..d8e6381c2e12 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -16,7 +16,7 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 17 // size of eeprom data, do not change. +#define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. // default options applied when eeprom is cleared #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable From 8c4c3d75b03c2a25561f7c56a9660d5a419e332e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 02:19:37 -0400 Subject: [PATCH 073/160] moved layer code back to rgb_matrix temporarily --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 6 ++-- .../keymaps/mkillewald/rgb_matrix_user.c | 35 +++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 966a79f0182c..9db76da7173b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -46,7 +46,7 @@ enum my_keycodes { #define KC_LBMAC KC_LOCK_BLANK_MAC static bool win_mode; -static bool win_mode_was_activated; +//static bool win_mode_was_activated; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( @@ -143,7 +143,7 @@ bool dip_switch_update_user(uint8_t index, bool active) { bool is_win_mode(void) { return win_mode; } -layer_state_t layer_state_set_user(layer_state_t state) { +/*layer_state_t layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case MAC_BASE: if (!is_win_mode() && win_mode_was_activated) { @@ -187,7 +187,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { break; } return state; -} +}*/ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index f7c44f8d63cb..20b4b22fbd77 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -22,6 +22,8 @@ keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; +static bool win_mode_was_activated; + void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { @@ -38,6 +40,39 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: + if (is_win_mode() && !win_mode_was_activated) { + // switch was moved to win mode + win_mode_was_activated = true; + + // check enable/disable + if (user_config_get_enable_win_base()) { + rgb_matrix_enable_noeeprom(); + + // load win base settings + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + } else { + rgb_matrix_disable_noeeprom(); + } + } else if (!is_win_mode() && win_mode_was_activated) { + // switch was moved to mac mode + win_mode_was_activated = false; + + // check enable/disable + if (user_config_get_enable_mac_base()) { + rgb_matrix_enable_noeeprom(); + + // load mac base settings + rgb_matrix_reload_from_eeprom(); + + rgb_matrix_enable_noeeprom(); + } else { + rgb_matrix_disable_noeeprom(); + } + } #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); From 2f0b0eff8ac76b3f64fe97843401d0912083ec8c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:16:25 -0400 Subject: [PATCH 074/160] enabled separate RGB toggle for each base layer (Mac / Win) --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 61 +++++++------------ .../keymaps/mkillewald/keymap_user.h | 2 - .../ansi_encoder/keymaps/mkillewald/readme.md | 3 +- .../keymaps/mkillewald/rgb_matrix_user.c | 35 ----------- 4 files changed, 23 insertions(+), 78 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 9db76da7173b..57ba9979c080 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -46,7 +46,6 @@ enum my_keycodes { #define KC_LBMAC KC_LOCK_BLANK_MAC static bool win_mode; -//static bool win_mode_was_activated; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( @@ -141,53 +140,37 @@ bool dip_switch_update_user(uint8_t index, bool active) { return true; } -bool is_win_mode(void) { return win_mode; } - -/*layer_state_t layer_state_set_user(layer_state_t state) { +layer_state_t default_layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case MAC_BASE: - if (!is_win_mode() && win_mode_was_activated) { - // switch was moved to mac mode - win_mode_was_activated = false; - - // check enable/disable - if (user_config_get_enable_mac_base()) { -// rgb_matrix_enable_noeeprom(); - - // load mac base settings - rgb_matrix_reload_from_eeprom(); - - rgb_matrix_enable_noeeprom(); - } else { - rgb_matrix_disable_noeeprom(); - } + // load mac base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_reload_from_eeprom(); + + // check disable + if (!user_config_get_enable_mac_base()) { + rgb_matrix_disable_noeeprom(); } break; case WIN_BASE: - if (is_win_mode() && !win_mode_was_activated) { - // switch was moved to win mode - win_mode_was_activated = true; - - // check enable/disable - if (user_config_get_enable_win_base()) { - rgb_matrix_enable_noeeprom(); - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - } else { - rgb_matrix_disable_noeeprom(); - } + // load win base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + + // check disable + if (!user_config_get_enable_win_base()) { + rgb_matrix_disable_noeeprom(); } break; - default: // for any other layers, or the default layer + default: break; } - return state; -}*/ + return state; +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h index 05f8f5511a55..84f3314b752b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h @@ -23,5 +23,3 @@ enum layers{ _FN2, // Win Fn1 (layer 3) _FN3 // Mac/Win Fn2 (layer 4) }; - -bool is_win_mode(void); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 55a792f47e05..4e2b99341b17 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -19,8 +19,7 @@ ##### Notes: -###### RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. -###### Toggling RGB mode off will disable RGB for all layers and indicators. RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off for each base layer. The indicators will remain at full brightness. +###### Toggling RGB mode off will disable RGB for and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. ###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. ## Config.h options diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 20b4b22fbd77..f7c44f8d63cb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -22,8 +22,6 @@ keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; -static bool win_mode_was_activated; - void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { @@ -40,39 +38,6 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: - if (is_win_mode() && !win_mode_was_activated) { - // switch was moved to win mode - win_mode_was_activated = true; - - // check enable/disable - if (user_config_get_enable_win_base()) { - rgb_matrix_enable_noeeprom(); - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - } else { - rgb_matrix_disable_noeeprom(); - } - } else if (!is_win_mode() && win_mode_was_activated) { - // switch was moved to mac mode - win_mode_was_activated = false; - - // check enable/disable - if (user_config_get_enable_mac_base()) { - rgb_matrix_enable_noeeprom(); - - // load mac base settings - rgb_matrix_reload_from_eeprom(); - - rgb_matrix_enable_noeeprom(); - } else { - rgb_matrix_disable_noeeprom(); - } - } #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); From bc4f44cbbc5615bf91a0e0bc511b7197a0ee9b6d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:17:05 -0400 Subject: [PATCH 075/160] updated readme --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 4e2b99341b17..f270ac7a1d3a 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,4 +1,4 @@ -## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.0 +## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.1 ### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. @@ -127,6 +127,9 @@ It seems Keychron has not pushed the relavant code to the main QMK repo yet. I s ## Changelog: +v2.0.1 April 11, 2023 +- enabled separate RGB toggle for each base layer (Mac / Win) + v2.0.0 April 7, 2023 - added different RGB settings for Mac Base and Win Base layers From 053401ccf4c35a6226428a4f5799da6c2ac721bb Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:22:58 -0400 Subject: [PATCH 076/160] updated readme --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index f270ac7a1d3a..36c9f9c417ee 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -19,7 +19,7 @@ ##### Notes: -###### Toggling RGB mode off will disable RGB for and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. +###### Toggling RGB mode off will disable RGB and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. ###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. ## Config.h options From e2466d82208ec2920c44fe2d7547f3a4afa9cb1d Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:30:39 -0400 Subject: [PATCH 077/160] converted bools to uint8_t --- .../q2/ansi_encoder/keymaps/mkillewald/config.h | 8 ++++---- .../keymaps/mkillewald/keymap_user_config.c | 16 ++++++++-------- .../keymaps/mkillewald/keymap_user_config.h | 8 ++++---- .../q2/ansi_encoder/keymaps/mkillewald/readme.md | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index d8e6381c2e12..6fc904f8b1ba 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -19,10 +19,10 @@ #define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. // default options applied when eeprom is cleared -#define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable -#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable -#define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable -#define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable +#define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index a15c91712346..d57c4bfe3a04 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -18,10 +18,10 @@ #include "keymap_user_config.h" typedef struct { - bool caps_lock_light_tab; - bool caps_lock_light_alphas; - bool fn_layer_transparent_keys_off; - bool fn_layer_color_enable; + uint8_t caps_lock_light_tab; + uint8_t caps_lock_light_alphas; + uint8_t fn_layer_transparent_keys_off; + uint8_t fn_layer_color_enable; uint8_t enable_mac_base; uint8_t enable_win_base; uint8_t mode_win_base; @@ -59,19 +59,19 @@ void user_config_write_eeprom(void) { // getters -bool user_config_get_caps_lock_light_tab(void) { +uint8_t user_config_get_caps_lock_light_tab(void) { return user_config.caps_lock_light_tab; } -bool user_config_get_caps_lock_light_alphas(void) { +uint8_t user_config_get_caps_lock_light_alphas(void) { return user_config.caps_lock_light_alphas; } -bool user_config_get_fn_layer_transparent_keys_off(void) { +uint8_t user_config_get_fn_layer_transparent_keys_off(void) { return user_config.fn_layer_transparent_keys_off; } -bool user_config_get_fn_layer_color_enable(void) { +uint8_t user_config_get_fn_layer_color_enable(void) { return user_config.fn_layer_color_enable; } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index f07d4eb427fa..34d7560e48c7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -21,10 +21,10 @@ void user_config_write_eeprom(void); // getters -bool user_config_get_caps_lock_light_tab(void); -bool user_config_get_caps_lock_light_alphas(void); -bool user_config_get_fn_layer_transparent_keys_off(void); -bool user_config_get_fn_layer_color_enable(void); +uint8_t user_config_get_caps_lock_light_tab(void); +uint8_t user_config_get_caps_lock_light_alphas(void); +uint8_t user_config_get_fn_layer_transparent_keys_off(void); +uint8_t user_config_get_fn_layer_color_enable(void); uint8_t user_config_get_enable_mac_base(void); uint8_t user_config_get_enable_win_base(void); uint8_t user_config_get_mode_win_base(void); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 36c9f9c417ee..58a7877786c9 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -27,10 +27,10 @@ Default options (these defaults will be applied whenever the eeprom is cleared): ``` - #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable - #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable - #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable - #define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable + #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) From afcc1fcc0c21bcbca3f09518d1298e3694458015 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:58:19 -0400 Subject: [PATCH 078/160] added config.h option to have autocorrect off at startup --- .../q2/ansi_encoder/keymaps/mkillewald/config.h | 10 +++++++--- .../q2/ansi_encoder/keymaps/mkillewald/keymap.c | 13 +++++++++---- .../q2/ansi_encoder/keymaps/mkillewald/readme.md | 14 +++++++++++--- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index 6fc904f8b1ba..d793e88bad1b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -32,6 +32,10 @@ #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers +// Autocorrect is on at start up. If you want Autocorrect to be off at startup, +// un-comment the following line +//#define AUTOCORRECT_OFF_AT_STARTUP + // Caps Lock RGB indicator color #define CAPS_LOCK_INDICATOR_COLOR RGB_RED @@ -39,14 +43,14 @@ #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange #define FN2_LAYER_COLOR RGB_YELLOW +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_RED + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD -// Caps Word RGB indicator color -#define CAPS_WORD_INDICATOR_COLOR RGB_RED - // Caps Word will light left Shift, left Control and left Option (or left Windows // key) when acitvated. Remove this line if you want Caps Word to only light left // Shift when enabled. diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 57ba9979c080..ae9121c1535f 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -107,6 +107,11 @@ void matrix_init_user(void) { void keyboard_post_init_user(void) { user_config_read_eeprom(); + +#ifdef AUTOCORRECT_OFF_AT_STARTUP + // toggle autocorrect off at startup + if (autocorrect_is_enabled()) { autocorrect_toggle(); } +#endif } void housekeeping_task_user(void) { @@ -144,9 +149,9 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case MAC_BASE: // load mac base settings - rgb_matrix_enable_noeeprom(); + rgb_matrix_enable_noeeprom(); rgb_matrix_reload_from_eeprom(); - + // check disable if (!user_config_get_enable_mac_base()) { rgb_matrix_disable_noeeprom(); @@ -154,13 +159,13 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { break; case WIN_BASE: // load win base settings - rgb_matrix_enable_noeeprom(); + rgb_matrix_enable_noeeprom(); rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, user_config_get_hsv_win_base().s, user_config_get_hsv_win_base().v); - + // check disable if (!user_config_get_enable_win_base()) { rgb_matrix_disable_noeeprom(); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 58a7877786c9..d09dbd00ad0b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -41,6 +41,14 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers ``` +Autocorrect option: + +``` + // Autocorrect is on at start up. If you want Autocorrect to be off at startup, + // un-comment the following line + //#define AUTOCORRECT_OFF_AT_STARTUP +``` + Caps Lock RGB indicator option: ``` @@ -57,14 +65,14 @@ Dynamic Fn Layer RGB indicator options: Caps Word options: ``` + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_RED + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD - // Caps Word RGB indicator color - #define CAPS_WORD_INDICATOR_COLOR RGB_RED - // Caps Word will light left Shift, left Control and left Option (or left Windows // key) when acitvated. Remove this line if you want Caps Word to only light left // Shift when enabled. From e9ea3c37d6d3641cd2dafd7caf65fcb97e9351d1 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 00:09:13 -0400 Subject: [PATCH 079/160] removed whitespace --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index ae9121c1535f..4fb40eefb113 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -135,7 +135,7 @@ void housekeeping_task_user(void) { break; default: break; - } + } housekeeping_task_keychron(); } From ab8ad3b112378835351d070adb4f8c2a5ad14039 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 02:30:47 -0400 Subject: [PATCH 080/160] renamed config.h option for clarity --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/config.h | 4 ++-- .../q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c | 4 ++-- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index d793e88bad1b..db62ef363179 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -23,8 +23,8 @@ #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable -#define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable -#define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index d57c4bfe3a04..348af734f272 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -39,8 +39,8 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; - user_config.enable_mac_base = DEFAULT_ENABLE_MAC_BASE; - user_config.enable_win_base = DEFAULT_ENABLE_WIN_BASE; + user_config.enable_mac_base = DEFAULT_RGB_ENABLE_MAC_BASE; + user_config.enable_win_base = DEFAULT_RGB_ENABLE_WIN_BASE; user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index d09dbd00ad0b..3f628c7975ca 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -31,8 +31,8 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable - #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable - #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers From a585ca961322a0546f0fd4835a6ed0a566813218 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 25 Apr 2023 15:29:09 -0400 Subject: [PATCH 081/160] adding userspace folder --- .../ansi_encoder/keymaps/mkillewald/config.h | 2 - .../ansi_encoder/keymaps/mkillewald/keymap.c | 52 ++++++++++++++++++- .../ansi_encoder/keymaps/mkillewald/rules.mk | 6 --- .../mkillewald/config.h | 8 +-- .../mkillewald/eeprom_user_config.c | 2 +- .../mkillewald/eeprom_user_config.h | 0 users/mkillewald/mkillewald.c | 5 ++ users/mkillewald/mkillewald.h | 8 +++ users/mkillewald/readme.md | 14 +++++ .../mkillewald/rgb_matrix_user.c | 44 +--------------- .../mkillewald/rgb_matrix_user.h | 0 users/mkillewald/rules.mk | 6 +++ 12 files changed, 86 insertions(+), 61 deletions(-) rename keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h => users/mkillewald/config.h (74%) rename keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c => users/mkillewald/eeprom_user_config.c (99%) rename keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h => users/mkillewald/eeprom_user_config.h (100%) create mode 100644 users/mkillewald/mkillewald.c create mode 100644 users/mkillewald/mkillewald.h create mode 100644 users/mkillewald/readme.md rename {keyboards/keychron/q2/ansi_encoder/keymaps => users}/mkillewald/rgb_matrix_user.c (58%) rename {keyboards/keychron/q2/ansi_encoder/keymaps => users}/mkillewald/rgb_matrix_user.h (100%) create mode 100644 users/mkillewald/rules.mk diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h index db62ef363179..7e3f5b0c74b7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/config.h @@ -16,8 +16,6 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. - // default options applied when eeprom is cleared #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 4fb40eefb113..a081c9b69a1e 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -16,8 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" -#include "keymap_user.h" -#include "keymap_user_config.h" +#include "eeprom_user_config.h" #ifdef RGB_MATRIX_ENABLE # include "rgb_matrix_user.h" #endif @@ -47,6 +46,14 @@ enum my_keycodes { static bool win_mode; +enum layers{ + MAC_BASE, // Mac Base (layer 0) + WIN_BASE, // Win Base (layer 1) + _FN1, // Mac Fn1 (layer 2) + _FN2, // Win Fn1 (layer 3) + _FN3 // Mac/Win Fn2 (layer 4) +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, @@ -177,6 +184,47 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { + case MAC_BASE: + case WIN_BASE: +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); + } +#endif + break; + case _FN1: + case _FN2: +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } + break; + case _FN3: +#ifdef FN2_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN2_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } + break; + } + return false; +} + bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { switch (keycode) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk index b54f6bf491b3..4a5837600bce 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk @@ -3,11 +3,5 @@ ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes -SRC += keymap_user_config.c - -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - SRC += rgb_matrix_user.c -endif - VPATH += keyboards/keychron/common SRC += keychron_common.c diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h b/users/mkillewald/config.h similarity index 74% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h rename to users/mkillewald/config.h index 84f3314b752b..c28e5164a555 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user.h +++ b/users/mkillewald/config.h @@ -16,10 +16,4 @@ #pragma once -enum layers{ - MAC_BASE, // Mac Base (layer 0) - WIN_BASE, // Win Base (layer 1) - _FN1, // Mac Fn1 (layer 2) - _FN2, // Win Fn1 (layer 3) - _FN3 // Mac/Win Fn2 (layer 4) -}; +#define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/users/mkillewald/eeprom_user_config.c similarity index 99% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c rename to users/mkillewald/eeprom_user_config.c index 348af734f272..4091632abdda 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/users/mkillewald/eeprom_user_config.c @@ -15,7 +15,7 @@ */ #include QMK_KEYBOARD_H -#include "keymap_user_config.h" +#include "eeprom_user_config.h" typedef struct { uint8_t caps_lock_light_tab; diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/users/mkillewald/eeprom_user_config.h similarity index 100% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap_user_config.h rename to users/mkillewald/eeprom_user_config.h diff --git a/users/mkillewald/mkillewald.c b/users/mkillewald/mkillewald.c new file mode 100644 index 000000000000..f904c0c5035b --- /dev/null +++ b/users/mkillewald/mkillewald.c @@ -0,0 +1,5 @@ +#include "mkillewald.h" + +void my_custom_function(void) { + return; +} \ No newline at end of file diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h new file mode 100644 index 000000000000..f7c799025745 --- /dev/null +++ b/users/mkillewald/mkillewald.h @@ -0,0 +1,8 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +void my_custom_function(void); + +#endif \ No newline at end of file diff --git a/users/mkillewald/readme.md b/users/mkillewald/readme.md new file mode 100644 index 000000000000..fb68386d9d2a --- /dev/null +++ b/users/mkillewald/readme.md @@ -0,0 +1,14 @@ +Copyright 2023 Mike Killewald mkillewald@yahoo.com @mkillewald + +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 . \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/users/mkillewald/rgb_matrix_user.c similarity index 58% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c rename to users/mkillewald/rgb_matrix_user.c index f7c44f8d63cb..41fa8cdf69c9 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/users/mkillewald/rgb_matrix_user.c @@ -17,8 +17,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" #include "rgb_matrix_user.h" -#include "keymap_user.h" -#include "keymap_user_config.h" +#include "eeprom_user_config.h" keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; @@ -33,47 +32,6 @@ void rgb_matrix_init_user(void) { } } -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif -#ifdef CAPS_WORD_INDICATOR_COLOR - if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); - } -#endif - break; - case _FN1: - case _FN2: -#ifdef FN1_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - case _FN3: -#ifdef FN2_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN2_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} - void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { for (uint8_t i = led_min; i < led_max; i++) { uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/users/mkillewald/rgb_matrix_user.h similarity index 100% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h rename to users/mkillewald/rgb_matrix_user.h diff --git a/users/mkillewald/rules.mk b/users/mkillewald/rules.mk new file mode 100644 index 000000000000..5580aa8b962f --- /dev/null +++ b/users/mkillewald/rules.mk @@ -0,0 +1,6 @@ +SRC += mkillewald.c +SRC += eeprom_user_config.c + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_matrix_user.c +endif \ No newline at end of file From 5ddf8653dfb3f9bd125bf6e9adcf3632d71a97ad Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 25 Apr 2023 16:24:32 -0400 Subject: [PATCH 082/160] code reorg --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 255 +----------------- .../ansi_encoder/keymaps/mkillewald/layers.h | 24 ++ users/mkillewald/mkillewald.c | 239 +++++++++++++++- users/mkillewald/mkillewald.h | 42 ++- 4 files changed, 311 insertions(+), 249 deletions(-) create mode 100644 keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index a081c9b69a1e..f50eb857a4dd 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -16,44 +16,13 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "mkillewald.h" #include "eeprom_user_config.h" -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix_user.h" -#endif +#include "rgb_matrix_user.h" +#include "layers.h" // clang-format off -enum my_bootloader_state { - BOOTLOADER_INACTIVE, - BOOTLOADER_PRESSED, - BOOTLOADER_WAIT, - BOOTLOADER_DO -} bootloader_state; - -enum my_keycodes { - KC_LIGHT_TAB_TOGGLE = QK_USER_0, - KC_LIGHT_ALPHAS_TOGGLE, - KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE, - KC_LOCK_BLANK_MAC -}; - -#define KC_LTTOG KC_LIGHT_TAB_TOGGLE -#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE -#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE -#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_LBMAC KC_LOCK_BLANK_MAC - -static bool win_mode; - -enum layers{ - MAC_BASE, // Mac Base (layer 0) - WIN_BASE, // Win Base (layer 1) - _FN1, // Mac Fn1 (layer 2) - _FN2, // Win Fn1 (layer 3) - _FN3 // Mac/Win Fn2 (layer 4) -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_67( QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, @@ -107,9 +76,7 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { #endif void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init_user(); -#endif + matrix_init_user_mkillewald(); } void keyboard_post_init_user(void) { @@ -122,68 +89,16 @@ void keyboard_post_init_user(void) { } void housekeeping_task_user(void) { - switch(bootloader_state) { - case BOOTLOADER_DO: - // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. - reset_keyboard(); - break; - case BOOTLOADER_WAIT: - // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my - // Q2 needed this extra wait frame. - bootloader_state = BOOTLOADER_DO; - break; - case BOOTLOADER_PRESSED: - // User pressed bootloader keycode and RGB was disabled earlier in this - // frame. However RGB changes wont take place immediately, so we set a - // flag here which will be caught at end of the next frame. - bootloader_state = BOOTLOADER_WAIT; - break; - default: - break; - } - housekeeping_task_keychron(); + housekeeping_task_mkillewald(); } -bool dip_switch_update_user(uint8_t index, bool active) { - win_mode = (index == 0 && active ? true : false); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_user_mkillewald(keycode, record)) { return false; } return true; } -layer_state_t default_layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case MAC_BASE: - // load mac base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_reload_from_eeprom(); - - // check disable - if (!user_config_get_enable_mac_base()) { - rgb_matrix_disable_noeeprom(); - } - break; - case WIN_BASE: - // load win base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - - // check disable - if (!user_config_get_enable_win_base()) { - rgb_matrix_disable_noeeprom(); - } - break; - default: - break; - } - return state; -} - bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { uint8_t current_layer = get_highest_layer(layer_state); switch (current_layer) { @@ -225,156 +140,4 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { return false; } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (process_record_keychron(keycode, record)) { - switch (keycode) { - case QK_BOOT: - // We want to turn off LEDs before calling bootloader, so here - // we call rgb_matrix_disable_noeeprom() and set a flag because - // the LEDs won't be updated until the next frame. - if (record->event.pressed) { - rgb_matrix_disable_noeeprom(); - bootloader_state = BOOTLOADER_PRESSED; - } - return false; // Skip all further processing of this key - case RGB_TOG: - if (record->event.pressed) { - rgb_matrix_toggle_noeeprom(); - if (win_mode) { - user_config_toggle_enable_win_base(); - } else { - user_config_toggle_enable_mac_base(); - } - } - return false; // Skip all further processing of this key - case RGB_MOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_RMOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_reverse_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case KC_LIGHT_TAB_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_tab(); - } - return false; // Skip all further processing of this key - case KC_LIGHT_ALPHAS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_alphas(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_transparent_keys_off(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_COLOR_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_color_enable(); - } - return false; // Skip all further processing of this key - case KC_LOCK_BLANK_MAC: - if (record->event.pressed) { - send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } - } - return true; -} + diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h new file mode 100644 index 000000000000..33f3b71bdbee --- /dev/null +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h @@ -0,0 +1,24 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 . + */ + + +enum layers{ + MAC_BASE, // Mac Base (layer 0) + WIN_BASE, // Win Base (layer 1) + _FN1, // Mac Fn1 (layer 2) + _FN2, // Win Fn1 (layer 3) + _FN3 // Mac/Win Fn2 (layer 4) +}; \ No newline at end of file diff --git a/users/mkillewald/mkillewald.c b/users/mkillewald/mkillewald.c index f904c0c5035b..958b5d945a1d 100644 --- a/users/mkillewald/mkillewald.c +++ b/users/mkillewald/mkillewald.c @@ -1,5 +1,240 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 "mkillewald.h" +#include "eeprom_user_config.h" +#include "rgb_matrix_user.h" +#include "layers.h" + +static bool win_mode; + +bool dip_switch_update_user(uint8_t index, bool active) { + win_mode = (index == 0 && active ? true : false); + return true; +} + +layer_state_t default_layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case MAC_BASE: + // load mac base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_reload_from_eeprom(); + + // check disable + if (!user_config_get_enable_mac_base()) { + rgb_matrix_disable_noeeprom(); + } + break; + case WIN_BASE: + // load win base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + + // check disable + if (!user_config_get_enable_win_base()) { + rgb_matrix_disable_noeeprom(); + } + break; + default: + break; + } + return state; +} + +void matrix_init_user_mkillewald(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} + +void housekeeping_task_mkillewald(void) { + switch(bootloader_state) { + case BOOTLOADER_DO: + // bootloader was pressed two frames ago. RGB should now be off, + // so we can call the bootloader. + reset_keyboard(); + break; + case BOOTLOADER_WAIT: + // bootloader was pressed on previous frame, we wait this frame and + // set flag to do bootloader at end of next frame. For some reason, my + // Q2 needed this extra wait frame. + bootloader_state = BOOTLOADER_DO; + break; + case BOOTLOADER_PRESSED: + // User pressed bootloader keycode and RGB was disabled earlier in this + // frame. However RGB changes wont take place immediately, so we set a + // flag here which will be caught at end of the next frame. + bootloader_state = BOOTLOADER_WAIT; + break; + default: + break; + } +} -void my_custom_function(void) { - return; +bool process_record_user_mkillewald(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QK_BOOT: + // We want to turn off LEDs before calling bootloader, so here + // we call rgb_matrix_disable_noeeprom() and set a flag because + // the LEDs won't be updated until the next frame. + if (record->event.pressed) { + rgb_matrix_disable_noeeprom(); + bootloader_state = BOOTLOADER_PRESSED; + } + return false; // Skip all further processing of this key + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_toggle_noeeprom(); + if (win_mode) { + user_config_toggle_enable_win_base(); + } else { + user_config_toggle_enable_mac_base(); + } + } + return false; // Skip all further processing of this key + case RGB_MOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_RMOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_reverse_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case KC_LIGHT_TAB_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_tab(); + } + return false; // Skip all further processing of this key + case KC_LIGHT_ALPHAS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_alphas(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_transparent_keys_off(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_COLOR_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_color_enable(); + } + return false; // Skip all further processing of this key + case KC_LOCK_BLANK_MAC: + if (record->event.pressed) { + send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } } \ No newline at end of file diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h index f7c799025745..ed4c99cf0431 100644 --- a/users/mkillewald/mkillewald.h +++ b/users/mkillewald/mkillewald.h @@ -1,8 +1,48 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 . + */ + + #ifndef USERSPACE #define USERSPACE #include "quantum.h" -void my_custom_function(void); +enum my_bootloader_state { + BOOTLOADER_INACTIVE, + BOOTLOADER_PRESSED, + BOOTLOADER_WAIT, + BOOTLOADER_DO +} bootloader_state; + +enum my_keycodes { + KC_LIGHT_TAB_TOGGLE = QK_USER_0, + KC_LIGHT_ALPHAS_TOGGLE, + KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, + KC_FN_LAYER_COLOR_TOGGLE, + KC_LOCK_BLANK_MAC +}; + +#define KC_LTTOG KC_LIGHT_TAB_TOGGLE +#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE +#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE +#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE +#define KC_LBMAC KC_LOCK_BLANK_MAC + +void matrix_init_user_mkillewald(void); +void housekeeping_task_mkillewald(void); +bool process_record_user_mkillewald(uint16_t keycode, keyrecord_t *record); #endif \ No newline at end of file From 28b05a900c10776517d15f2b3e623c8bfb16104f Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 25 Apr 2023 16:32:03 -0400 Subject: [PATCH 083/160] more code reorg utilizing userspace folder --- .../q2/ansi_encoder/keymaps/mkillewald/keymap.c | 11 +++-------- users/mkillewald/mkillewald.c | 13 +++++++++++-- users/mkillewald/mkillewald.h | 5 +++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index f50eb857a4dd..0c803c209ab8 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -76,16 +76,11 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { #endif void matrix_init_user(void) { - matrix_init_user_mkillewald(); + matrix_init_mkillewald(); } void keyboard_post_init_user(void) { - user_config_read_eeprom(); - -#ifdef AUTOCORRECT_OFF_AT_STARTUP - // toggle autocorrect off at startup - if (autocorrect_is_enabled()) { autocorrect_toggle(); } -#endif + keyboard_post_init_mkillewald(); } void housekeeping_task_user(void) { @@ -95,7 +90,7 @@ void housekeeping_task_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_user_mkillewald(keycode, record)) { return false; } + if (!process_record_mkillewald(keycode, record)) { return false; } return true; } diff --git a/users/mkillewald/mkillewald.c b/users/mkillewald/mkillewald.c index 958b5d945a1d..c11d2115f436 100644 --- a/users/mkillewald/mkillewald.c +++ b/users/mkillewald/mkillewald.c @@ -58,12 +58,21 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } -void matrix_init_user_mkillewald(void) { +void matrix_init_mkillewald(void) { #ifdef RGB_MATRIX_ENABLE rgb_matrix_init_user(); #endif } +void keyboard_post_init_mkillewald(void) { + user_config_read_eeprom(); + +#ifdef AUTOCORRECT_OFF_AT_STARTUP + // toggle autocorrect off at startup + if (autocorrect_is_enabled()) { autocorrect_toggle(); } +#endif +} + void housekeeping_task_mkillewald(void) { switch(bootloader_state) { case BOOTLOADER_DO: @@ -88,7 +97,7 @@ void housekeeping_task_mkillewald(void) { } } -bool process_record_user_mkillewald(uint16_t keycode, keyrecord_t *record) { +bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QK_BOOT: // We want to turn off LEDs before calling bootloader, so here diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h index ed4c99cf0431..8369110bffb9 100644 --- a/users/mkillewald/mkillewald.h +++ b/users/mkillewald/mkillewald.h @@ -41,8 +41,9 @@ enum my_keycodes { #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE #define KC_LBMAC KC_LOCK_BLANK_MAC -void matrix_init_user_mkillewald(void); +void matrix_init_mkillewald(void); +void keyboard_post_init_mkillewald(void); void housekeeping_task_mkillewald(void); -bool process_record_user_mkillewald(uint16_t keycode, keyrecord_t *record); +bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record); #endif \ No newline at end of file From de5490a45e75a10a72d221c33b615da41c02f3ff Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 00:10:02 -0400 Subject: [PATCH 084/160] moved rgb_matrix_indicators_advanced_user to userspace folder and added _keymap function templates --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 50 ---------------- .../ansi_encoder/keymaps/mkillewald/layers.h | 6 +- users/mkillewald/mkillewald.c | 32 +++++++++-- users/mkillewald/mkillewald.h | 3 - users/mkillewald/rgb_matrix_user.c | 57 +++++++++++++++++++ users/mkillewald/rgb_matrix_user.h | 3 + 6 files changed, 93 insertions(+), 58 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 0c803c209ab8..807d4839a0f9 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -75,14 +75,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { }; #endif -void matrix_init_user(void) { - matrix_init_mkillewald(); -} - -void keyboard_post_init_user(void) { - keyboard_post_init_mkillewald(); -} - void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_mkillewald(); @@ -94,45 +86,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif -#ifdef CAPS_WORD_INDICATOR_COLOR - if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); - } -#endif - break; - case _FN1: - case _FN2: -#ifdef FN1_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - case _FN3: -#ifdef FN2_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN2_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} - - diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h index 33f3b71bdbee..6437275a966b 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h @@ -21,4 +21,8 @@ enum layers{ _FN1, // Mac Fn1 (layer 2) _FN2, // Win Fn1 (layer 3) _FN3 // Mac/Win Fn2 (layer 4) -}; \ No newline at end of file +}; + +#define MAC_FN1 _FN1 +#define WIN_FN1 _FN2 +#define MAC_WIN_FN2 _FN3 \ No newline at end of file diff --git a/users/mkillewald/mkillewald.c b/users/mkillewald/mkillewald.c index c11d2115f436..8c3e99a2a026 100644 --- a/users/mkillewald/mkillewald.c +++ b/users/mkillewald/mkillewald.c @@ -21,9 +21,19 @@ static bool win_mode; +__attribute__ ((weak)) +bool dip_switch_update_keymap(uint8_t index, bool active) { + return true; +} + bool dip_switch_update_user(uint8_t index, bool active) { win_mode = (index == 0 && active ? true : false); - return true; + return dip_switch_update_keymap(index, active); +} + +__attribute__ ((weak)) +layer_state_t default_layer_state_set_keymap(layer_state_t state) { + return state; } layer_state_t default_layer_state_set_user(layer_state_t state) { @@ -55,22 +65,36 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { default: break; } - return state; + return default_layer_state_set_keymap(state); +} + +__attribute__ ((weak)) +void matrix_init_keymap(void) { + return; } -void matrix_init_mkillewald(void) { +void matrix_init_user(void) { #ifdef RGB_MATRIX_ENABLE rgb_matrix_init_user(); #endif + + matrix_init_keymap(); } -void keyboard_post_init_mkillewald(void) { +__attribute__ ((weak)) +void keyboard_post_init_keymap(void) { + return; +} + +void keyboard_post_init_user(void) { user_config_read_eeprom(); #ifdef AUTOCORRECT_OFF_AT_STARTUP // toggle autocorrect off at startup if (autocorrect_is_enabled()) { autocorrect_toggle(); } #endif + + keyboard_post_init_keymap(); } void housekeeping_task_mkillewald(void) { diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h index 8369110bffb9..d912001c5c57 100644 --- a/users/mkillewald/mkillewald.h +++ b/users/mkillewald/mkillewald.h @@ -14,7 +14,6 @@ * along with this program. If not, see . */ - #ifndef USERSPACE #define USERSPACE @@ -41,8 +40,6 @@ enum my_keycodes { #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE #define KC_LBMAC KC_LOCK_BLANK_MAC -void matrix_init_mkillewald(void); -void keyboard_post_init_mkillewald(void); void housekeeping_task_mkillewald(void); bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record); diff --git a/users/mkillewald/rgb_matrix_user.c b/users/mkillewald/rgb_matrix_user.c index 41fa8cdf69c9..2b5c257e94c9 100644 --- a/users/mkillewald/rgb_matrix_user.c +++ b/users/mkillewald/rgb_matrix_user.c @@ -18,6 +18,7 @@ #include "keychron_common.h" #include "rgb_matrix_user.h" #include "eeprom_user_config.h" +#include "layers.h" keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; @@ -32,6 +33,38 @@ void rgb_matrix_init_user(void) { } } +__attribute__ ((weak)) +bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { + return false; +} + +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { + case MAC_BASE: + case WIN_BASE: +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); + } +#endif + break; + case MAC_FN1: + case WIN_FN1: + set_fn1_layer_color(led_min, led_max, current_layer); + break; + case MAC_WIN_FN2: + set_fn2_layer_color(led_min, led_max, current_layer); + break; + } + return rgb_matrix_indicators_advanced_keymap(led_min, led_max); +} + void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { for (uint8_t i = led_min; i < led_max; i++) { uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); @@ -41,6 +74,30 @@ void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t l } } +void set_fn1_layer_color(uint8_t led_min, uint8_t led_max, uint8_t current_layer) { +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); + } +#endif + check_fn_layer_transparent_keys_toggle(led_min, led_max, current_layer); +} + +void set_fn2_layer_color(uint8_t led_min, uint8_t led_max, uint8_t current_layer) { +#ifdef FN2_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN2_LAYER_COLOR); + } +#endif + check_fn_layer_transparent_keys_toggle(led_min, led_max, current_layer); +} + +void check_fn_layer_transparent_keys_toggle(uint8_t led_min, uint8_t led_max, uint8_t current_layer) { + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } +} + bool is_caps_lock_indicator(uint16_t keycode) { bool indicator = keycode == KC_CAPS; diff --git a/users/mkillewald/rgb_matrix_user.h b/users/mkillewald/rgb_matrix_user.h index c6d5e65548d6..8d297869f302 100644 --- a/users/mkillewald/rgb_matrix_user.h +++ b/users/mkillewald/rgb_matrix_user.h @@ -18,6 +18,9 @@ void rgb_matrix_init_user(void); void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); +void set_fn1_layer_color(uint8_t led_min, uint8_t led_max, uint8_t current_layer); +void set_fn2_layer_color(uint8_t led_min, uint8_t led_max, uint8_t current_layer); +void check_fn_layer_transparent_keys_toggle(uint8_t led_min, uint8_t led_max, uint8_t current_layer); bool is_caps_lock_indicator(uint16_t keycode); bool is_caps_word_indicator(uint16_t keycode); bool is_transparent(uint16_t keycode); From 8c6b8050c3ef53ffc5484895166482612c7ff0eb Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 13:59:44 -0400 Subject: [PATCH 085/160] changed address --- users/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/mkillewald/readme.md b/users/mkillewald/readme.md index fb68386d9d2a..f55d67f015f9 100644 --- a/users/mkillewald/readme.md +++ b/users/mkillewald/readme.md @@ -1,4 +1,4 @@ -Copyright 2023 Mike Killewald mkillewald@yahoo.com @mkillewald +Copyright 2023 Mike Killewald mkillewald@proton.me @mkillewald 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 From 9945f37c1c698f2dda2c2167356e64c2c6122dfd Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 19:57:39 -0400 Subject: [PATCH 086/160] moved VIA_ENABLE into userspace folder --- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk | 1 - users/mkillewald/rules.mk | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk index 4a5837600bce..a4066ebf79e1 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/rules.mk @@ -1,4 +1,3 @@ -VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes diff --git a/users/mkillewald/rules.mk b/users/mkillewald/rules.mk index 5580aa8b962f..2d2b486d62a4 100644 --- a/users/mkillewald/rules.mk +++ b/users/mkillewald/rules.mk @@ -1,3 +1,6 @@ +RAW_ENABLE = no +VIA_ENABLE = yes + SRC += mkillewald.c SRC += eeprom_user_config.c From 5d7c78e4b739a7df183852651ca6959e10988b06 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 15:32:45 -0400 Subject: [PATCH 087/160] updated firmware to adopt all improvements made on my Q2 and Q1SE keymaps --- .../keymaps/mkillewald/autocorrect_data.h | 176 ++++++++++ .../mkillewald/autocorrection_dict.txt | 85 +++++ .../q1/ansi/keymaps/mkillewald/config.h | 41 ++- .../q1/ansi/keymaps/mkillewald/keymap.c | 324 +++++++++++++----- .../q1/ansi/keymaps/mkillewald/keymap_user.h | 13 +- .../keymaps/mkillewald/keymap_user_config.c | 179 ++++++++++ .../keymaps/mkillewald/keymap_user_config.h | 52 +++ .../q1/ansi/keymaps/mkillewald/readme.md | 153 ++++++--- .../ansi/keymaps/mkillewald/rgb_matrix_user.c | 31 +- .../ansi/keymaps/mkillewald/rgb_matrix_user.h | 6 +- .../q1/ansi/keymaps/mkillewald/rules.mk | 11 +- 11 files changed, 913 insertions(+), 158 deletions(-) create mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrect_data.h create mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrection_dict.txt create mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c create mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrect_data.h new file mode 100644 index 000000000000..a092cc777346 --- /dev/null +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrect_data.h @@ -0,0 +1,176 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once + +// Autocorrection dictionary (71 entries): +// :guage -> gauge +// :the:the: -> the +// :thier -> their +// :ture -> true +// accomodate -> accommodate +// acommodate -> accommodate +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// aquire -> acquire +// becuase -> because +// cauhgt -> caught +// cheif -> chief +// choosen -> chosen +// cieling -> ceiling +// collegue -> colleague +// concensus -> consensus +// contians -> contains +// cosnt -> const +// dervied -> derived +// dosen't -> doesn't +// fales -> false +// fasle -> false +// fitler -> filter +// flase -> false +// foward -> forward +// frequecy -> frequency +// gaurantee -> guarantee +// guaratee -> guarantee +// heigth -> height +// heirarchy -> hierarchy +// inclued -> include +// interator -> iterator +// intput -> input +// invliad -> invalid +// lenght -> length +// liasion -> liaison +// libary -> library +// listner -> listener +// looses: -> loses +// looup -> lookup +// manefist -> manifest +// namesapce -> namespace +// namespcae -> namespace +// occassion -> occasion +// occured -> occurred +// ouptut -> output +// ouput -> output +// overide -> override +// postion -> position +// priviledge -> privilege +// psuedo -> pseudo +// recieve -> receive +// refered -> referred +// relevent -> relevant +// repitition -> repetition +// reuslt -> result +// retrun -> return +// retun -> return +// reutrn -> return +// saftey -> safety +// seperate -> separate +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// thresold -> threshold +// udpate -> update +// widht -> width + +#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" +#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" +#define DICTIONARY_SIZE 1120 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { + 0x6C, 0x2B, 0x00, 0x06, 0x47, 0x00, 0x07, 0x51, 0x00, 0x08, 0xC7, 0x00, 0x09, 0xF0, 0x01, 0x0A, + 0xFA, 0x01, 0x0B, 0x1A, 0x02, 0x11, 0x35, 0x02, 0x12, 0xBE, 0x02, 0x13, 0xCA, 0x02, 0x15, 0xD4, + 0x02, 0x16, 0x14, 0x03, 0x17, 0x43, 0x03, 0x1C, 0x20, 0x04, 0x00, 0x48, 0x32, 0x00, 0x16, 0x3C, + 0x00, 0x00, 0x0B, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x84, 0x00, 0x08, 0x16, 0x12, 0x12, + 0x0F, 0x00, 0x84, 0x73, 0x65, 0x73, 0x00, 0x0B, 0x17, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, + 0x00, 0x44, 0x5E, 0x00, 0x08, 0x6A, 0x00, 0x0F, 0xAE, 0x00, 0x15, 0xBB, 0x00, 0x00, 0x0C, 0x0F, + 0x19, 0x11, 0x0C, 0x00, 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x4A, 0x77, 0x00, 0x0C, 0x81, 0x00, + 0x15, 0x8C, 0x00, 0x18, 0xA5, 0x00, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, + 0x00, 0x19, 0x15, 0x08, 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x48, 0x93, 0x00, 0x18, + 0x9C, 0x00, 0x00, 0x09, 0x08, 0x15, 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, 0x00, + 0x81, 0x72, 0x65, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, 0x81, 0x64, 0x65, 0x00, 0x12, 0x16, + 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x04, 0x1A, 0x12, 0x09, 0x00, + 0x83, 0x72, 0x77, 0x61, 0x72, 0x64, 0x00, 0x44, 0xE9, 0x00, 0x06, 0xF6, 0x00, 0x07, 0x04, 0x01, + 0x08, 0x10, 0x01, 0x0A, 0x34, 0x01, 0x0F, 0x51, 0x01, 0x15, 0x5A, 0x01, 0x16, 0x75, 0x01, 0x17, + 0x90, 0x01, 0x18, 0xD7, 0x01, 0x19, 0xE4, 0x01, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, + 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, 0x13, 0x04, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, + 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x12, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, + 0x17, 0x00, 0x44, 0x19, 0x01, 0x11, 0x24, 0x01, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x18, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x44, 0x3B, 0x01, 0x07, 0x45, 0x01, 0x00, 0x18, 0x0A, 0x2C, 0x00, 0x83, + 0x61, 0x75, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x0C, 0x19, 0x0C, 0x15, 0x13, 0x00, 0x82, 0x67, 0x65, + 0x00, 0x16, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x4C, 0x61, 0x01, 0x18, 0x6D, 0x01, + 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x00, 0x17, 0x2C, 0x00, + 0x82, 0x72, 0x75, 0x65, 0x00, 0x04, 0x00, 0x4F, 0x7E, 0x01, 0x18, 0x86, 0x01, 0x00, 0x09, 0x00, + 0x83, 0x61, 0x6C, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, + 0x04, 0x00, 0x47, 0x9C, 0x01, 0x13, 0xC1, 0x01, 0x15, 0xCB, 0x01, 0x00, 0x12, 0x10, 0x00, 0x50, + 0xA6, 0x01, 0x12, 0xB5, 0x01, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, + 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, + 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, + 0x84, 0x61, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0A, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, + 0x67, 0x75, 0x65, 0x00, 0x08, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x76, 0x65, 0x00, + 0x0C, 0x08, 0x0B, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x11, 0x00, 0x4C, 0x03, 0x02, 0x15, + 0x10, 0x02, 0x00, 0x0F, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, 0x69, 0x6E, 0x67, 0x00, + 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x46, 0x21, 0x02, 0x17, 0x2C, 0x02, + 0x00, 0x0C, 0x17, 0x1A, 0x16, 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0A, 0x0C, 0x08, 0x0B, + 0x00, 0x81, 0x68, 0x74, 0x00, 0x48, 0x45, 0x02, 0x0A, 0x50, 0x02, 0x12, 0x59, 0x02, 0x15, 0x9C, + 0x02, 0x18, 0xA7, 0x02, 0x00, 0x16, 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, + 0x0C, 0x15, 0x17, 0x16, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0C, 0x00, 0x56, 0x62, 0x02, 0x17, 0x7C, + 0x02, 0x00, 0x44, 0x69, 0x02, 0x16, 0x72, 0x02, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, + 0x6E, 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x4C, 0x83, 0x02, 0x16, + 0x92, 0x02, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, 0x69, 0x6F, + 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, + 0x00, 0x83, 0x74, 0x75, 0x72, 0x6E, 0x00, 0x55, 0xAE, 0x02, 0x17, 0xB7, 0x02, 0x00, 0x17, 0x08, + 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, 0x80, 0x72, 0x6E, 0x00, 0x07, 0x08, + 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, 0x75, 0x64, 0x6F, 0x00, 0x18, 0x12, 0x12, 0x0F, 0x00, 0x81, + 0x6B, 0x75, 0x70, 0x00, 0x48, 0xDB, 0x02, 0x12, 0x03, 0x03, 0x00, 0x4C, 0xE5, 0x02, 0x0F, 0xEE, + 0x02, 0x11, 0xF8, 0x02, 0x00, 0x0B, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x17, 0x0C, + 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x17, 0x16, 0x0C, 0x0F, 0x00, 0x82, 0x65, 0x6E, + 0x65, 0x72, 0x00, 0x17, 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, + 0x74, 0x6F, 0x72, 0x00, 0x48, 0x1E, 0x03, 0x11, 0x26, 0x03, 0x18, 0x33, 0x03, 0x00, 0x0F, 0x04, + 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x04, 0x0C, 0x17, 0x11, 0x12, 0x06, 0x00, 0x83, 0x61, 0x69, + 0x6E, 0x73, 0x00, 0x16, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, + 0x75, 0x73, 0x00, 0x74, 0x59, 0x03, 0x0A, 0x66, 0x03, 0x0B, 0x70, 0x03, 0x0F, 0x86, 0x03, 0x11, + 0x91, 0x03, 0x16, 0xEA, 0x03, 0x18, 0xF8, 0x03, 0x00, 0x11, 0x08, 0x16, 0x12, 0x07, 0x00, 0x84, + 0x65, 0x73, 0x6E, 0x27, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, 0x68, 0x74, 0x00, + 0x47, 0x77, 0x03, 0x0A, 0x7E, 0x03, 0x00, 0x0C, 0x1A, 0x00, 0x81, 0x74, 0x68, 0x00, 0x11, 0x08, + 0x0F, 0x00, 0x81, 0x74, 0x68, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, + 0x00, 0x44, 0x9B, 0x03, 0x08, 0xA6, 0x03, 0x16, 0xE2, 0x03, 0x00, 0x15, 0x04, 0x13, 0x13, 0x04, + 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x55, 0xAD, 0x03, 0x19, 0xD8, 0x03, 0x00, 0x44, 0xB4, 0x03, + 0x15, 0xBF, 0x03, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, + 0x13, 0x00, 0x44, 0xC9, 0x03, 0x13, 0xD1, 0x03, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, + 0x00, 0x04, 0x00, 0x83, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, + 0x74, 0x00, 0x12, 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x09, 0x08, 0x11, 0x04, 0x10, + 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, 0x00, 0x53, 0xFF, 0x03, 0x17, 0x16, 0x04, 0x00, 0x57, + 0x06, 0x04, 0x18, 0x0E, 0x04, 0x00, 0x11, 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, + 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, + 0x46, 0x2D, 0x04, 0x08, 0x39, 0x04, 0x0B, 0x43, 0x04, 0x15, 0x55, 0x04, 0x00, 0x08, 0x18, 0x14, + 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, + 0x74, 0x79, 0x00, 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, + 0x72, 0x63, 0x68, 0x79, 0x00, 0x04, 0x05, 0x0C, 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00 +}; \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrection_dict.txt b/keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrection_dict.txt new file mode 100644 index 000000000000..8280fcf703b9 --- /dev/null +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/autocorrection_dict.txt @@ -0,0 +1,85 @@ +# Copyright 2021-2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +:guage -> gauge +:the the: -> the +:thier -> their +:ture -> true +accomodate -> accommodate +acommodate -> accommodate +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +aquire -> acquire +becuase -> because +cauhgt -> caught +cheif -> chief +choosen -> chosen +cieling -> ceiling +collegue -> colleague +concensus -> consensus +contians -> contains +cosnt -> const +dervied -> derived +dosen't -> doesn't +fales -> false +fasle -> false +fitler -> filter +flase -> false +foward -> forward +frequecy -> frequency +gaurantee -> guarantee +guaratee -> guarantee +heigth -> height +heirarchy -> hierarchy +inclued -> include +interator -> iterator +intput -> input +invliad -> invalid +lenght -> length +liasion -> liaison +libary -> library +listner -> listener +looses: -> loses +looup -> lookup +manefist -> manifest +namesapce -> namespace +namespcae -> namespace +occassion -> occasion +occured -> occurred +ouptut -> output +ouput -> output +overide -> override +postion -> position +priviledge -> privilege +psuedo -> pseudo +recieve -> receive +refered -> referred +relevent -> relevant +repitition -> repetition +reuslt -> result +retrun -> return +retun -> return +reutrn -> return +saftey -> safety +seperate -> separate +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +thresold -> threshold +udpate -> update +widht -> width \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h index bc9fe405c35c..4af9ecdf85a4 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 @@ -16,8 +16,37 @@ #pragma once -#ifdef RGB_MATRIX_ENABLE -# define RGB_DISABLE_WHEN_USB_SUSPENDED -# define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN_LAYER_COLOR RGB_ORANGE -#endif \ No newline at end of file +#define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. + +// default options applied when eeprom is cleared +#define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable +#define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_HUE_WIN_BASE 0 // HSV red hue (Win Base layer) +#define RGB_MATRIX_DEFAULT_HUE 80 // HSV green hue (Mac Base layer) +#define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers + +// Caps Lock RGB indicator color +#define CAPS_LOCK_INDICATOR_COLOR RGB_WHITE + +// Dynamic Fn Layer RGB indicator options +#define FN1_LAYER_COLOR RGB_YELLOW + +// Caps Word is activated by double-tapping left Shift. Replace this with +// #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word +// by single-tapping both left and right Shift togeter. +#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_WHITE + +// Caps Word will light left Shift, left Control and left Option (or left Windows +// key) when acitvated. Remove this line if you want Caps Word to only light left +// Shift when enabled. +#define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 4fc8ad58e546..916e4fa110cb 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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,38 +15,37 @@ */ #include QMK_KEYBOARD_H +#include "keychron_common.h" #include "keymap_user.h" +#include "keymap_user_config.h" #ifdef RGB_MATRIX_ENABLE # include "rgb_matrix_user.h" #endif // clang-format off -typedef union { - uint32_t raw; - struct { - bool caps_lock_light_tab :1; - bool caps_lock_light_alphas :1; - bool fn_layer_transparent_keys_off :1; - bool fn_layer_color_enable :1; - }; -} user_config_t; +enum my_bootloader_state { + BOOTLOADER_INACTIVE, + BOOTLOADER_PRESSED, + BOOTLOADER_WAIT, + BOOTLOADER_DO +} bootloader_state; -user_config_t user_config; - -enum custom_keycodes { - KC_LIGHT_TAB_TOGGLE = QK_KB_2, // TECH DEBT: Starts at QK_KB_2 to maintain ordering with VIA definitions. See #19884. Revert to QK_KB_0 when VIA catches up with QMK. +enum my_keycodes { + KC_LIGHT_TAB_TOGGLE = QK_USER_0, KC_LIGHT_ALPHAS_TOGGLE, KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE + KC_FN_LAYER_COLOR_TOGGLE, + KC_LOCK_BLANK_MAC }; #define KC_LTTOG KC_LIGHT_TAB_TOGGLE #define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE #define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_TASK LGUI(KC_TAB) -#define KC_FLXP LGUI(KC_E) +#define KC_LBMAC KC_LOCK_BLANK_MAC + +static bool win_mode; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -59,28 +58,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN] = LAYOUT_ansi_82( - KC_TRNS, 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, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_LBMAC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, LCAG(KC_W), LCAG(KC_D), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), [WIN_BASE] = LAYOUT_ansi_82( - KC_ESC, 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_DEL, KC_INS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, 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_DEL, KC_INS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [WIN_FN] = LAYOUT_ansi_82( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; @@ -93,61 +92,222 @@ void matrix_init_user(void) { } void keyboard_post_init_user(void) { - user_config.raw = eeconfig_read_user(); + user_config_read_eeprom(); } -void eeconfig_init_user(void) { - user_config.raw = 0; - user_config.caps_lock_light_tab = false; - user_config.caps_lock_light_alphas = false; - user_config.fn_layer_transparent_keys_off = true; - user_config.fn_layer_color_enable = false; - eeconfig_update_user(user_config.raw); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_LIGHT_TAB_TOGGLE: - if (record->event.pressed) { - user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - case KC_LIGHT_ALPHAS_TOGGLE: - if (record->event.pressed) { - user_config.caps_lock_light_alphas ^= 1; - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: - if (record->event.pressed) { - user_config.fn_layer_transparent_keys_off ^= 1; - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_COLOR_TOGGLE: - if (record->event.pressed) { - user_config.fn_layer_color_enable ^= 1; - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key +void housekeeping_task_user(void) { + switch(bootloader_state) { + case BOOTLOADER_DO: + // bootloader was pressed two frames ago. RGB should now be off, + // so we can call the bootloader. + reset_keyboard(); + break; + case BOOTLOADER_WAIT: + // bootloader was pressed on previous frame, we wait this frame and + // set flag to do bootloader at end of next frame. For some reason, my + // Q2 needed this extra wait frame. + bootloader_state = BOOTLOADER_DO; + break; + case BOOTLOADER_PRESSED: + // User pressed bootloader keycode and RGB was disabled earlier in this + // frame. However RGB changes wont take place immediately, so we set a + // flag here which will be caught at end of the next frame. + bootloader_state = BOOTLOADER_WAIT; + break; default: - return true; // Process all other keycodes normally - } -} + break; + } -bool get_caps_lock_light_tab(void) { - return user_config.caps_lock_light_tab; + housekeeping_task_keychron(); } -bool get_caps_lock_light_alphas(void) { - return user_config.caps_lock_light_alphas; +bool dip_switch_update_user(uint8_t index, bool active) { + win_mode = (index == 0 && active ? true : false); + return true; } -bool get_fn_layer_transparent_keys_off(void) { - return user_config.fn_layer_transparent_keys_off; +layer_state_t default_layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case MAC_BASE: + // load mac base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_reload_from_eeprom(); + + // check disable + if (!user_config_get_enable_mac_base()) { + rgb_matrix_disable_noeeprom(); + } + break; + case WIN_BASE: + // load win base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + + // check disable + if (!user_config_get_enable_win_base()) { + rgb_matrix_disable_noeeprom(); + } + break; + default: + break; + } + return state; } -bool get_fn_layer_color_enable(void) { - return user_config.fn_layer_color_enable; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (process_record_keychron(keycode, record)) { + switch (keycode) { + case QK_BOOT: + // We want to turn off LEDs before calling bootloader, so here + // we call rgb_matrix_disable_noeeprom() and set a flag because + // the LEDs won't be updated until the next frame. + if (record->event.pressed) { + rgb_matrix_disable_noeeprom(); + bootloader_state = BOOTLOADER_PRESSED; + } + return false; // Skip all further processing of this key + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_toggle_noeeprom(); + if (win_mode) { + user_config_toggle_enable_win_base(); + } else { + user_config_toggle_enable_mac_base(); + } + } + return false; // Skip all further processing of this key + case RGB_MOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_RMOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_reverse_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case KC_LIGHT_TAB_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_tab(); + } + return false; // Skip all further processing of this key + case KC_LIGHT_ALPHAS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_alphas(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_transparent_keys_off(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_COLOR_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_color_enable(); + } + return false; // Skip all further processing of this key + case KC_LOCK_BLANK_MAC: + if (record->event.pressed) { + send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } + } + return true; } diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h index 87b1baf47f23..35d2483aa677 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 @@ -16,18 +16,9 @@ #pragma once -// clang-format off - -enum layers { +enum layers{ MAC_BASE, MAC_FN, WIN_BASE, WIN_FN }; - -// clang-format on - -bool get_caps_lock_light_tab(void); -bool get_caps_lock_light_alphas(void); -bool get_fn_layer_transparent_keys_off(void); -bool get_fn_layer_color_enable(void); \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c new file mode 100644 index 000000000000..31591422bc6f --- /dev/null +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c @@ -0,0 +1,179 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 "keymap_user_config.h" + +typedef struct { + uint8_t caps_lock_light_tab; + uint8_t caps_lock_light_alphas; + uint8_t fn_layer_transparent_keys_off; + uint8_t fn_layer_color_enable; + uint8_t enable_mac_base; + uint8_t enable_win_base; + uint8_t mode_win_base; + uint8_t spd_win_base; + HSV hsv_win_base; + HSV hsv_mac_fn1; + HSV hsv_win_fn1; + HSV hsv_fn2; +} user_config_t; + +user_config_t user_config; + +void eeconfig_init_user(void) { + user_config.caps_lock_light_tab = DEFAULT_CAPS_LOCK_LIGHT_TAB; + user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; + user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; + user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; + user_config.enable_mac_base = DEFAULT_ENABLE_MAC_BASE; + user_config.enable_win_base = DEFAULT_ENABLE_WIN_BASE; + user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; + user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; + user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; + user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; + user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; + user_config_write_eeprom(); +} + +void user_config_read_eeprom(void) { + eeconfig_read_user_datablock(&user_config); +} + +void user_config_write_eeprom(void) { + eeconfig_update_user_datablock(&user_config); +} + +// getters + +uint8_t user_config_get_caps_lock_light_tab(void) { + return user_config.caps_lock_light_tab; +} + +uint8_t user_config_get_caps_lock_light_alphas(void) { + return user_config.caps_lock_light_alphas; +} + +uint8_t user_config_get_fn_layer_transparent_keys_off(void) { + return user_config.fn_layer_transparent_keys_off; +} + +uint8_t user_config_get_fn_layer_color_enable(void) { + return user_config.fn_layer_color_enable; +} + +uint8_t user_config_get_enable_mac_base(void) { + return user_config.enable_mac_base; +} + +uint8_t user_config_get_enable_win_base(void) { + return user_config.enable_win_base; +} + +uint8_t user_config_get_mode_win_base(void) { + return user_config.mode_win_base; +} + +uint8_t user_config_get_spd_win_base(void) { + return user_config.spd_win_base; +} + +HSV user_config_get_hsv_win_base(void) { + return user_config.hsv_win_base; +} + +HSV user_config_get_hsv_mac_fn1(void) { + return user_config.hsv_mac_fn1; +} + +HSV user_config_get_hsv_win_fn1(void) { + return user_config.hsv_win_fn1; +} + +HSV user_config_get_hsv_fn2(void) { + return user_config.hsv_fn2; +} + +// setters + +void user_config_toggle_caps_lock_light_tab(void) { + user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit + user_config_write_eeprom(); +} + +void user_config_toggle_caps_lock_light_alphas(void) { + user_config.caps_lock_light_alphas ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_fn_layer_transparent_keys_off(void) { + user_config.fn_layer_transparent_keys_off ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_fn_layer_color_enable(void) { + user_config.fn_layer_color_enable ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_enable_mac_base(void) { + user_config.enable_mac_base ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_enable_win_base(void) { + user_config.enable_win_base ^= 1; + user_config_write_eeprom(); +} + +void user_config_set_mode_win_base(uint8_t mode) { + user_config.mode_win_base = mode; + user_config_write_eeprom(); +} + +void user_config_set_spd_win_base(uint8_t spd) { + user_config.spd_win_base = spd; + user_config_write_eeprom(); +} + +void user_config_set_hsv_win_base(HSV hsv) { + user_config.hsv_win_base = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_mac_fn1(HSV hsv) { + user_config.hsv_mac_fn1 = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_win_fn1(HSV hsv) { + user_config.hsv_win_fn1 = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_fn2(HSV hsv) { + user_config.hsv_fn2 = hsv; + user_config_write_eeprom(); +} + + + + + + + + + diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h new file mode 100644 index 000000000000..34d7560e48c7 --- /dev/null +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h @@ -0,0 +1,52 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 + +void user_config_read_eeprom(void); +void user_config_write_eeprom(void); + +// getters + +uint8_t user_config_get_caps_lock_light_tab(void); +uint8_t user_config_get_caps_lock_light_alphas(void); +uint8_t user_config_get_fn_layer_transparent_keys_off(void); +uint8_t user_config_get_fn_layer_color_enable(void); +uint8_t user_config_get_enable_mac_base(void); +uint8_t user_config_get_enable_win_base(void); +uint8_t user_config_get_mode_win_base(void); +uint8_t user_config_get_spd_win_base(void); +HSV user_config_get_hsv_win_base(void); +HSV user_config_get_hsv_mac_fn1(void); +HSV user_config_get_hsv_win_fn1(void); +HSV user_config_get_hsv_fn2(void); + +// setters + +void user_config_toggle_caps_lock_light_tab(void); +void user_config_toggle_caps_lock_light_alphas(void); +void user_config_toggle_fn_layer_transparent_keys_off(void); +void user_config_toggle_fn_layer_color_enable(void); +void user_config_toggle_enable_mac_base(void); +void user_config_toggle_enable_win_base(void); +void user_config_set_mode_win_base(uint8_t mode); +void user_config_set_spd_win_base(uint8_t spd); +void user_config_set_hsv_win_base(HSV hsv); +void user_config_set_hsv_mac_fn1(HSV hsv); +void user_config_set_hsv_win_fn1(HSV hsv); +void user_config_set_hsv_fn2(HSV hsv); + + diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 8ff2dbcc2cb9..5f6a56369167 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -1,54 +1,117 @@ -## mkillewald's Keychron Q1 keymap (ANSI rev_0100) v1.0.4 +## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.1 -This keymap builds on the keymap by Grayson Carr (gtg465x) but adds a couple options. +### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. ## Features: -- On macOS, F3 opens Mission Control and F4 opens Launchpad without needing to configure shortcuts in System Preferences -- RGB lighting turns off when the computer sleeps -- Caps Lock RGB indicator - - the Caps Lock key will light when Caps Lock is enabled with the following options: - - #define CAPS_LOCK_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Lock is enabled (default: red) - - Fn+Z will toggle lighting the TAB key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. (default: off) - - Fn+X will toggle lighting all the alpha keys when Caps Lock is enabled. (default: off) - -- Dynamic Fn layer RGB indicator - - When the Fn key is held down, any keys defined on the Fn layer in this firmware or in VIA will be highlighted with the following options: - - #define FN_LAYER_COLOR [color] in config.h to set a static color for defined keys (default: orange) - - Fn+C will toggle turning off RGB for keys with no definition (default: RGB off) - - Fn+V will toggle lighting the defined Fn layer keys with the static color set with FN_LAYER_COLOR (default: static color off) - -- All custom keycodes can be moved to different keys in VIA by using the ANY key with the following keycodes: - - USER(0) (default: F3) macOS Mission Control - - USER(1) (default: F4) macOS Launchpad - - USER(2) (default: Fn+Z) Caps Lock light Tab toggle - - USER(3) (default: Fn+X) Caps Lock light alphas toggle - - USER(4) (default: Fn+C) Fn layer non-defined keys RGB toggle - - USER(5) (default: Fn+V) Fn layer defined keys static color toggle - -RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. - -Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the USER(0) through USER(5) custom keycodes after loading your customizations from the saved .json file. Then re-save a new .json file which will have your previous customizations and the custom keycodes for future use as needed. - -#### USE AT YOUR OWN RISK +- Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -## Changelog: +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. + +- Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) + - Uses getreuer's autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) + +- Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) + +- Caps Lock RGB indicator. Will light Caps Lock key with options to also light Tab key (useful for some keycap sets), and/or light all alpha keys. + +- Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. + +##### Notes: + +###### Toggling RGB mode off will disable RGB and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. +###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. + +## Config.h options + +Default options (these defaults will be applied whenever the eeprom is cleared): + +``` + #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable + #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_HUE_WIN_BASE 0 // HSV red hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_HUE 80 // HSV green hue (Mac Base layer) + #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers +``` + +Caps Lock RGB indicator option: + +``` + #define CAPS_LOCK_INDICATOR_COLOR RGB_WHITE +``` + +Dynamic Fn Layer RGB indicator options: + +``` + #define FN1_LAYER_COLOR RGB_YELLOW +``` -v1.0.4 October 9, 2021 -- Caps Lock and Fn layer toggles are now stored in eeprom so settings will remain when Q1 is unplugged +Caps Word options: -v1.0.3 October 8, 2021 -- now using keycode toggles instead of preprocessor directive to set the various Caps Lock and Fn Layer RGB lighting options. This allows for setting the options from user space without having to recompile. +``` + // Caps Word is activated by double-tapping left Shift. Replace this with + // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word + // by single-tapping both left and right Shift togeter. + #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD -v1.0.2 October 7, 2021 -- adapted Grayson Carr's (gtg465x) Caps Lock alphas and dynamic Fn layer RGB routines -- added CAPS_LOCK_INDICATOR_LIGHT_TAB config option to enable/disable lighting Tab with Caps Lock indicator -- added FN_LAYER_COLOR config option to set FN layer static color + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_WHITE + + // Caps Word will light left Shift, left Control and left Option (or left Windows + // key) when acitvated. Remove this line if you want Caps Word to only light left + // Shift when enabled. + #define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER +``` + +## This keymap makes the following layout changes over the factory firmware + +- Fn+Left Shift toggles Autocorrect on/off +- Fn+Backspace enters DFU mode (but does not reset eeprom) +- Fn+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) + - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. +- Fn+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) + - toggle lighting all the alpha keys when Caps Lock is enabled. +- Fn+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) + - toggle turning off RGB for keys with no definition +- Fn+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR + +- Mac mode only + - Fn+Esc (KC_LBMAC) will lock and sleep display + - Fn1+< sets my secondary display to 0° rotation + - Fn1+> sets my secondary display to 90° rotation + + Note: display rotation requires additional software and changes made, see this link for more information: + [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + +All custom keycodes can be moved to different keys in VIA by using the following: +- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Off Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac + +## Known Issues + +1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working +2. Keychron LED test Fn1+Home+Right is not working + +It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. + + +#### USE AT YOUR OWN RISK + +## Changelog: -v1.0.1 October 7, 2021 -- Mission Control and Launchpad custom keycodes are now defined using the VIA user keycodes range so thay can be labeled properly in VIA (adopted change from gtg465x) +v2.0.1 April 11, 2023 +- enabled separate RGB toggle for each base layer (Mac / Win) -v1.0.0 September 30, 2021 -- Initial release built upon keymap by Grayson Carr (gtg465x) -- defined Mission Control (F3) and Launchpad (F4) keycodes for macOs -- RGB backlight turns off when computer sleeps -- added Caps Lock indicator lighting both the Caps Lock and Tab LEDs for better effect on non-backlit keycaps +v2.0.0 April 11, 2023 +- copied code from Q2 v2.0.0 firware over diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c index c6fa5f1f155a..2e43983ae890 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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,8 +15,10 @@ */ #include QMK_KEYBOARD_H +#include "keychron_common.h" #include "rgb_matrix_user.h" #include "keymap_user.h" +#include "keymap_user_config.h" keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; @@ -40,16 +42,21 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); + } #endif break; case MAC_FN: case WIN_FN: -#ifdef FN_LAYER_COLOR - if (get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN_LAYER_COLOR); +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); } #endif - if (get_fn_layer_transparent_keys_off()) { + if (user_config_get_fn_layer_transparent_keys_off()) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); } break; @@ -69,16 +76,24 @@ void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t l bool is_caps_lock_indicator(uint16_t keycode) { bool indicator = keycode == KC_CAPS; - if (get_caps_lock_light_tab()) { + if (user_config_get_caps_lock_light_tab()) { indicator = keycode == KC_TAB || keycode == KC_CAPS; } - if (get_caps_lock_light_alphas()) { + if (user_config_get_caps_lock_light_alphas()) { return (KC_A <= keycode && keycode <= KC_Z) || indicator; } else { return indicator; } } +bool is_caps_word_indicator(uint16_t keycode) { + bool indicator = keycode == KC_LSFT; +#ifdef CAPS_WORD_LIGHT_LOWER_LEFT_CORNER + indicator = keycode == KC_LSFT || keycode == KC_LCTL || keycode == KC_LOPT; +#endif + return indicator; +} + bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } -bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } +bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h index 1fb79c0b2a14..c6d5e65548d6 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 @@ -17,10 +17,8 @@ #pragma once void rgb_matrix_init_user(void); - void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); - bool is_caps_lock_indicator(uint16_t keycode); +bool is_caps_word_indicator(uint16_t keycode); bool is_transparent(uint16_t keycode); bool is_not_transparent(uint16_t keycode); - diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk index af720e37ee7b..b54f6bf491b3 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk @@ -1,6 +1,13 @@ VIA_ENABLE = yes -MOUSEKEY_ENABLE = no +ENCODER_MAP_ENABLE = yes +CAPS_WORD_ENABLE = yes +AUTOCORRECT_ENABLE = yes + +SRC += keymap_user_config.c ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) SRC += rgb_matrix_user.c -endif \ No newline at end of file +endif + +VPATH += keyboards/keychron/common +SRC += keychron_common.c From fd9392d3046130898d0ffe4b1dad64061b34c2cf Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 15:37:54 -0400 Subject: [PATCH 088/160] updated readme --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 5f6a56369167..2b9e98814074 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -15,7 +15,7 @@ - Caps Lock RGB indicator. Will light Caps Lock key with options to also light Tab key (useful for some keycap sets), and/or light all alpha keys. -- Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. +- Dynamic Fn layer RGB indicator. When Fn key is held down, any keys defined on the Fn layer in this firmware or in VIA will be highlighted. ##### Notes: From 14fbb46a8a28264f0bac5ad05bdac32f42318926 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 16:11:40 -0400 Subject: [PATCH 089/160] reversed mac/win colors --- keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h | 4 ++-- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h index 4af9ecdf85a4..392ca51091a1 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h @@ -25,8 +25,8 @@ #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable -#define DEFAULT_HUE_WIN_BASE 0 // HSV red hue (Win Base layer) -#define RGB_MATRIX_DEFAULT_HUE 80 // HSV green hue (Mac Base layer) +#define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) +#define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 2b9e98814074..adf98ee6d909 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -33,8 +33,8 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable - #define DEFAULT_HUE_WIN_BASE 0 // HSV red hue (Win Base layer) - #define RGB_MATRIX_DEFAULT_HUE 80 // HSV green hue (Mac Base layer) + #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers From ffc8ffac4b1a0e74f48ce3b99bbc27a16293bed8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 16:14:31 -0400 Subject: [PATCH 090/160] disabled autocorrect by default when eeprom is cleared --- .../keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c index 31591422bc6f..d41ffeb48aad 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c @@ -47,6 +47,9 @@ void eeconfig_init_user(void) { user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; user_config_write_eeprom(); + + // toggle autocorrect off by default + if (autocorrect_is_enabled()) { autocorrect_toggle(); } } void user_config_read_eeprom(void) { From 98d77ac55c8383003f55e6d4c1d132051e90c4d3 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:02:47 -0400 Subject: [PATCH 091/160] autocorrect is now disabled at startup --- keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c | 3 +++ .../keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 916e4fa110cb..0a8da3f12fdb 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -93,6 +93,9 @@ void matrix_init_user(void) { void keyboard_post_init_user(void) { user_config_read_eeprom(); + + // toggle autocorrect off at startup + if (autocorrect_is_enabled()) { autocorrect_toggle(); } } void housekeeping_task_user(void) { diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c index d41ffeb48aad..31591422bc6f 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c @@ -47,9 +47,6 @@ void eeconfig_init_user(void) { user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; user_config_write_eeprom(); - - // toggle autocorrect off by default - if (autocorrect_is_enabled()) { autocorrect_toggle(); } } void user_config_read_eeprom(void) { From 52ce0dbaa5db8e6d2c8f12a38bd5533d5a70377c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:04:57 -0400 Subject: [PATCH 092/160] updated readme --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index adf98ee6d909..9b1b8c90668f 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -8,6 +8,7 @@ - Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) + - Autocorrect is disabled at startup, but can be enabled using keycode AC_TOGG (Fn+Left Shift) - Uses getreuer's autocorrect dictionary. [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) From 3a669ec54a7a2fd14e1710841044f5b6c67d36f8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:27:37 -0400 Subject: [PATCH 093/160] added config.h option to set autocorrect on/off at startup --- .../keychron/q1/ansi/keymaps/mkillewald/config.h | 10 +++++++--- .../keychron/q1/ansi/keymaps/mkillewald/keymap.c | 2 ++ .../keychron/q1/ansi/keymaps/mkillewald/readme.md | 15 +++++++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h index 392ca51091a1..42eb10b21855 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h @@ -32,20 +32,24 @@ #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers +// Autocorrect is off at start up. If you want Autocorrect to be on at startup, +// remove or comment out the following line +#define AUTOCORRECT_OFF_AT_STARTUP + // Caps Lock RGB indicator color #define CAPS_LOCK_INDICATOR_COLOR RGB_WHITE // Dynamic Fn Layer RGB indicator options #define FN1_LAYER_COLOR RGB_YELLOW +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_WHITE + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD -// Caps Word RGB indicator color -#define CAPS_WORD_INDICATOR_COLOR RGB_WHITE - // Caps Word will light left Shift, left Control and left Option (or left Windows // key) when acitvated. Remove this line if you want Caps Word to only light left // Shift when enabled. diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 0a8da3f12fdb..443bc48b2a19 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -94,8 +94,10 @@ void matrix_init_user(void) { void keyboard_post_init_user(void) { user_config_read_eeprom(); +#ifdef AUTOCORRECT_OFF_AT_STARTUP // toggle autocorrect off at startup if (autocorrect_is_enabled()) { autocorrect_toggle(); } +#endif } void housekeeping_task_user(void) { diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 9b1b8c90668f..2c0c966ed1ae 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -8,7 +8,6 @@ - Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - - Autocorrect is disabled at startup, but can be enabled using keycode AC_TOGG (Fn+Left Shift) - Uses getreuer's autocorrect dictionary. [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) @@ -42,6 +41,14 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers ``` +Autocorrect option: + +``` + // Autocorrect is off at start up. If you want Autocorrect to be on at startup, + // remove or comment out the following line + #define AUTOCORRECT_OFF_AT_STARTUP +``` + Caps Lock RGB indicator option: ``` @@ -57,14 +64,14 @@ Dynamic Fn Layer RGB indicator options: Caps Word options: ``` + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_WHITE + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD - // Caps Word RGB indicator color - #define CAPS_WORD_INDICATOR_COLOR RGB_WHITE - // Caps Word will light left Shift, left Control and left Option (or left Windows // key) when acitvated. Remove this line if you want Caps Word to only light left // Shift when enabled. From 99ec8a03d30f7e04135b76a77d375c82f6a71125 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:44:50 -0400 Subject: [PATCH 094/160] removed ENCODER_MAP_ENABLE --- keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk index b54f6bf491b3..cac2a81c7962 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk @@ -1,5 +1,4 @@ VIA_ENABLE = yes -ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes From 2cc4e6bedb1aa2d6df6ac9bf408be793e0a7c0ad Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 02:21:33 -0400 Subject: [PATCH 095/160] renamed config.h option for clarity --- keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h | 4 ++-- .../keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c | 4 ++-- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h index 42eb10b21855..ff12be40c2b8 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h @@ -23,8 +23,8 @@ #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable -#define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable -#define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c index 31591422bc6f..3e1fbcd8a561 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c @@ -39,8 +39,8 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; - user_config.enable_mac_base = DEFAULT_ENABLE_MAC_BASE; - user_config.enable_win_base = DEFAULT_ENABLE_WIN_BASE; + user_config.enable_mac_base = DEFAULT_RGB_ENABLE_MAC_BASE; + user_config.enable_win_base = DEFAULT_RGB_ENABLE_WIN_BASE; user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 2c0c966ed1ae..7961b4eae3bd 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -31,8 +31,8 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable - #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable - #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers From 4c3b73137a50ba3a57f7450a26a18e010924bd76 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 02:26:32 -0400 Subject: [PATCH 096/160] re-added lost changelog history --- .../q1/ansi/keymaps/mkillewald/readme.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 7961b4eae3bd..82967740bb9c 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -123,3 +123,23 @@ v2.0.1 April 11, 2023 v2.0.0 April 11, 2023 - copied code from Q2 v2.0.0 firware over + +v1.0.4 October 9, 2021 +- Caps Lock and Fn layer toggles are now stored in eeprom so settings will remain when Q1 is unplugged + +v1.0.3 October 8, 2021 +- now using keycode toggles instead of preprocessor directives to set the various Caps Lock and Fn Layer RGB lighting options. This allows for setting the options from user space without having to recompile. + +v1.0.2 October 7, 2021 +- adapted Grayson Carr's (gtg465x) Caps Lock alphas and dynamic Fn layer RGB routines +- added CAPS_LOCK_INDICATOR_LIGHT_TAB config option to enable/disable lighting Tab with Caps Lock indicator +- added FN_LAYER_COLOR config option to set FN layer static color + +v1.0.1 October 7, 2021 +- Mission Control and Launchpad custom keycodes are now defined using the VIA user keycodes range so thay can be labeled properly in VIA (adopted change from gtg465x) + +v1.0.0 September 30, 2021 +- Initial release built upon keymap by Grayson Carr (gtg465x) +- defined Mission Control (F3) and Launchpad (F4) keycodes for macOs +- RGB backlight turns off when computer sleeps +- added Caps Lock indicator lighting both the Caps Lock and Tab LEDs for better effect on non-backlit keycaps \ No newline at end of file From b1ca1d02373eaefa9a31bc4b4374a4aebecc9618 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 02:28:11 -0400 Subject: [PATCH 097/160] fixed typo --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 82967740bb9c..a15c397d5aa3 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -122,7 +122,7 @@ v2.0.1 April 11, 2023 - enabled separate RGB toggle for each base layer (Mac / Win) v2.0.0 April 11, 2023 -- copied code from Q2 v2.0.0 firware over +- copied code from Q2 v2.0.0 keymap over v1.0.4 October 9, 2021 - Caps Lock and Fn layer toggles are now stored in eeprom so settings will remain when Q1 is unplugged From be9a31e9043412007ba454ee619e916cffe3b794 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 11:29:55 -0400 Subject: [PATCH 098/160] updated readme --- .../q1/ansi/keymaps/mkillewald/readme.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index a15c397d5aa3..7d209f223fe0 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -89,27 +89,27 @@ Caps Word options: - Fn+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) - toggle turning off RGB for keys with no definition - Fn+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) - - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR - Mac mode only - Fn+Esc (KC_LBMAC) will lock and sleep display - - Fn1+< sets my secondary display to 0° rotation - - Fn1+> sets my secondary display to 90° rotation + - Fn+< sets my secondary display to 0° rotation + - Fn+> sets my secondary display to 90° rotation Note: display rotation requires additional software and changes made, see this link for more information: [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) All custom keycodes can be moved to different keys in VIA by using the following: -- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle -- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle -- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Off Toggle -- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle -- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac +- CUSTOM(64) = KC_LTTOG (default: Fn+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn+C) Fn layer Trasnparent Key Off Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn+Esc) Lock and Blank Mac ## Known Issues -1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working -2. Keychron LED test Fn1+Home+Right is not working +1. Keychron factory reset (clear eeprom) Fn+J+Z is not working +2. Keychron LED test Fn+Home+Right is not working It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. From cacc26b0b820a1b62c47232ae7916cfa8d907c97 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 25 Apr 2023 20:02:11 -0400 Subject: [PATCH 099/160] code reorg utilizing userspace folder --- .../q1/ansi/keymaps/mkillewald/config.h | 6 +- .../q1/ansi/keymaps/mkillewald/keymap.c | 272 +++--------------- .../keymaps/mkillewald/keymap_user_config.c | 179 ------------ .../keymaps/mkillewald/keymap_user_config.h | 52 ---- .../mkillewald/{keymap_user.h => layers.h} | 2 +- .../ansi/keymaps/mkillewald/rgb_matrix_user.c | 99 ------- .../ansi/keymaps/mkillewald/rgb_matrix_user.h | 24 -- .../q1/ansi/keymaps/mkillewald/rules.mk | 6 - 8 files changed, 36 insertions(+), 604 deletions(-) delete mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c delete mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h rename keyboards/keychron/q1/ansi/keymaps/mkillewald/{keymap_user.h => layers.h} (99%) delete mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c delete mode 100644 keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h index ff12be40c2b8..595ac12294e5 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/config.h @@ -16,15 +16,13 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. - // default options applied when eeprom is cleared #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable -#define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable -#define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 443bc48b2a19..f0fb9681cb76 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -16,37 +16,13 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" -#include "keymap_user.h" -#include "keymap_user_config.h" -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix_user.h" -#endif +#include "mkillewald.h" +#include "eeprom_user_config.h" +#include "rgb_matrix_user.h" +#include "layers.h" // clang-format off -enum my_bootloader_state { - BOOTLOADER_INACTIVE, - BOOTLOADER_PRESSED, - BOOTLOADER_WAIT, - BOOTLOADER_DO -} bootloader_state; - -enum my_keycodes { - KC_LIGHT_TAB_TOGGLE = QK_USER_0, - KC_LIGHT_ALPHAS_TOGGLE, - KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE, - KC_LOCK_BLANK_MAC -}; - -#define KC_LTTOG KC_LIGHT_TAB_TOGGLE -#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE -#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE -#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_LBMAC KC_LOCK_BLANK_MAC - -static bool win_mode; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_82( @@ -86,233 +62,51 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init_user(); -#endif + matrix_init_mkillewald(); } void keyboard_post_init_user(void) { - user_config_read_eeprom(); - -#ifdef AUTOCORRECT_OFF_AT_STARTUP - // toggle autocorrect off at startup - if (autocorrect_is_enabled()) { autocorrect_toggle(); } -#endif + keyboard_post_init_mkillewald(); } void housekeeping_task_user(void) { - switch(bootloader_state) { - case BOOTLOADER_DO: - // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. - reset_keyboard(); - break; - case BOOTLOADER_WAIT: - // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my - // Q2 needed this extra wait frame. - bootloader_state = BOOTLOADER_DO; - break; - case BOOTLOADER_PRESSED: - // User pressed bootloader keycode and RGB was disabled earlier in this - // frame. However RGB changes wont take place immediately, so we set a - // flag here which will be caught at end of the next frame. - bootloader_state = BOOTLOADER_WAIT; - break; - default: - break; - } - housekeeping_task_keychron(); + housekeeping_task_mkillewald(); } -bool dip_switch_update_user(uint8_t index, bool active) { - win_mode = (index == 0 && active ? true : false); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_mkillewald(keycode, record)) { return false; } return true; } -layer_state_t default_layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { case MAC_BASE: - // load mac base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_reload_from_eeprom(); - - // check disable - if (!user_config_get_enable_mac_base()) { - rgb_matrix_disable_noeeprom(); - } - break; case WIN_BASE: - // load win base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - - // check disable - if (!user_config_get_enable_win_base()) { - rgb_matrix_disable_noeeprom(); +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); } +#endif break; - default: + case MAC_FN: + case WIN_FN: +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } break; } - return state; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (process_record_keychron(keycode, record)) { - switch (keycode) { - case QK_BOOT: - // We want to turn off LEDs before calling bootloader, so here - // we call rgb_matrix_disable_noeeprom() and set a flag because - // the LEDs won't be updated until the next frame. - if (record->event.pressed) { - rgb_matrix_disable_noeeprom(); - bootloader_state = BOOTLOADER_PRESSED; - } - return false; // Skip all further processing of this key - case RGB_TOG: - if (record->event.pressed) { - rgb_matrix_toggle_noeeprom(); - if (win_mode) { - user_config_toggle_enable_win_base(); - } else { - user_config_toggle_enable_mac_base(); - } - } - return false; // Skip all further processing of this key - case RGB_MOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_RMOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_reverse_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case KC_LIGHT_TAB_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_tab(); - } - return false; // Skip all further processing of this key - case KC_LIGHT_ALPHAS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_alphas(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_transparent_keys_off(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_COLOR_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_color_enable(); - } - return false; // Skip all further processing of this key - case KC_LOCK_BLANK_MAC: - if (record->event.pressed) { - send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } - } - return true; + return false; } diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c deleted file mode 100644 index 3e1fbcd8a561..000000000000 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 "keymap_user_config.h" - -typedef struct { - uint8_t caps_lock_light_tab; - uint8_t caps_lock_light_alphas; - uint8_t fn_layer_transparent_keys_off; - uint8_t fn_layer_color_enable; - uint8_t enable_mac_base; - uint8_t enable_win_base; - uint8_t mode_win_base; - uint8_t spd_win_base; - HSV hsv_win_base; - HSV hsv_mac_fn1; - HSV hsv_win_fn1; - HSV hsv_fn2; -} user_config_t; - -user_config_t user_config; - -void eeconfig_init_user(void) { - user_config.caps_lock_light_tab = DEFAULT_CAPS_LOCK_LIGHT_TAB; - user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; - user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; - user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; - user_config.enable_mac_base = DEFAULT_RGB_ENABLE_MAC_BASE; - user_config.enable_win_base = DEFAULT_RGB_ENABLE_WIN_BASE; - user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; - user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; - user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; - user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; - user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; - user_config_write_eeprom(); -} - -void user_config_read_eeprom(void) { - eeconfig_read_user_datablock(&user_config); -} - -void user_config_write_eeprom(void) { - eeconfig_update_user_datablock(&user_config); -} - -// getters - -uint8_t user_config_get_caps_lock_light_tab(void) { - return user_config.caps_lock_light_tab; -} - -uint8_t user_config_get_caps_lock_light_alphas(void) { - return user_config.caps_lock_light_alphas; -} - -uint8_t user_config_get_fn_layer_transparent_keys_off(void) { - return user_config.fn_layer_transparent_keys_off; -} - -uint8_t user_config_get_fn_layer_color_enable(void) { - return user_config.fn_layer_color_enable; -} - -uint8_t user_config_get_enable_mac_base(void) { - return user_config.enable_mac_base; -} - -uint8_t user_config_get_enable_win_base(void) { - return user_config.enable_win_base; -} - -uint8_t user_config_get_mode_win_base(void) { - return user_config.mode_win_base; -} - -uint8_t user_config_get_spd_win_base(void) { - return user_config.spd_win_base; -} - -HSV user_config_get_hsv_win_base(void) { - return user_config.hsv_win_base; -} - -HSV user_config_get_hsv_mac_fn1(void) { - return user_config.hsv_mac_fn1; -} - -HSV user_config_get_hsv_win_fn1(void) { - return user_config.hsv_win_fn1; -} - -HSV user_config_get_hsv_fn2(void) { - return user_config.hsv_fn2; -} - -// setters - -void user_config_toggle_caps_lock_light_tab(void) { - user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit - user_config_write_eeprom(); -} - -void user_config_toggle_caps_lock_light_alphas(void) { - user_config.caps_lock_light_alphas ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_fn_layer_transparent_keys_off(void) { - user_config.fn_layer_transparent_keys_off ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_fn_layer_color_enable(void) { - user_config.fn_layer_color_enable ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_enable_mac_base(void) { - user_config.enable_mac_base ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_enable_win_base(void) { - user_config.enable_win_base ^= 1; - user_config_write_eeprom(); -} - -void user_config_set_mode_win_base(uint8_t mode) { - user_config.mode_win_base = mode; - user_config_write_eeprom(); -} - -void user_config_set_spd_win_base(uint8_t spd) { - user_config.spd_win_base = spd; - user_config_write_eeprom(); -} - -void user_config_set_hsv_win_base(HSV hsv) { - user_config.hsv_win_base = hsv; - user_config_write_eeprom(); -} - -void user_config_set_hsv_mac_fn1(HSV hsv) { - user_config.hsv_mac_fn1 = hsv; - user_config_write_eeprom(); -} - -void user_config_set_hsv_win_fn1(HSV hsv) { - user_config.hsv_win_fn1 = hsv; - user_config_write_eeprom(); -} - -void user_config_set_hsv_fn2(HSV hsv) { - user_config.hsv_fn2 = hsv; - user_config_write_eeprom(); -} - - - - - - - - - diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h deleted file mode 100644 index 34d7560e48c7..000000000000 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user_config.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 - -void user_config_read_eeprom(void); -void user_config_write_eeprom(void); - -// getters - -uint8_t user_config_get_caps_lock_light_tab(void); -uint8_t user_config_get_caps_lock_light_alphas(void); -uint8_t user_config_get_fn_layer_transparent_keys_off(void); -uint8_t user_config_get_fn_layer_color_enable(void); -uint8_t user_config_get_enable_mac_base(void); -uint8_t user_config_get_enable_win_base(void); -uint8_t user_config_get_mode_win_base(void); -uint8_t user_config_get_spd_win_base(void); -HSV user_config_get_hsv_win_base(void); -HSV user_config_get_hsv_mac_fn1(void); -HSV user_config_get_hsv_win_fn1(void); -HSV user_config_get_hsv_fn2(void); - -// setters - -void user_config_toggle_caps_lock_light_tab(void); -void user_config_toggle_caps_lock_light_alphas(void); -void user_config_toggle_fn_layer_transparent_keys_off(void); -void user_config_toggle_fn_layer_color_enable(void); -void user_config_toggle_enable_mac_base(void); -void user_config_toggle_enable_win_base(void); -void user_config_set_mode_win_base(uint8_t mode); -void user_config_set_spd_win_base(uint8_t spd); -void user_config_set_hsv_win_base(HSV hsv); -void user_config_set_hsv_mac_fn1(HSV hsv); -void user_config_set_hsv_win_fn1(HSV hsv); -void user_config_set_hsv_fn2(HSV hsv); - - diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h similarity index 99% rename from keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h rename to keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h index 35d2483aa677..1bb7421d6e41 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h @@ -21,4 +21,4 @@ enum layers{ MAC_FN, WIN_BASE, WIN_FN -}; +}; \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c deleted file mode 100644 index 2e43983ae890..000000000000 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.c +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 "keychron_common.h" -#include "rgb_matrix_user.h" -#include "keymap_user.h" -#include "keymap_user_config.h" - -keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; - -void rgb_matrix_init_user(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - uint8_t led_index = g_led_config.matrix_co[row][col]; - if (led_index != NO_LED) { - led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; - } - } - } -} - -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif -#ifdef CAPS_WORD_INDICATOR_COLOR - if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); - } -#endif - break; - case MAC_FN: - case WIN_FN: -#ifdef FN1_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} - -void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { - for (uint8_t i = led_min; i < led_max; i++) { - uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); - if ((*is_keycode)(keycode)) { - rgb_matrix_set_color(i, red, green, blue); - } - } -} - -bool is_caps_lock_indicator(uint16_t keycode) { - bool indicator = keycode == KC_CAPS; - - if (user_config_get_caps_lock_light_tab()) { - indicator = keycode == KC_TAB || keycode == KC_CAPS; - } - - if (user_config_get_caps_lock_light_alphas()) { - return (KC_A <= keycode && keycode <= KC_Z) || indicator; - } else { - return indicator; - } -} - -bool is_caps_word_indicator(uint16_t keycode) { - bool indicator = keycode == KC_LSFT; -#ifdef CAPS_WORD_LIGHT_LOWER_LEFT_CORNER - indicator = keycode == KC_LSFT || keycode == KC_LCTL || keycode == KC_LOPT; -#endif - return indicator; -} - -bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } -bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h deleted file mode 100644 index c6d5e65548d6..000000000000 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rgb_matrix_user.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 - -void rgb_matrix_init_user(void); -void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); -bool is_caps_lock_indicator(uint16_t keycode); -bool is_caps_word_indicator(uint16_t keycode); -bool is_transparent(uint16_t keycode); -bool is_not_transparent(uint16_t keycode); diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk index cac2a81c7962..844e021fa635 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk @@ -2,11 +2,5 @@ VIA_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes -SRC += keymap_user_config.c - -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - SRC += rgb_matrix_user.c -endif - VPATH += keyboards/keychron/common SRC += keychron_common.c From 2224dc5c06b8ff9f11a30b41c7ead509c8668422 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 00:27:22 -0400 Subject: [PATCH 100/160] moved rgb_matrix_indicators_advanced_user to userspace folder, added missing QK_BOOT keycodd to WIN_FN layer --- .../q1/ansi/keymaps/mkillewald/keymap.c | 40 +------------------ .../q1/ansi/keymaps/mkillewald/layers.h | 6 ++- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index f0fb9681cb76..48865327f3f4 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [WIN_FN] = LAYOUT_ansi_82( _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, @@ -61,14 +61,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on -void matrix_init_user(void) { - matrix_init_mkillewald(); -} - -void keyboard_post_init_user(void) { - keyboard_post_init_mkillewald(); -} - void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_mkillewald(); @@ -80,33 +72,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif -#ifdef CAPS_WORD_INDICATOR_COLOR - if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); - } -#endif - break; - case MAC_FN: - case WIN_FN: -#ifdef FN1_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h index 1bb7421d6e41..e8c6222cac4d 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h @@ -21,4 +21,8 @@ enum layers{ MAC_FN, WIN_BASE, WIN_FN -}; \ No newline at end of file +}; + +#define MAC_FN1 MAC_FN +#define WIN_FN1 WIN_FN +#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key \ No newline at end of file From 8474a268e2bfb5318c91eeeab84a56c78376e26f Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 20:06:32 -0400 Subject: [PATCH 101/160] moved VIA_ENABLE into userspace folder --- keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk index 844e021fa635..8bf77b0dffca 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/rules.mk @@ -1,4 +1,3 @@ -VIA_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes From 4e0e3ce8b7d8c737c95b8c7d191fbde2d061d1ad Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 01:44:49 -0400 Subject: [PATCH 102/160] initial commit --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 76 +++++++++++++++++++ .../ansi_encoder/keymaps/mkillewald/rules.mk | 5 ++ 2 files changed, 81 insertions(+) create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c new file mode 100644 index 000000000000..510287acecb0 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "keychron_common.h" + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_82( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_MUTE, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD,MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_ansi_82( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_BASE] = LAYOUT_ansi_82( + KC_ESC, 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_DEL, KC_MUTE, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_ansi_82( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, +}; +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { + return false; + } + + return true; +} diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk new file mode 100644 index 000000000000..9cf1a9b56cba --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes + +VPATH += keyboards/keychron/common +SRC += keychron_common.c From f8d4a3a80b412e68d789e1c50b5fd7cbe85edb16 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 02:04:01 -0400 Subject: [PATCH 103/160] copied code over from q2 custom branch --- .../keymaps/mkillewald/autocorrect_data.h | 809 ++++++++++++++++++ .../mkillewald/autocorrection_dict_extra.txt | 473 ++++++++++ .../ansi_encoder/keymaps/mkillewald/config.h | 52 ++ .../ansi_encoder/keymaps/mkillewald/keymap.c | 295 ++++++- .../keymaps/mkillewald/keymap_q2.c | 344 ++++++++ .../keymaps/mkillewald/keymap_user.h | 26 + .../keymaps/mkillewald/keymap_user_config.c | 179 ++++ .../keymaps/mkillewald/keymap_user_config.h | 52 ++ .../ansi_encoder/keymaps/mkillewald/readme.md | 139 +++ .../keymaps/mkillewald/rgb_matrix_user.c | 99 +++ .../keymaps/mkillewald/rgb_matrix_user.h | 24 + .../ansi_encoder/keymaps/mkillewald/rules.mk | 8 + 12 files changed, 2483 insertions(+), 17 deletions(-) create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h new file mode 100644 index 000000000000..ff25efaf6cba --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h @@ -0,0 +1,809 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once + +// Autocorrection dictionary (400 entries): +// :htere -> there +// abbout -> about +// abotu -> about +// baout -> about +// :theri -> their +// :thier -> their +// :owudl -> would +// woudl -> would +// peaple -> people +// peolpe -> people +// peopel -> people +// poeple -> people +// poeople -> people +// :hwihc -> which +// whcih -> which +// whihc -> which +// whlch -> which +// wihch -> which +// coudl -> could +// :htikn -> think +// :htink -> think +// thikn -> think +// thiunk -> think +// tihkn -> think +// :olther -> other +// :otehr -> other +// baceause -> because +// beacuse -> because +// becasue -> because +// beccause -> because +// becouse -> because +// becuase -> because +// theese -> these +// :goign -> going +// :gonig -> going +// :yaers -> years +// :yeasr -> years +// :thsoe -> those +// shoudl -> should +// raelly -> really +// realy -> really +// relaly -> really +// bedore -> before +// befoer -> before +// littel -> little +// beeing -> being +// :hwile -> while +// aroud -> around +// arround -> around +// arund -> around +// thign -> thing +// thigsn -> things +// thnigs -> things +// anohter -> another +// beteen -> between +// beween -> between +// bewteen -> between +// :eveyr -> every +// :graet -> great +// :agian -> again +// :sicne -> since +// alwasy -> always +// alwyas -> always +// throught -> thought +// :acheiv -> achiev +// almsot -> almost +// alomst -> almost +// chnage -> change +// chekc -> check +// childen -> children +// claer -> clear +// comapny -> company +// contian -> contain +// elasped -> elapsed +// feild -> field +// fitler -> filter +// firts -> first +// follwo -> follow +// :foudn -> found +// frequecy -> frequency +// firend -> friend +// freind -> friend +// heigth -> height +// iamge -> image +// inital -> initial +// intput -> input +// laguage -> language +// lenght -> length +// levle -> level +// libary -> library +// :moeny -> money +// mysefl -> myself +// ouptut -> output +// ouput -> output +// probaly -> probably +// probelm -> problem +// recrod -> record +// reponse -> response +// reprot -> report +// singel -> single +// stregth -> strength +// strengh -> strength +// tkaes -> takes +// therfore -> therefore +// todya -> today +// toghether -> together +// unkown -> unknown +// unqiue -> unique +// widht -> width +// aberation -> aberration +// accross -> across +// adviced -> advised +// aledge -> allege +// alledge -> allege +// amature -> amateur +// anomolous -> anomalous +// anomoly -> anomaly +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// asthetic -> aesthetic +// auxilary -> auxiliary +// auxillary -> auxiliary +// auxilliary -> auxiliary +// bankrupcy -> bankruptcy +// busness -> business +// bussiness -> business +// calander -> calendar +// commitee -> committee +// comittee -> committee +// competance -> competence +// competant -> competent +// concensus -> consensus +// cognizent -> cognizant +// copywrite: -> copyright +// choosen -> chosen +// collegue -> colleague +// excercise -> exercise +// :grammer -> grammar +// :guage -> gauge +// govement -> government +// govenment -> government +// goverment -> government +// governmnet -> government +// govorment -> government +// govornment -> government +// guaratee -> guarantee +// garantee -> guarantee +// gaurantee -> guarantee +// heirarchy -> hierarchy +// hygeine -> hygiene +// hypocracy -> hypocrisy +// hypocrasy -> hypocrisy +// hypocricy -> hypocrisy +// hypocrit: -> hypocrite +// looses: -> loses +// maintence -> maintenance +// morgage -> mortgage +// neccesary -> necessary +// necesary -> necessary +// pallete -> palette +// paralel -> parallel +// parralel -> parallel +// parrallel -> parallel +// priviledge -> privilege +// probablly -> probably +// prominant -> prominent +// propogate -> propagate +// proove -> prove +// psuedo -> pseudo +// reciept -> receipt +// receiev -> receiv +// reciev -> receiv +// recepient -> recipient +// recipiant -> recipient +// relevent -> relevant +// repitition -> repetition +// safty -> safety +// saftey -> safety +// seperat -> separat +// spectogram -> spectrogram +// symetric -> symmetric +// tolerence -> tolerance +// cacheing -> caching +// complier -> compiler +// doulbe -> double +// dyanmic -> dynamic +// excecut -> execut +// failse -> false +// fales -> false +// fasle -> false +// flase -> false +// indeces -> indices +// indecies -> indices +// indicies -> indices +// interator -> iterator +// looup -> lookup +// namesapce -> namespace +// namespcae -> namespace +// nulltpr -> nullptr +// operaotr -> operator +// overide -> override +// ovveride -> override +// poitner -> pointer +// :rference -> reference +// referece -> reference +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// teamplate -> template +// tempalte -> template +// :ture -> true +// retrun -> return +// retun -> return +// reutrn -> return +// cosnt -> const +// virutal -> virtual +// vitual -> virtual +// yeild -> yield +// :alot: -> a lot +// :andteh -> and the +// :andthe -> and the +// :asthe -> as the +// :atthe -> at the +// abouta -> about a +// aboutit -> about it +// aboutthe -> about the +// :tothe -> to the +// didnot -> did not +// fromthe -> from the +// :agred -> agreed +// :ajust -> adjust +// :anual -> annual +// :asign -> assign +// :aslo: -> also +// :casue -> cause +// :choses -> chooses +// :gaurd -> guard +// :haev -> have +// :hapen -> happen +// :idaes -> ideas +// :jsut: -> just +// :jstu: -> just +// :knwo -> know +// :konw -> know +// :kwno -> know +// :ocuntry -> country +// :ocur -> occur +// :socre -> score +// :szie -> size +// :the:the: -> the +// :turth -> truth +// :uesd: -> used +// :usally -> usually +// abilties -> abilities +// abilty -> ability +// abvove -> above +// accesories -> accessories +// accomodate -> accommodate +// acommodate -> accommodate +// acomplish -> accomplish +// actualy -> actually +// acurate -> accurate +// acutally -> actually +// addtion -> addition +// againnst -> against +// aganist -> against +// aggreed -> agreed +// agianst -> against +// ahppn -> happen +// allign -> align +// anytying -> anything +// aquire -> acquire +// availabe -> available +// availaible -> available +// availalbe -> available +// availble -> available +// availiable -> available +// avalable -> available +// avaliable -> available +// avilable -> available +// bandwith -> bandwidth +// begginer -> beginner +// beleif -> belief +// beleive -> believe +// belive -> believe +// breif -> brief +// burried -> buried +// caluclate -> calculate +// caluculate -> calculate +// calulate -> calculate +// catagory -> category +// cauhgt -> caught +// ceratin -> certain +// certian -> certain +// cheif -> chief +// cieling -> ceiling +// circut -> circuit +// clasic -> classic +// cmoputer -> computer +// coform -> conform +// comming: -> coming +// considerd -> considered +// dervied -> derived +// desicion -> decision +// diferent -> different +// diferrent -> different +// differnt -> different +// diffrent -> different +// divison -> division +// effecient -> efficient +// eligable -> eligible +// elpased -> elapsed +// embarass -> embarrass +// embeded -> embedded +// encypt -> encrypt +// finaly -> finally +// foriegn -> foreign +// foward -> forward +// fraciton -> fraction +// fucntion -> function +// fufill -> fulfill +// fullfill -> fulfill +// futher -> further +// ganerate -> generate +// generaly -> generally +// greatful -> grateful +// heigher -> higher +// higest -> highest +// howver -> however +// hydogen -> hydrogen +// importamt -> important +// inclued -> include +// insted -> instead +// intrest -> interest +// invliad -> invalid +// largst -> largest +// learnign -> learning +// liasion -> liaison +// likly -> likely +// lisense -> license +// listner -> listener +// macthing -> matching +// manefist -> manifest +// mesage -> message +// naturual -> natural +// occassion -> occasion +// occured -> occurred +// particualr -> particular +// paticular -> particular +// peice -> piece +// perhasp -> perhaps +// perheaps -> perhaps +// perhpas -> perhaps +// perphas -> perhaps +// persue -> pursue +// posess -> possess +// postion -> position +// preiod -> period +// primarly -> primarily +// privte -> private +// proccess -> process +// proeprty -> property +// propery -> property +// realtion -> relation +// reasearch -> research +// recuring -> recurring +// refered -> referred +// regluar -> regular +// releated -> related +// resutl -> result +// reuslt -> result +// reveiw -> review +// satisifed -> satisfied +// scheduel -> schedule +// sequnce -> sequence +// similiar -> similar +// simmilar -> similar +// slighly -> slightly +// somehwat -> somewhat +// statment -> statement +// sucess -> success +// succsess -> success +// sugest -> suggest +// sumary -> summary +// supress -> suppress +// surpress -> suppress +// thresold -> threshold +// tongiht -> tonight +// tranpose -> transpose +// typcial -> typical +// udpate -> update +// ususally -> usually +// verticies -> vertices +// whereever -> wherever +// wherre -> where +// wierd -> weird + +#define AUTOCORRECT_MIN_LENGTH 5 // "abotu" +#define AUTOCORRECT_MAX_LENGTH 10 // "auxilliary" +#define DICTIONARY_SIZE 5967 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { + 0x6C, 0x43, 0x00, 0x04, 0xD4, 0x00, 0x06, 0xEC, 0x00, 0x07, 0x64, 0x01, 0x08, 0x0F, 0x03, 0x09, + 0xA9, 0x08, 0x0A, 0xCC, 0x08, 0x0B, 0x44, 0x09, 0x0C, 0xF6, 0x09, 0x0E, 0x00, 0x0A, 0x0F, 0x1C, + 0x0A, 0x10, 0x4F, 0x0B, 0x11, 0x81, 0x0B, 0x12, 0xAF, 0x0D, 0x13, 0xE3, 0x0D, 0x15, 0xFD, 0x0D, + 0x16, 0xC2, 0x0F, 0x17, 0x79, 0x11, 0x18, 0xC9, 0x14, 0x19, 0xD2, 0x14, 0x1A, 0x08, 0x15, 0x1C, + 0x22, 0x15, 0x00, 0x47, 0x59, 0x00, 0x08, 0x63, 0x00, 0x0A, 0x82, 0x00, 0x12, 0x8E, 0x00, 0x16, + 0x98, 0x00, 0x17, 0xA3, 0x00, 0x18, 0xCA, 0x00, 0x00, 0x16, 0x08, 0x18, 0x2C, 0x00, 0x83, 0x73, + 0x65, 0x64, 0x00, 0x4B, 0x6A, 0x00, 0x17, 0x73, 0x00, 0x00, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, + 0x00, 0x84, 0x00, 0x0C, 0x15, 0x1A, 0x1C, 0x13, 0x12, 0x06, 0x00, 0x85, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x00, 0x11, 0x0C, 0x10, 0x10, 0x12, 0x06, 0x00, 0x84, 0x69, 0x6E, 0x67, 0x00, 0x0F, 0x16, + 0x04, 0x2C, 0x00, 0x83, 0x6C, 0x73, 0x6F, 0x00, 0x08, 0x16, 0x12, 0x12, 0x0F, 0x00, 0x84, 0x73, + 0x65, 0x73, 0x00, 0x4C, 0xAD, 0x00, 0x12, 0xB7, 0x00, 0x18, 0xC1, 0x00, 0x00, 0x15, 0x06, 0x12, + 0x13, 0x1C, 0x0B, 0x00, 0x80, 0x65, 0x00, 0x0F, 0x04, 0x2C, 0x00, 0x83, 0x20, 0x6C, 0x6F, 0x74, + 0x00, 0x16, 0x0D, 0x2C, 0x00, 0x83, 0x75, 0x73, 0x74, 0x00, 0x17, 0x16, 0x0D, 0x2C, 0x00, 0x83, + 0x75, 0x73, 0x74, 0x00, 0x57, 0xDB, 0x00, 0x1C, 0xE4, 0x00, 0x00, 0x18, 0x12, 0x05, 0x04, 0x00, + 0x80, 0x20, 0x61, 0x00, 0x07, 0x12, 0x17, 0x00, 0x81, 0x61, 0x79, 0x00, 0x4B, 0xF6, 0x00, 0x0C, + 0x1C, 0x01, 0x0E, 0x5C, 0x01, 0x00, 0x4C, 0xFD, 0x00, 0x17, 0x14, 0x01, 0x00, 0x4B, 0x04, 0x01, + 0x1A, 0x0A, 0x01, 0x00, 0x1A, 0x00, 0x81, 0x63, 0x68, 0x00, 0x0B, 0x2C, 0x00, 0x84, 0x77, 0x68, + 0x69, 0x63, 0x68, 0x00, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, 0x00, 0x50, 0x29, 0x01, 0x15, + 0x35, 0x01, 0x16, 0x43, 0x01, 0x17, 0x4C, 0x01, 0x00, 0x11, 0x04, 0x1C, 0x07, 0x00, 0x84, 0x6E, + 0x61, 0x6D, 0x69, 0x63, 0x00, 0x17, 0x08, 0x10, 0x1C, 0x16, 0x00, 0x84, 0x6D, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x00, 0x04, 0x0F, 0x06, 0x00, 0x81, 0x73, 0x69, 0x63, 0x00, 0x08, 0x0B, 0x17, 0x16, + 0x04, 0x00, 0x86, 0x65, 0x73, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x00, 0x08, 0x0B, 0x06, 0x00, + 0x81, 0x63, 0x6B, 0x00, 0x44, 0x7A, 0x01, 0x08, 0x86, 0x01, 0x0F, 0x54, 0x02, 0x11, 0x7C, 0x02, + 0x12, 0xB4, 0x02, 0x15, 0xCF, 0x02, 0x18, 0x07, 0x03, 0x00, 0x0C, 0x0F, 0x19, 0x11, 0x0C, 0x00, + 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x46, 0xA8, 0x01, 0x07, 0xB2, 0x01, 0x08, 0xBC, 0x01, 0x09, + 0xC7, 0x01, 0x0A, 0xD4, 0x01, 0x0C, 0xDE, 0x01, 0x13, 0xF8, 0x01, 0x15, 0x03, 0x02, 0x16, 0x26, + 0x02, 0x17, 0x32, 0x02, 0x18, 0x4B, 0x02, 0x00, 0x0C, 0x19, 0x07, 0x04, 0x00, 0x82, 0x73, 0x65, + 0x64, 0x00, 0x08, 0x05, 0x10, 0x08, 0x00, 0x81, 0x64, 0x65, 0x64, 0x00, 0x15, 0x0A, 0x0A, 0x04, + 0x00, 0x84, 0x72, 0x65, 0x65, 0x64, 0x00, 0x0C, 0x16, 0x0C, 0x17, 0x04, 0x16, 0x00, 0x83, 0x66, + 0x69, 0x65, 0x64, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, 0x00, 0x55, 0xE5, + 0x01, 0x19, 0xEE, 0x01, 0x00, 0x15, 0x18, 0x05, 0x00, 0x83, 0x69, 0x65, 0x64, 0x00, 0x15, 0x08, + 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x16, 0x04, 0x0F, 0x08, 0x00, 0x83, 0x70, 0x73, + 0x65, 0x64, 0x00, 0x48, 0x0D, 0x02, 0x0A, 0x16, 0x02, 0x18, 0x1D, 0x02, 0x00, 0x09, 0x08, 0x15, + 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x04, 0x2C, 0x00, 0x80, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, + 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x04, 0x13, 0x0F, 0x08, 0x00, 0x84, 0x61, 0x70, 0x73, 0x65, + 0x64, 0x00, 0x44, 0x39, 0x02, 0x16, 0x44, 0x02, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x84, 0x61, + 0x74, 0x65, 0x64, 0x00, 0x11, 0x0C, 0x00, 0x80, 0x61, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, + 0x81, 0x64, 0x65, 0x00, 0x4C, 0x5B, 0x02, 0x12, 0x70, 0x02, 0x00, 0x08, 0x00, 0x49, 0x64, 0x02, + 0x1C, 0x6A, 0x02, 0x00, 0x83, 0x69, 0x65, 0x6C, 0x64, 0x00, 0x83, 0x69, 0x65, 0x6C, 0x64, 0x00, + 0x16, 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x48, 0x86, 0x02, 0x0C, + 0x91, 0x02, 0x18, 0x9B, 0x02, 0x00, 0x15, 0x0C, 0x09, 0x00, 0x84, 0x72, 0x69, 0x65, 0x6E, 0x64, + 0x00, 0x08, 0x15, 0x09, 0x00, 0x83, 0x69, 0x65, 0x6E, 0x64, 0x00, 0x52, 0xA2, 0x02, 0x15, 0xAC, + 0x02, 0x00, 0x15, 0x15, 0x04, 0x00, 0x84, 0x6F, 0x75, 0x6E, 0x64, 0x00, 0x04, 0x00, 0x82, 0x6F, + 0x75, 0x6E, 0x64, 0x00, 0x4C, 0xBB, 0x02, 0x15, 0xC6, 0x02, 0x00, 0x08, 0x15, 0x13, 0x00, 0x84, + 0x65, 0x72, 0x69, 0x6F, 0x64, 0x00, 0x06, 0x08, 0x15, 0x00, 0x82, 0x6F, 0x72, 0x64, 0x00, 0x44, + 0xD9, 0x02, 0x08, 0xE4, 0x02, 0x18, 0xFD, 0x02, 0x00, 0x1A, 0x12, 0x09, 0x00, 0x83, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x00, 0x47, 0xEB, 0x02, 0x0C, 0xF5, 0x02, 0x00, 0x0C, 0x16, 0x11, 0x12, 0x06, + 0x00, 0x80, 0x65, 0x64, 0x00, 0x1A, 0x00, 0x83, 0x65, 0x69, 0x72, 0x64, 0x00, 0x04, 0x0A, 0x2C, + 0x00, 0x83, 0x75, 0x61, 0x72, 0x64, 0x00, 0x12, 0x15, 0x04, 0x00, 0x80, 0x6E, 0x64, 0x00, 0x44, + 0x43, 0x03, 0x05, 0x50, 0x03, 0x06, 0x7B, 0x03, 0x07, 0xFB, 0x03, 0x08, 0x17, 0x04, 0x0A, 0x6B, + 0x04, 0x0B, 0xE3, 0x04, 0x0C, 0x34, 0x05, 0x0F, 0x3D, 0x05, 0x11, 0x00, 0x06, 0x12, 0x1B, 0x06, + 0x13, 0x25, 0x06, 0x15, 0x2F, 0x06, 0x16, 0x9C, 0x06, 0x17, 0x52, 0x07, 0x18, 0x2D, 0x08, 0x19, + 0x73, 0x08, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, + 0x44, 0x57, 0x03, 0x0F, 0x61, 0x03, 0x00, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x80, 0x6C, 0x65, + 0x00, 0x44, 0x68, 0x03, 0x18, 0x73, 0x03, 0x00, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x82, 0x62, + 0x6C, 0x65, 0x00, 0x12, 0x07, 0x00, 0x82, 0x62, 0x6C, 0x65, 0x00, 0x48, 0x88, 0x03, 0x0C, 0x93, + 0x03, 0x11, 0x9C, 0x03, 0x13, 0xEE, 0x03, 0x00, 0x15, 0x08, 0x09, 0x08, 0x15, 0x00, 0x81, 0x6E, + 0x63, 0x65, 0x00, 0x08, 0x13, 0x00, 0x83, 0x69, 0x65, 0x63, 0x65, 0x00, 0x44, 0xA6, 0x03, 0x08, + 0xB3, 0x03, 0x18, 0xE4, 0x03, 0x00, 0x17, 0x08, 0x13, 0x10, 0x12, 0x06, 0x00, 0x83, 0x65, 0x6E, + 0x63, 0x65, 0x00, 0x55, 0xBA, 0x03, 0x17, 0xD9, 0x03, 0x00, 0x08, 0x00, 0x49, 0xC3, 0x03, 0x0F, + 0xD0, 0x03, 0x00, 0x15, 0x2C, 0x00, 0x86, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x63, 0x65, 0x00, + 0x12, 0x17, 0x00, 0x83, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x11, 0x0C, 0x04, 0x10, 0x00, 0x81, 0x61, + 0x6E, 0x63, 0x65, 0x00, 0x14, 0x08, 0x16, 0x00, 0x82, 0x65, 0x6E, 0x63, 0x65, 0x00, 0x04, 0x16, + 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x00, + 0x52, 0x07, 0x04, 0x19, 0x0D, 0x04, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, 0x12, 0x00, 0x85, + 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x00, 0x17, 0x00, 0x44, 0x26, 0x04, 0x0C, 0x31, 0x04, 0x11, + 0x3B, 0x04, 0x17, 0x5E, 0x04, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, 0x74, 0x65, 0x65, + 0x00, 0x10, 0x10, 0x12, 0x06, 0x00, 0x81, 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x00, 0x44, 0x45, + 0x04, 0x18, 0x51, 0x04, 0x00, 0x0A, 0x00, 0x86, 0x75, 0x61, 0x72, 0x61, 0x6E, 0x74, 0x65, 0x65, + 0x00, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, 0x74, 0x65, 0x65, 0x00, 0x0C, 0x10, + 0x12, 0x06, 0x00, 0x84, 0x6D, 0x69, 0x74, 0x74, 0x65, 0x65, 0x00, 0x44, 0x75, 0x04, 0x07, 0xB8, + 0x04, 0x10, 0xDA, 0x04, 0x00, 0x4A, 0x82, 0x04, 0x11, 0x8D, 0x04, 0x16, 0x96, 0x04, 0x18, 0x9F, + 0x04, 0x00, 0x15, 0x12, 0x10, 0x00, 0x83, 0x74, 0x67, 0x61, 0x67, 0x65, 0x00, 0x0B, 0x06, 0x00, + 0x83, 0x61, 0x6E, 0x67, 0x65, 0x00, 0x08, 0x10, 0x00, 0x82, 0x73, 0x61, 0x67, 0x65, 0x00, 0x0A, + 0x00, 0x6C, 0xA8, 0x04, 0x04, 0xAE, 0x04, 0x00, 0x83, 0x61, 0x75, 0x67, 0x65, 0x00, 0x0F, 0x00, + 0x84, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x00, 0x44, 0xC5, 0x04, 0x0C, 0xCB, + 0x04, 0x0F, 0xD4, 0x04, 0x00, 0x83, 0x6C, 0x65, 0x67, 0x65, 0x00, 0x19, 0x0C, 0x15, 0x13, 0x00, + 0x82, 0x67, 0x65, 0x00, 0x04, 0x00, 0x82, 0x67, 0x65, 0x00, 0x04, 0x0C, 0x00, 0x83, 0x6D, 0x61, + 0x67, 0x65, 0x00, 0x17, 0x00, 0x47, 0xF5, 0x04, 0x10, 0xFF, 0x04, 0x12, 0x09, 0x05, 0x16, 0x12, + 0x05, 0x17, 0x1B, 0x05, 0x00, 0x11, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x12, + 0x15, 0x09, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x17, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, + 0x65, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x44, 0x22, 0x05, 0x18, 0x2A, + 0x05, 0x00, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x12, 0x05, 0x04, 0x00, 0x82, 0x20, + 0x74, 0x68, 0x65, 0x00, 0x1D, 0x16, 0x2C, 0x00, 0x82, 0x69, 0x7A, 0x65, 0x00, 0x45, 0x4D, 0x05, + 0x0C, 0xBE, 0x05, 0x13, 0xC9, 0x05, 0x16, 0xF1, 0x05, 0x19, 0xF9, 0x05, 0x00, 0x44, 0x57, 0x05, + 0x0C, 0xA7, 0x05, 0x0F, 0xB3, 0x05, 0x00, 0x4A, 0x61, 0x05, 0x0C, 0x6B, 0x05, 0x0F, 0x89, 0x05, + 0x00, 0x0C, 0x0F, 0x08, 0x00, 0x83, 0x69, 0x62, 0x6C, 0x65, 0x00, 0x0F, 0x00, 0x44, 0x74, 0x05, + 0x0C, 0x7F, 0x05, 0x00, 0x19, 0x04, 0x00, 0x85, 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x04, + 0x19, 0x04, 0x00, 0x84, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x44, 0x90, 0x05, 0x0C, 0x9B, 0x05, 0x00, + 0x19, 0x04, 0x00, 0x84, 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x19, 0x04, 0x00, 0x85, 0x61, + 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x04, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x83, 0x62, + 0x6C, 0x65, 0x00, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x82, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x1A, 0x0B, + 0x2C, 0x00, 0x84, 0x77, 0x68, 0x69, 0x6C, 0x65, 0x00, 0x44, 0xD3, 0x05, 0x08, 0xDC, 0x05, 0x12, + 0xE6, 0x05, 0x00, 0x08, 0x13, 0x00, 0x83, 0x6F, 0x70, 0x6C, 0x65, 0x00, 0x12, 0x13, 0x00, 0x84, + 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x00, 0x08, 0x12, 0x13, 0x00, 0x85, 0x65, 0x6F, 0x70, 0x6C, 0x65, + 0x00, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x08, 0x0F, 0x00, 0x81, 0x65, 0x6C, 0x00, + 0x46, 0x07, 0x06, 0x0C, 0x10, 0x06, 0x00, 0x0C, 0x16, 0x2C, 0x00, 0x82, 0x6E, 0x63, 0x65, 0x00, + 0x08, 0x0A, 0x1C, 0x0B, 0x00, 0x83, 0x69, 0x65, 0x6E, 0x65, 0x00, 0x16, 0x0B, 0x17, 0x2C, 0x00, + 0x82, 0x6F, 0x73, 0x65, 0x00, 0x0F, 0x12, 0x08, 0x13, 0x00, 0x82, 0x70, 0x6C, 0x65, 0x00, 0x46, + 0x42, 0x06, 0x08, 0x4C, 0x06, 0x0C, 0x57, 0x06, 0x12, 0x63, 0x06, 0x15, 0x7F, 0x06, 0x18, 0x86, + 0x06, 0x00, 0x12, 0x16, 0x2C, 0x00, 0x83, 0x63, 0x6F, 0x72, 0x65, 0x00, 0x17, 0x0B, 0x2C, 0x00, + 0x84, 0x74, 0x68, 0x65, 0x72, 0x65, 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x00, 0x47, 0x6A, 0x06, 0x09, 0x73, 0x06, 0x00, 0x08, 0x05, 0x00, 0x83, 0x66, 0x6F, + 0x72, 0x65, 0x00, 0x15, 0x08, 0x0B, 0x17, 0x00, 0x83, 0x65, 0x66, 0x6F, 0x72, 0x65, 0x00, 0x08, + 0x0B, 0x1A, 0x00, 0x81, 0x65, 0x00, 0x17, 0x00, 0x6C, 0x8F, 0x06, 0x04, 0x94, 0x06, 0x00, 0x82, + 0x72, 0x75, 0x65, 0x00, 0x10, 0x04, 0x00, 0x82, 0x65, 0x75, 0x72, 0x00, 0x44, 0xB2, 0x06, 0x08, + 0xCB, 0x06, 0x0C, 0xD3, 0x06, 0x0F, 0xE2, 0x06, 0x11, 0xEB, 0x06, 0x12, 0x09, 0x07, 0x18, 0x16, + 0x07, 0x00, 0x4F, 0xB9, 0x06, 0x18, 0xC1, 0x06, 0x00, 0x09, 0x00, 0x83, 0x61, 0x6C, 0x73, 0x65, + 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, 0x08, 0x0B, 0x17, 0x00, 0x82, + 0x73, 0x65, 0x00, 0x06, 0x15, 0x08, 0x06, 0x1B, 0x08, 0x00, 0x86, 0x65, 0x72, 0x63, 0x69, 0x73, + 0x65, 0x00, 0x0C, 0x04, 0x09, 0x00, 0x83, 0x6C, 0x73, 0x65, 0x00, 0x48, 0xF2, 0x06, 0x12, 0xFD, + 0x06, 0x00, 0x16, 0x0C, 0x0F, 0x00, 0x84, 0x63, 0x65, 0x6E, 0x73, 0x65, 0x00, 0x13, 0x08, 0x15, + 0x00, 0x84, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x00, 0x13, 0x11, 0x04, 0x15, 0x17, 0x00, 0x83, + 0x73, 0x70, 0x6F, 0x73, 0x65, 0x00, 0x44, 0x20, 0x07, 0x06, 0x3D, 0x07, 0x12, 0x48, 0x07, 0x00, + 0x46, 0x27, 0x07, 0x08, 0x31, 0x07, 0x00, 0x06, 0x08, 0x05, 0x00, 0x84, 0x61, 0x75, 0x73, 0x65, + 0x00, 0x06, 0x04, 0x05, 0x00, 0x86, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x00, 0x04, 0x08, 0x05, + 0x00, 0x84, 0x63, 0x61, 0x75, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, + 0x65, 0x00, 0x44, 0x5F, 0x07, 0x08, 0x0D, 0x08, 0x0F, 0x18, 0x08, 0x19, 0x24, 0x08, 0x00, 0x47, + 0x6F, 0x07, 0x0A, 0x94, 0x07, 0x0F, 0xA1, 0x07, 0x13, 0xE4, 0x07, 0x15, 0xEE, 0x07, 0x00, 0x12, + 0x10, 0x00, 0x50, 0x79, 0x07, 0x12, 0x88, 0x07, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, + 0x6D, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, + 0x61, 0x74, 0x65, 0x00, 0x12, 0x13, 0x12, 0x15, 0x13, 0x00, 0x84, 0x61, 0x67, 0x61, 0x74, 0x65, + 0x00, 0x46, 0xAB, 0x07, 0x13, 0xB8, 0x07, 0x18, 0xC5, 0x07, 0x00, 0x18, 0x0F, 0x04, 0x06, 0x00, + 0x85, 0x63, 0x75, 0x6C, 0x61, 0x74, 0x65, 0x00, 0x10, 0x04, 0x08, 0x17, 0x00, 0x86, 0x6D, 0x70, + 0x6C, 0x61, 0x74, 0x65, 0x00, 0x46, 0xCC, 0x07, 0x0F, 0xD9, 0x07, 0x00, 0x18, 0x0F, 0x04, 0x06, + 0x00, 0x86, 0x63, 0x75, 0x6C, 0x61, 0x74, 0x65, 0x00, 0x04, 0x06, 0x00, 0x84, 0x63, 0x75, 0x6C, + 0x61, 0x74, 0x65, 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x48, 0xF5, + 0x07, 0x18, 0x02, 0x08, 0x00, 0x11, 0x04, 0x0A, 0x00, 0x86, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x00, 0x06, 0x04, 0x00, 0x84, 0x63, 0x75, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0F, 0x0F, 0x04, + 0x13, 0x00, 0x83, 0x65, 0x74, 0x74, 0x65, 0x00, 0x04, 0x13, 0x10, 0x08, 0x17, 0x00, 0x83, 0x6C, + 0x61, 0x74, 0x65, 0x00, 0x0C, 0x15, 0x13, 0x00, 0x81, 0x61, 0x74, 0x65, 0x00, 0x4A, 0x37, 0x08, + 0x0C, 0x43, 0x08, 0x16, 0x4D, 0x08, 0x00, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, 0x67, + 0x75, 0x65, 0x00, 0x14, 0x11, 0x18, 0x00, 0x83, 0x69, 0x71, 0x75, 0x65, 0x00, 0x44, 0x54, 0x08, + 0x15, 0x69, 0x08, 0x00, 0x06, 0x00, 0x6C, 0x5D, 0x08, 0x08, 0x62, 0x08, 0x00, 0x82, 0x75, 0x73, + 0x65, 0x00, 0x05, 0x00, 0x82, 0x75, 0x73, 0x65, 0x00, 0x08, 0x13, 0x00, 0x84, 0x75, 0x72, 0x73, + 0x75, 0x65, 0x00, 0x4C, 0x7A, 0x08, 0x12, 0x93, 0x08, 0x00, 0x48, 0x81, 0x08, 0x0F, 0x8B, 0x08, + 0x00, 0x0F, 0x08, 0x05, 0x00, 0x83, 0x69, 0x65, 0x76, 0x65, 0x00, 0x08, 0x05, 0x00, 0x81, 0x65, + 0x76, 0x65, 0x00, 0x52, 0x9A, 0x08, 0x19, 0xA1, 0x08, 0x00, 0x15, 0x13, 0x00, 0x82, 0x76, 0x65, + 0x00, 0x05, 0x04, 0x00, 0x83, 0x6F, 0x76, 0x65, 0x00, 0x0C, 0x08, 0x00, 0x4B, 0xB6, 0x08, 0x0F, + 0xBD, 0x08, 0x15, 0xC5, 0x08, 0x00, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x08, 0x05, 0x00, + 0x82, 0x69, 0x65, 0x66, 0x00, 0x05, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x4C, 0xD3, 0x08, 0x11, + 0xDD, 0x08, 0x00, 0x11, 0x12, 0x0A, 0x2C, 0x00, 0x82, 0x69, 0x6E, 0x67, 0x00, 0x4C, 0xE4, 0x08, + 0x15, 0x3A, 0x09, 0x00, 0x48, 0xF4, 0x08, 0x0B, 0x0B, 0x09, 0x0F, 0x18, 0x09, 0x15, 0x24, 0x09, + 0x1C, 0x2F, 0x09, 0x00, 0x48, 0xFB, 0x08, 0x0B, 0x02, 0x09, 0x00, 0x05, 0x00, 0x83, 0x69, 0x6E, + 0x67, 0x00, 0x06, 0x04, 0x06, 0x00, 0x83, 0x69, 0x6E, 0x67, 0x00, 0x17, 0x06, 0x04, 0x10, 0x00, + 0x85, 0x74, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, + 0x69, 0x6E, 0x67, 0x00, 0x18, 0x06, 0x08, 0x15, 0x00, 0x82, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x17, + 0x1C, 0x11, 0x04, 0x00, 0x83, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, + 0x69, 0x6E, 0x67, 0x00, 0x46, 0x57, 0x09, 0x08, 0x8E, 0x09, 0x0A, 0x9A, 0x09, 0x0C, 0xA4, 0x09, + 0x16, 0xAD, 0x09, 0x17, 0xBF, 0x09, 0x00, 0x4B, 0x64, 0x09, 0x0C, 0x6D, 0x09, 0x0F, 0x77, 0x09, + 0x15, 0x7F, 0x09, 0x00, 0x0C, 0x1A, 0x00, 0x83, 0x68, 0x69, 0x63, 0x68, 0x00, 0x17, 0x1A, 0x16, + 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0B, 0x1A, 0x00, 0x82, 0x69, 0x63, 0x68, 0x00, 0x04, + 0x08, 0x16, 0x04, 0x08, 0x15, 0x00, 0x86, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x00, 0x17, 0x07, + 0x11, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x11, 0x08, 0x15, 0x17, 0x16, 0x00, + 0x80, 0x74, 0x68, 0x00, 0x06, 0x0B, 0x1A, 0x00, 0x82, 0x69, 0x63, 0x68, 0x00, 0x0C, 0x0F, 0x13, + 0x10, 0x12, 0x06, 0x04, 0x00, 0x86, 0x63, 0x6F, 0x6D, 0x70, 0x6C, 0x69, 0x73, 0x68, 0x00, 0x4A, + 0xC9, 0x09, 0x0C, 0xE1, 0x09, 0x15, 0xEC, 0x09, 0x00, 0x48, 0xD0, 0x09, 0x0C, 0xDA, 0x09, 0x00, + 0x15, 0x17, 0x16, 0x00, 0x82, 0x6E, 0x67, 0x74, 0x68, 0x00, 0x08, 0x0B, 0x00, 0x81, 0x68, 0x74, + 0x00, 0x1A, 0x07, 0x11, 0x04, 0x05, 0x00, 0x81, 0x64, 0x74, 0x68, 0x00, 0x18, 0x17, 0x2C, 0x00, + 0x83, 0x72, 0x75, 0x74, 0x68, 0x00, 0x15, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x81, 0x69, 0x72, 0x00, + 0x11, 0x00, 0x4C, 0x09, 0x0A, 0x18, 0x14, 0x0A, 0x00, 0x17, 0x0B, 0x2C, 0x00, 0x84, 0x74, 0x68, + 0x69, 0x6E, 0x6B, 0x00, 0x0C, 0x0B, 0x17, 0x00, 0x82, 0x6E, 0x6B, 0x00, 0x44, 0x32, 0x0A, 0x07, + 0x86, 0x0A, 0x08, 0xB1, 0x0A, 0x09, 0x11, 0x0B, 0x0F, 0x1A, 0x0B, 0x17, 0x37, 0x0B, 0x18, 0x40, + 0x0B, 0x00, 0x4C, 0x3C, 0x0A, 0x17, 0x47, 0x0A, 0x18, 0x60, 0x0A, 0x00, 0x06, 0x13, 0x1C, 0x17, + 0x00, 0x83, 0x69, 0x63, 0x61, 0x6C, 0x00, 0x4C, 0x4E, 0x0A, 0x18, 0x56, 0x0A, 0x00, 0x11, 0x0C, + 0x00, 0x81, 0x69, 0x61, 0x6C, 0x00, 0x15, 0x0C, 0x19, 0x00, 0x83, 0x74, 0x75, 0x61, 0x6C, 0x00, + 0x51, 0x6A, 0x0A, 0x15, 0x73, 0x0A, 0x17, 0x7C, 0x0A, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x6E, 0x75, + 0x61, 0x6C, 0x00, 0x18, 0x17, 0x04, 0x11, 0x00, 0x82, 0x61, 0x6C, 0x00, 0x0C, 0x19, 0x00, 0x83, + 0x72, 0x74, 0x75, 0x61, 0x6C, 0x00, 0x18, 0x00, 0x52, 0x8F, 0x0A, 0x1A, 0xA7, 0x0A, 0x00, 0x46, + 0x99, 0x0A, 0x0B, 0x9D, 0x0A, 0x1A, 0xA3, 0x0A, 0x00, 0x81, 0x6C, 0x64, 0x00, 0x16, 0x00, 0x81, + 0x6C, 0x64, 0x00, 0x81, 0x6C, 0x64, 0x00, 0x12, 0x2C, 0x00, 0x84, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x00, 0x4A, 0xC1, 0x0A, 0x0F, 0xC9, 0x0A, 0x13, 0xF7, 0x0A, 0x17, 0xFF, 0x0A, 0x18, 0x07, 0x0B, + 0x00, 0x11, 0x0C, 0x16, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x44, 0xD0, 0x0A, 0x0F, 0xEA, 0x0A, 0x00, + 0x15, 0x00, 0x44, 0xD9, 0x0A, 0x15, 0xE0, 0x0A, 0x00, 0x13, 0x00, 0x81, 0x6C, 0x65, 0x6C, 0x00, + 0x04, 0x13, 0x00, 0x84, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x00, 0x04, 0x15, 0x15, 0x04, 0x13, 0x00, + 0x85, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x00, 0x12, 0x08, 0x13, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x17, + 0x0C, 0x0F, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x07, 0x08, 0x0B, 0x06, 0x16, 0x00, 0x81, 0x6C, 0x65, + 0x00, 0x08, 0x16, 0x1C, 0x10, 0x00, 0x81, 0x6C, 0x66, 0x00, 0x0C, 0x09, 0x00, 0x4F, 0x24, 0x0B, + 0x18, 0x2E, 0x0B, 0x00, 0x0F, 0x18, 0x09, 0x00, 0x84, 0x66, 0x69, 0x6C, 0x6C, 0x00, 0x09, 0x00, + 0x83, 0x6C, 0x66, 0x69, 0x6C, 0x6C, 0x00, 0x18, 0x16, 0x08, 0x15, 0x00, 0x81, 0x6C, 0x74, 0x00, + 0x09, 0x17, 0x04, 0x08, 0x15, 0x0A, 0x00, 0x85, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6C, 0x00, 0x44, + 0x59, 0x0B, 0x0F, 0x6A, 0x0B, 0x15, 0x75, 0x0B, 0x00, 0x15, 0x0A, 0x12, 0x17, 0x06, 0x08, 0x13, + 0x16, 0x00, 0x84, 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x00, 0x08, 0x05, 0x12, 0x15, 0x13, 0x00, + 0x82, 0x6C, 0x65, 0x6D, 0x00, 0x12, 0x09, 0x12, 0x06, 0x00, 0x83, 0x6E, 0x66, 0x6F, 0x72, 0x6D, + 0x00, 0x44, 0xA6, 0x0B, 0x07, 0xCE, 0x0B, 0x08, 0xD7, 0x0B, 0x0A, 0x3A, 0x0C, 0x0C, 0x8D, 0x0C, + 0x0E, 0x99, 0x0C, 0x12, 0xC0, 0x0C, 0x13, 0x6C, 0x0D, 0x15, 0x78, 0x0D, 0x16, 0x83, 0x0D, 0x18, + 0x8D, 0x0D, 0x1A, 0xA4, 0x0D, 0x00, 0x0C, 0x00, 0x4A, 0xAF, 0x0B, 0x17, 0xB7, 0x0B, 0x00, 0x04, + 0x2C, 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x51, 0xBE, 0x0B, 0x15, 0xC6, 0x0B, 0x00, 0x12, 0x06, + 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x08, 0x06, 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x18, 0x12, + 0x09, 0x2C, 0x00, 0x81, 0x6E, 0x64, 0x00, 0x47, 0xE7, 0x0B, 0x08, 0xF1, 0x0B, 0x0A, 0x1B, 0x0C, + 0x13, 0x27, 0x0C, 0x16, 0x30, 0x0C, 0x00, 0x0F, 0x0C, 0x0B, 0x06, 0x00, 0x81, 0x72, 0x65, 0x6E, + 0x00, 0x57, 0xF8, 0x0B, 0x1A, 0x11, 0x0C, 0x00, 0x48, 0xFF, 0x0B, 0x1A, 0x07, 0x0C, 0x00, 0x05, + 0x00, 0x82, 0x77, 0x65, 0x65, 0x6E, 0x00, 0x08, 0x05, 0x00, 0x84, 0x74, 0x77, 0x65, 0x65, 0x6E, + 0x00, 0x08, 0x05, 0x00, 0x83, 0x74, 0x77, 0x65, 0x65, 0x6E, 0x00, 0x12, 0x07, 0x1C, 0x0B, 0x00, + 0x83, 0x72, 0x6F, 0x67, 0x65, 0x6E, 0x00, 0x04, 0x0B, 0x2C, 0x00, 0x81, 0x70, 0x65, 0x6E, 0x00, + 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, 0x48, 0x41, 0x0C, 0x0C, 0x4C, 0x0C, + 0x00, 0x0C, 0x15, 0x12, 0x09, 0x00, 0x83, 0x65, 0x69, 0x67, 0x6E, 0x00, 0x4B, 0x5F, 0x0C, 0x0F, + 0x65, 0x0C, 0x11, 0x6D, 0x0C, 0x12, 0x76, 0x0C, 0x15, 0x7D, 0x0C, 0x16, 0x84, 0x0C, 0x00, 0x17, + 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0F, 0x04, 0x00, 0x83, 0x69, 0x67, 0x6E, 0x00, 0x15, 0x04, 0x08, + 0x0F, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0A, 0x2C, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x17, 0x16, 0x00, + 0x81, 0x6E, 0x67, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x73, 0x69, 0x67, 0x6E, 0x00, 0x17, 0x04, 0x15, + 0x08, 0x06, 0x00, 0x83, 0x74, 0x61, 0x69, 0x6E, 0x00, 0x4B, 0xA0, 0x0C, 0x0C, 0xA9, 0x0C, 0x00, + 0x0C, 0x17, 0x00, 0x83, 0x68, 0x69, 0x6E, 0x6B, 0x00, 0x4B, 0xB0, 0x0C, 0x17, 0xB6, 0x0C, 0x00, + 0x17, 0x00, 0x81, 0x6E, 0x6B, 0x00, 0x0B, 0x2C, 0x00, 0x84, 0x74, 0x68, 0x69, 0x6E, 0x6B, 0x00, + 0x4C, 0xCA, 0x0C, 0x16, 0x56, 0x0D, 0x17, 0x60, 0x0D, 0x00, 0x46, 0xD4, 0x0C, 0x16, 0xE1, 0x0C, + 0x17, 0xFB, 0x0C, 0x00, 0x0C, 0x16, 0x08, 0x07, 0x00, 0x85, 0x63, 0x69, 0x73, 0x69, 0x6F, 0x6E, + 0x00, 0x44, 0xE8, 0x0C, 0x16, 0xF1, 0x0C, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, 0x6E, + 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x44, 0x0E, 0x0D, 0x07, 0x1B, + 0x0D, 0x0C, 0x25, 0x0D, 0x0F, 0x34, 0x0D, 0x11, 0x40, 0x0D, 0x16, 0x4C, 0x0D, 0x00, 0x15, 0x08, + 0x05, 0x04, 0x00, 0x84, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x07, 0x04, 0x00, 0x83, 0x69, + 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, + 0x69, 0x6F, 0x6E, 0x00, 0x04, 0x08, 0x15, 0x00, 0x85, 0x6C, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, + 0x06, 0x18, 0x09, 0x00, 0x85, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, + 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x0C, 0x19, 0x0C, 0x07, 0x00, 0x81, 0x69, 0x6F, 0x6E, 0x00, + 0x0C, 0x06, 0x04, 0x15, 0x09, 0x00, 0x83, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x13, 0x0B, 0x04, 0x00, + 0x84, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, 0x00, 0x83, 0x74, 0x75, + 0x72, 0x6E, 0x00, 0x0A, 0x0C, 0x0B, 0x17, 0x00, 0x82, 0x6E, 0x67, 0x73, 0x00, 0x55, 0x94, 0x0D, + 0x17, 0x9D, 0x0D, 0x00, 0x17, 0x08, 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, + 0x80, 0x72, 0x6E, 0x00, 0x12, 0x0E, 0x11, 0x18, 0x00, 0x82, 0x6E, 0x6F, 0x77, 0x6E, 0x00, 0x47, + 0xB9, 0x0D, 0x11, 0xC4, 0x0D, 0x1A, 0xCD, 0x0D, 0x00, 0x08, 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, + 0x75, 0x64, 0x6F, 0x00, 0x1A, 0x0E, 0x2C, 0x00, 0x82, 0x6E, 0x6F, 0x77, 0x00, 0x4F, 0xD4, 0x0D, + 0x11, 0xDC, 0x0D, 0x00, 0x0F, 0x12, 0x09, 0x00, 0x81, 0x6F, 0x77, 0x00, 0x0E, 0x2C, 0x00, 0x81, + 0x6F, 0x77, 0x00, 0x56, 0xEA, 0x0D, 0x18, 0xF4, 0x0D, 0x00, 0x04, 0x0B, 0x15, 0x08, 0x13, 0x00, + 0x81, 0x70, 0x73, 0x00, 0x12, 0x12, 0x0F, 0x00, 0x81, 0x6B, 0x75, 0x70, 0x00, 0x44, 0x1C, 0x0E, + 0x08, 0x5D, 0x0E, 0x0B, 0x67, 0x0F, 0x0F, 0x71, 0x0F, 0x12, 0x7F, 0x0F, 0x13, 0x90, 0x0F, 0x16, + 0x9B, 0x0F, 0x17, 0xA4, 0x0F, 0x18, 0xB0, 0x0F, 0x1C, 0xB9, 0x0F, 0x00, 0x4C, 0x26, 0x0E, 0x0F, + 0x30, 0x0E, 0x18, 0x52, 0x0E, 0x00, 0x0F, 0x0C, 0x10, 0x0C, 0x16, 0x00, 0x82, 0x61, 0x72, 0x00, + 0x4C, 0x37, 0x0E, 0x18, 0x42, 0x0E, 0x00, 0x10, 0x10, 0x0C, 0x16, 0x00, 0x84, 0x69, 0x6C, 0x61, + 0x72, 0x00, 0x06, 0x0C, 0x17, 0x04, 0x13, 0x00, 0x86, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6C, 0x61, + 0x72, 0x00, 0x0F, 0x0A, 0x08, 0x15, 0x00, 0x83, 0x75, 0x6C, 0x61, 0x72, 0x00, 0x44, 0x7C, 0x0E, + 0x07, 0x84, 0x0E, 0x0B, 0x91, 0x0E, 0x0C, 0xCB, 0x0E, 0x0F, 0xE5, 0x0E, 0x10, 0xEF, 0x0E, 0x11, + 0xF9, 0x0E, 0x12, 0x25, 0x0F, 0x17, 0x2D, 0x0F, 0x19, 0x4C, 0x0F, 0x00, 0x0F, 0x06, 0x00, 0x82, + 0x65, 0x61, 0x72, 0x00, 0x11, 0x04, 0x0F, 0x04, 0x06, 0x00, 0x84, 0x65, 0x6E, 0x64, 0x61, 0x72, + 0x00, 0x4A, 0x98, 0x0E, 0x17, 0xA3, 0x0E, 0x00, 0x0C, 0x08, 0x0B, 0x00, 0x85, 0x69, 0x67, 0x68, + 0x65, 0x72, 0x00, 0x48, 0xAD, 0x0E, 0x0F, 0xB9, 0x0E, 0x18, 0xC2, 0x0E, 0x00, 0x0B, 0x0A, 0x12, + 0x17, 0x00, 0x85, 0x65, 0x74, 0x68, 0x65, 0x72, 0x00, 0x12, 0x2C, 0x00, 0x84, 0x74, 0x68, 0x65, + 0x72, 0x00, 0x09, 0x00, 0x83, 0x72, 0x74, 0x68, 0x65, 0x72, 0x00, 0x4B, 0xD2, 0x0E, 0x0F, 0xDA, + 0x0E, 0x00, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x13, 0x10, 0x12, 0x06, 0x00, 0x83, + 0x69, 0x6C, 0x65, 0x72, 0x00, 0x17, 0x0C, 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x10, + 0x04, 0x15, 0x0A, 0x2C, 0x00, 0x81, 0x61, 0x72, 0x00, 0x4C, 0x00, 0x0F, 0x17, 0x0C, 0x0F, 0x00, + 0x0A, 0x0A, 0x08, 0x05, 0x00, 0x84, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x00, 0x4C, 0x13, 0x0F, 0x16, + 0x1C, 0x0F, 0x00, 0x12, 0x13, 0x00, 0x83, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x0C, 0x0F, 0x00, 0x82, + 0x65, 0x6E, 0x65, 0x72, 0x00, 0x09, 0x08, 0x05, 0x00, 0x81, 0x72, 0x65, 0x00, 0x4B, 0x34, 0x0F, + 0x18, 0x3E, 0x0F, 0x00, 0x12, 0x11, 0x04, 0x00, 0x83, 0x74, 0x68, 0x65, 0x72, 0x00, 0x13, 0x12, + 0x10, 0x06, 0x00, 0x86, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x72, 0x00, 0x48, 0x53, 0x0F, 0x1A, + 0x5E, 0x0F, 0x00, 0x08, 0x15, 0x08, 0x0B, 0x1A, 0x00, 0x83, 0x76, 0x65, 0x72, 0x00, 0x12, 0x0B, + 0x00, 0x82, 0x65, 0x76, 0x65, 0x72, 0x00, 0x08, 0x17, 0x12, 0x2C, 0x00, 0x82, 0x68, 0x65, 0x72, + 0x00, 0x04, 0x18, 0x06, 0x0C, 0x17, 0x15, 0x04, 0x13, 0x00, 0x82, 0x6C, 0x61, 0x72, 0x00, 0x17, + 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, 0x74, 0x6F, 0x72, 0x00, + 0x17, 0x0F, 0x0F, 0x18, 0x11, 0x00, 0x82, 0x70, 0x74, 0x72, 0x00, 0x04, 0x08, 0x1C, 0x2C, 0x00, + 0x81, 0x72, 0x73, 0x00, 0x12, 0x04, 0x15, 0x08, 0x13, 0x12, 0x00, 0x82, 0x74, 0x6F, 0x72, 0x00, + 0x06, 0x12, 0x2C, 0x00, 0x81, 0x63, 0x75, 0x72, 0x00, 0x08, 0x19, 0x08, 0x2C, 0x00, 0x81, 0x72, + 0x79, 0x00, 0x44, 0xDB, 0x0F, 0x08, 0x03, 0x10, 0x0A, 0x93, 0x10, 0x13, 0x9E, 0x10, 0x15, 0xAA, + 0x10, 0x16, 0xB5, 0x10, 0x17, 0x4D, 0x11, 0x18, 0x55, 0x11, 0x00, 0x4B, 0xE5, 0x0F, 0x13, 0xF0, + 0x0F, 0x1C, 0xFA, 0x0F, 0x00, 0x13, 0x15, 0x08, 0x13, 0x00, 0x83, 0x68, 0x61, 0x70, 0x73, 0x00, + 0x0B, 0x15, 0x08, 0x13, 0x00, 0x82, 0x61, 0x70, 0x73, 0x00, 0x1A, 0x0F, 0x04, 0x00, 0x82, 0x61, + 0x79, 0x73, 0x00, 0x44, 0x13, 0x10, 0x06, 0x2A, 0x10, 0x0C, 0x35, 0x10, 0x0F, 0x81, 0x10, 0x16, + 0x88, 0x10, 0x00, 0x47, 0x1A, 0x10, 0x0E, 0x22, 0x10, 0x00, 0x0C, 0x2C, 0x00, 0x82, 0x65, 0x61, + 0x73, 0x00, 0x17, 0x00, 0x83, 0x61, 0x6B, 0x65, 0x73, 0x00, 0x08, 0x07, 0x11, 0x0C, 0x00, 0x83, + 0x69, 0x63, 0x65, 0x73, 0x00, 0x46, 0x3F, 0x10, 0x15, 0x66, 0x10, 0x17, 0x75, 0x10, 0x00, 0x48, + 0x46, 0x10, 0x0C, 0x50, 0x10, 0x00, 0x07, 0x11, 0x0C, 0x00, 0x84, 0x69, 0x63, 0x65, 0x73, 0x00, + 0x47, 0x57, 0x10, 0x17, 0x5E, 0x10, 0x00, 0x11, 0x0C, 0x00, 0x82, 0x65, 0x73, 0x00, 0x15, 0x08, + 0x19, 0x00, 0x82, 0x65, 0x73, 0x00, 0x12, 0x16, 0x08, 0x06, 0x06, 0x04, 0x00, 0x84, 0x73, 0x6F, + 0x72, 0x69, 0x65, 0x73, 0x00, 0x0F, 0x0C, 0x05, 0x04, 0x00, 0x83, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x00, 0x04, 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x12, 0x0B, 0x06, 0x2C, 0x00, 0x82, 0x6F, 0x73, + 0x65, 0x73, 0x00, 0x0C, 0x11, 0x0B, 0x17, 0x00, 0x83, 0x69, 0x6E, 0x67, 0x73, 0x00, 0x04, 0x08, + 0x0B, 0x15, 0x08, 0x13, 0x00, 0x83, 0x61, 0x70, 0x73, 0x00, 0x08, 0x04, 0x1C, 0x2C, 0x00, 0x83, + 0x65, 0x61, 0x72, 0x73, 0x00, 0x44, 0xBF, 0x10, 0x08, 0xCB, 0x10, 0x12, 0x42, 0x11, 0x00, 0x15, + 0x04, 0x05, 0x10, 0x08, 0x00, 0x82, 0x72, 0x61, 0x73, 0x73, 0x00, 0x46, 0xD8, 0x10, 0x11, 0xF0, + 0x10, 0x15, 0x0D, 0x11, 0x16, 0x2A, 0x11, 0x00, 0x46, 0xDF, 0x10, 0x18, 0xE8, 0x10, 0x00, 0x12, + 0x15, 0x13, 0x00, 0x83, 0x65, 0x73, 0x73, 0x00, 0x16, 0x00, 0x82, 0x63, 0x65, 0x73, 0x73, 0x00, + 0x4C, 0xF7, 0x10, 0x16, 0x03, 0x11, 0x00, 0x16, 0x16, 0x18, 0x05, 0x00, 0x85, 0x69, 0x6E, 0x65, + 0x73, 0x73, 0x00, 0x18, 0x05, 0x00, 0x83, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x13, 0x00, 0x55, + 0x16, 0x11, 0x18, 0x21, 0x11, 0x00, 0x18, 0x16, 0x00, 0x85, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x00, 0x16, 0x00, 0x83, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x46, 0x31, 0x11, 0x12, 0x3A, 0x11, + 0x00, 0x06, 0x18, 0x16, 0x00, 0x83, 0x65, 0x73, 0x73, 0x00, 0x13, 0x00, 0x82, 0x73, 0x65, 0x73, + 0x73, 0x00, 0x15, 0x06, 0x06, 0x04, 0x00, 0x84, 0x72, 0x6F, 0x73, 0x73, 0x00, 0x15, 0x0C, 0x09, + 0x00, 0x81, 0x73, 0x74, 0x00, 0x52, 0x5C, 0x11, 0x16, 0x6A, 0x11, 0x00, 0x0F, 0x12, 0x10, 0x12, + 0x11, 0x04, 0x00, 0x84, 0x61, 0x6C, 0x6F, 0x75, 0x73, 0x00, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, + 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, 0x75, 0x73, 0x00, 0x44, 0x9E, 0x11, 0x08, 0xBC, 0x11, 0x0A, + 0xD9, 0x11, 0x0B, 0xE3, 0x11, 0x0C, 0x19, 0x12, 0x0F, 0x24, 0x12, 0x10, 0x2F, 0x12, 0x11, 0x3B, + 0x12, 0x12, 0x97, 0x13, 0x13, 0xBD, 0x13, 0x16, 0xD9, 0x13, 0x18, 0x6B, 0x14, 0x00, 0x55, 0xA5, + 0x11, 0x1A, 0xB0, 0x11, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, 0x83, 0x61, 0x72, 0x61, 0x74, 0x00, + 0x0B, 0x08, 0x10, 0x12, 0x16, 0x00, 0x83, 0x77, 0x68, 0x61, 0x74, 0x00, 0x44, 0xC3, 0x11, 0x11, + 0xCC, 0x11, 0x00, 0x15, 0x0A, 0x2C, 0x00, 0x82, 0x65, 0x61, 0x74, 0x00, 0x10, 0x11, 0x15, 0x08, + 0x19, 0x12, 0x0A, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, + 0x68, 0x74, 0x00, 0x47, 0xED, 0x11, 0x0A, 0xF4, 0x11, 0x0C, 0x0E, 0x12, 0x00, 0x0C, 0x1A, 0x00, + 0x81, 0x74, 0x68, 0x00, 0x51, 0xFB, 0x11, 0x18, 0x02, 0x12, 0x00, 0x08, 0x0F, 0x00, 0x81, 0x74, + 0x68, 0x00, 0x12, 0x15, 0x0B, 0x17, 0x00, 0x85, 0x6F, 0x75, 0x67, 0x68, 0x74, 0x00, 0x0A, 0x11, + 0x12, 0x17, 0x00, 0x83, 0x69, 0x67, 0x68, 0x74, 0x00, 0x17, 0x18, 0x12, 0x05, 0x04, 0x00, 0x81, + 0x20, 0x69, 0x74, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, 0x00, 0x04, + 0x17, 0x15, 0x12, 0x13, 0x10, 0x0C, 0x00, 0x81, 0x6E, 0x74, 0x00, 0x44, 0x48, 0x12, 0x08, 0x80, + 0x12, 0x15, 0x84, 0x13, 0x16, 0x8F, 0x13, 0x00, 0x4C, 0x55, 0x12, 0x11, 0x60, 0x12, 0x15, 0x6B, + 0x12, 0x17, 0x75, 0x12, 0x00, 0x13, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, + 0x0C, 0x10, 0x12, 0x15, 0x13, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x13, 0x13, 0x04, 0x00, + 0x82, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x13, 0x10, 0x12, 0x06, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, + 0x4C, 0x90, 0x12, 0x10, 0xB1, 0x12, 0x15, 0x15, 0x13, 0x19, 0x6F, 0x13, 0x1D, 0x79, 0x13, 0x00, + 0x46, 0x97, 0x12, 0x13, 0xA4, 0x12, 0x00, 0x08, 0x09, 0x09, 0x08, 0x00, 0x85, 0x69, 0x63, 0x69, + 0x65, 0x6E, 0x74, 0x00, 0x08, 0x06, 0x08, 0x15, 0x00, 0x85, 0x69, 0x70, 0x69, 0x65, 0x6E, 0x74, + 0x00, 0x48, 0xBE, 0x12, 0x11, 0xCA, 0x12, 0x15, 0xEB, 0x12, 0x17, 0x0A, 0x13, 0x00, 0x19, 0x12, + 0x0A, 0x00, 0x83, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x48, 0xD1, 0x12, 0x15, 0xDD, 0x12, + 0x00, 0x19, 0x12, 0x0A, 0x00, 0x84, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x12, 0x19, 0x12, + 0x0A, 0x00, 0x86, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x48, 0xF2, 0x12, 0x12, 0xFD, + 0x12, 0x00, 0x19, 0x12, 0x0A, 0x00, 0x83, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x19, 0x12, 0x0A, + 0x00, 0x85, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x17, 0x16, 0x00, 0x83, 0x65, + 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x44, 0x22, 0x13, 0x08, 0x2D, 0x13, 0x09, 0x39, 0x13, 0x15, 0x44, + 0x13, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, + 0x00, 0x84, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, 0x00, 0x83, 0x65, 0x72, + 0x65, 0x6E, 0x74, 0x00, 0x44, 0x4B, 0x13, 0x08, 0x63, 0x13, 0x00, 0x13, 0x00, 0x44, 0x54, 0x13, + 0x13, 0x5C, 0x13, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x00, 0x83, 0x65, + 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, 0x00, 0x85, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x08, + 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, 0x74, 0x00, 0x0C, 0x11, 0x0A, 0x12, 0x06, 0x00, 0x82, + 0x61, 0x6E, 0x74, 0x00, 0x08, 0x09, 0x09, 0x0C, 0x07, 0x00, 0x81, 0x65, 0x6E, 0x74, 0x00, 0x12, + 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x51, 0xA1, 0x13, 0x15, 0xAB, 0x13, 0x16, 0xB4, 0x13, + 0x00, 0x07, 0x0C, 0x07, 0x00, 0x82, 0x20, 0x6E, 0x6F, 0x74, 0x00, 0x13, 0x08, 0x15, 0x00, 0x82, + 0x6F, 0x72, 0x74, 0x00, 0x10, 0x0F, 0x04, 0x00, 0x82, 0x6F, 0x73, 0x74, 0x00, 0x48, 0xC4, 0x13, + 0x1C, 0xCF, 0x13, 0x00, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x70, 0x74, 0x00, 0x06, + 0x11, 0x08, 0x00, 0x82, 0x72, 0x79, 0x70, 0x74, 0x00, 0x48, 0xEC, 0x13, 0x0A, 0x15, 0x14, 0x0C, + 0x1E, 0x14, 0x10, 0x3B, 0x14, 0x11, 0x45, 0x14, 0x18, 0x60, 0x14, 0x00, 0x4A, 0xF3, 0x13, 0x15, + 0x0A, 0x14, 0x00, 0x4C, 0xFA, 0x13, 0x18, 0x02, 0x14, 0x00, 0x0B, 0x00, 0x82, 0x68, 0x65, 0x73, + 0x74, 0x00, 0x16, 0x00, 0x82, 0x67, 0x65, 0x73, 0x74, 0x00, 0x17, 0x11, 0x0C, 0x00, 0x83, 0x65, + 0x72, 0x65, 0x73, 0x74, 0x00, 0x15, 0x04, 0x0F, 0x00, 0x81, 0x65, 0x73, 0x74, 0x00, 0x49, 0x25, + 0x14, 0x11, 0x31, 0x14, 0x00, 0x08, 0x11, 0x04, 0x10, 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x00, 0x04, 0x0A, 0x04, 0x00, 0x83, 0x69, 0x6E, 0x73, 0x74, 0x00, 0x12, 0x0F, 0x04, 0x00, 0x83, + 0x6D, 0x6F, 0x73, 0x74, 0x00, 0x44, 0x4C, 0x14, 0x11, 0x57, 0x14, 0x00, 0x0C, 0x0A, 0x04, 0x00, + 0x84, 0x61, 0x69, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x04, 0x0A, 0x04, 0x00, 0x82, 0x73, 0x74, 0x00, + 0x0D, 0x04, 0x2C, 0x00, 0x83, 0x64, 0x6A, 0x75, 0x73, 0x74, 0x00, 0x46, 0x78, 0x14, 0x12, 0x90, + 0x14, 0x13, 0xA8, 0x14, 0x17, 0xBF, 0x14, 0x00, 0x48, 0x7F, 0x14, 0x15, 0x89, 0x14, 0x00, 0x06, + 0x1B, 0x08, 0x00, 0x84, 0x65, 0x63, 0x75, 0x74, 0x00, 0x0C, 0x06, 0x00, 0x80, 0x69, 0x74, 0x00, + 0x44, 0x97, 0x14, 0x05, 0xA0, 0x14, 0x00, 0x05, 0x00, 0x84, 0x61, 0x62, 0x6F, 0x75, 0x74, 0x00, + 0x05, 0x04, 0x00, 0x83, 0x6F, 0x75, 0x74, 0x00, 0x57, 0xAF, 0x14, 0x18, 0xB7, 0x14, 0x00, 0x11, + 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, + 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, 0x17, 0x12, 0x05, 0x04, 0x00, 0x81, 0x75, + 0x74, 0x00, 0x48, 0xD9, 0x14, 0x0C, 0xFD, 0x14, 0x00, 0x44, 0xE0, 0x14, 0x0C, 0xE7, 0x14, 0x00, + 0x0B, 0x2C, 0x00, 0x81, 0x76, 0x65, 0x00, 0x46, 0xEE, 0x14, 0x08, 0xF6, 0x14, 0x00, 0x08, 0x15, + 0x00, 0x82, 0x65, 0x69, 0x76, 0x00, 0x06, 0x08, 0x15, 0x00, 0x81, 0x76, 0x00, 0x08, 0x0B, 0x06, + 0x04, 0x2C, 0x00, 0x82, 0x69, 0x65, 0x76, 0x00, 0x4C, 0x0F, 0x15, 0x11, 0x19, 0x15, 0x00, 0x08, + 0x19, 0x08, 0x15, 0x00, 0x82, 0x69, 0x65, 0x77, 0x00, 0x12, 0x0E, 0x2C, 0x00, 0x82, 0x6E, 0x6F, + 0x77, 0x00, 0x46, 0x3B, 0x15, 0x08, 0x76, 0x15, 0x0B, 0x80, 0x15, 0x0F, 0x92, 0x15, 0x11, 0x57, + 0x16, 0x15, 0x72, 0x16, 0x16, 0x0C, 0x17, 0x17, 0x27, 0x17, 0x00, 0x44, 0x48, 0x15, 0x08, 0x54, + 0x15, 0x0C, 0x5F, 0x15, 0x13, 0x6A, 0x15, 0x00, 0x15, 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x82, + 0x69, 0x73, 0x79, 0x00, 0x18, 0x14, 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x15, + 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x81, 0x73, 0x79, 0x00, 0x18, 0x15, 0x0E, 0x11, 0x04, 0x05, + 0x00, 0x81, 0x74, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, 0x74, 0x79, 0x00, + 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, + 0x79, 0x00, 0x44, 0xA5, 0x15, 0x0B, 0xE8, 0x15, 0x0E, 0xF2, 0x15, 0x0F, 0xFA, 0x15, 0x12, 0x42, + 0x16, 0x15, 0x4C, 0x16, 0x00, 0x45, 0xB8, 0x15, 0x08, 0xC1, 0x15, 0x0F, 0xC7, 0x15, 0x11, 0xD0, + 0x15, 0x15, 0xD7, 0x15, 0x18, 0xE0, 0x15, 0x00, 0x12, 0x15, 0x13, 0x00, 0x81, 0x62, 0x6C, 0x79, + 0x00, 0x15, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x08, 0x15, 0x00, 0x83, 0x61, 0x6C, 0x6C, 0x79, 0x00, + 0x0C, 0x09, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x08, 0x11, 0x08, 0x0A, 0x00, 0x80, 0x6C, 0x79, 0x00, + 0x17, 0x06, 0x04, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x0A, 0x0C, 0x0F, 0x16, 0x00, 0x81, 0x74, 0x6C, + 0x79, 0x00, 0x0C, 0x0F, 0x00, 0x81, 0x65, 0x6C, 0x79, 0x00, 0x44, 0x04, 0x16, 0x05, 0x2F, 0x16, + 0x08, 0x38, 0x16, 0x00, 0x56, 0x0B, 0x16, 0x17, 0x23, 0x16, 0x00, 0x18, 0x00, 0x6C, 0x14, 0x16, + 0x16, 0x1B, 0x16, 0x00, 0x83, 0x75, 0x61, 0x6C, 0x6C, 0x79, 0x00, 0x18, 0x00, 0x84, 0x61, 0x6C, + 0x6C, 0x79, 0x00, 0x18, 0x06, 0x04, 0x00, 0x85, 0x74, 0x75, 0x61, 0x6C, 0x6C, 0x79, 0x00, 0x04, + 0x05, 0x12, 0x15, 0x13, 0x00, 0x81, 0x79, 0x00, 0x04, 0x15, 0x00, 0x84, 0x65, 0x61, 0x6C, 0x6C, + 0x79, 0x00, 0x10, 0x12, 0x11, 0x04, 0x00, 0x82, 0x61, 0x6C, 0x79, 0x00, 0x04, 0x10, 0x0C, 0x15, + 0x13, 0x00, 0x81, 0x69, 0x6C, 0x79, 0x00, 0x48, 0x5E, 0x16, 0x13, 0x67, 0x16, 0x00, 0x12, 0x10, + 0x2C, 0x00, 0x82, 0x6E, 0x65, 0x79, 0x00, 0x04, 0x10, 0x12, 0x06, 0x00, 0x83, 0x70, 0x61, 0x6E, + 0x79, 0x00, 0x44, 0x7F, 0x16, 0x08, 0xE7, 0x16, 0x12, 0xF0, 0x16, 0x17, 0xFD, 0x16, 0x00, 0x45, + 0x8F, 0x16, 0x0C, 0x98, 0x16, 0x0F, 0xA5, 0x16, 0x10, 0xC1, 0x16, 0x16, 0xCA, 0x16, 0x00, 0x0C, + 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00, 0x0F, 0x0F, 0x0C, 0x1B, 0x18, 0x04, 0x00, 0x84, + 0x69, 0x61, 0x72, 0x79, 0x00, 0x4C, 0xAC, 0x16, 0x0F, 0xB6, 0x16, 0x00, 0x1B, 0x18, 0x04, 0x00, + 0x82, 0x69, 0x61, 0x72, 0x79, 0x00, 0x0C, 0x1B, 0x18, 0x04, 0x00, 0x83, 0x69, 0x61, 0x72, 0x79, + 0x00, 0x18, 0x16, 0x00, 0x82, 0x6D, 0x61, 0x72, 0x79, 0x00, 0x08, 0x06, 0x00, 0x46, 0xD4, 0x16, + 0x08, 0xDF, 0x16, 0x00, 0x08, 0x11, 0x00, 0x85, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x00, 0x11, + 0x00, 0x82, 0x73, 0x61, 0x72, 0x79, 0x00, 0x13, 0x12, 0x15, 0x13, 0x00, 0x80, 0x74, 0x79, 0x00, + 0x0A, 0x04, 0x17, 0x04, 0x06, 0x00, 0x84, 0x65, 0x67, 0x6F, 0x72, 0x79, 0x00, 0x11, 0x18, 0x06, + 0x12, 0x2C, 0x00, 0x86, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x00, 0x04, 0x00, 0x55, 0x15, + 0x17, 0x1A, 0x20, 0x17, 0x00, 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x82, 0x69, 0x73, 0x79, 0x00, + 0x0F, 0x04, 0x00, 0x81, 0x79, 0x73, 0x00, 0x49, 0x31, 0x17, 0x0F, 0x39, 0x17, 0x15, 0x42, 0x17, + 0x00, 0x04, 0x16, 0x00, 0x81, 0x65, 0x74, 0x79, 0x00, 0x0C, 0x05, 0x04, 0x00, 0x81, 0x69, 0x74, + 0x79, 0x00, 0x13, 0x08, 0x12, 0x15, 0x13, 0x00, 0x84, 0x70, 0x65, 0x72, 0x74, 0x79, 0x00 +}; + diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt new file mode 100644 index 000000000000..b5f293d96cb1 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt @@ -0,0 +1,473 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# This is a larger example typo dictionary containing 400 entries. It builds to +# a table of about 6000 bytes, so you'll need a keyboard with a generous +# amount of free firmware space to use the full dictionary. Alternatively, pick +# out a subset of entries to a separate file, then build a table from that. +# +# Dictionary syntax: +# Each line of this file defines one typo correction entry with the syntax +# "typo -> correction". Typos and corrections are case insensitive, and any +# whitespace before or after the typo and correction is ignored. The typo must be +# only the letters a-z, or the special character : representing a word break. +# +# For documentation about how to use this dictionary, see +# https://getreuer.info/posts/keyboards/autocorrection +# +# Further resources: +# * Wikipedia has a large list of common typos at +# https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines +# +# * EmacsWiki has another list of typos at +# https://www.emacswiki.org/emacs/autocorrection_abbrev_defs +# +# * You can find data on English word frequencies at +# https://www.wordfrequency.info/samples.asp + + +## 10 most common words. +# The words "there", "about", "their", "would", "people", "which", "could", +# "think", "other", and "because" are among the most common words in English +# that are 5 letters or longer. (We don't include entries for words shorter than +# that to avoid false triggering.) +:htere -> there +abbout -> about +abotu -> about +baout -> about +:theri -> their +:thier -> their +:owudl -> would +woudl -> would +peaple -> people +peolpe -> people +peopel -> people +poeple -> people +poeople -> people +:hwihc -> which +whcih -> which +whihc -> which +whlch -> which +wihch -> which +coudl -> could +:htikn -> think +:htink -> think +thikn -> think +thiunk -> think +tihkn -> think +:olther -> other +:otehr -> other +baceause -> because +beacuse -> because +becasue -> because +beccause -> because +becouse -> because +becuase -> because + +## Common words, 11-20. +theese -> these +:goign -> going +:gonig -> going +:yaers -> years +:yeasr -> years +:thsoe -> those +shoudl -> should +raelly -> really +realy -> really +relaly -> really +bedore -> before +befoer -> before +littel -> little +beeing -> being +:hwile -> while + +## Common words, 21-30. +aroud -> around +arround -> around +arund -> around +thign -> thing +thigsn -> things +thnigs -> things +anohter -> another +beteen -> between +beween -> between +bewteen -> between +:eveyr -> every +:graet -> great +:agian -> again +:sicne -> since +alwasy -> always +alwyas -> always +throught -> thought + + +## Words especially susceptible to skipping or transposing a letter. +# These entries are for words that are easy enough to spell, but not necessarily +# easy to press the keys in the right order. +# Catch misspellings of "achieves", "achieving", etc. +:acheiv -> achiev +almsot -> almost +alomst -> almost +chnage -> change +chekc -> check +childen -> children +claer -> clear +comapny -> company +contian -> contain +elasped -> elapsed +feild -> field +fitler -> filter +firts -> first +follwo -> follow +:foudn -> found +frequecy -> frequency +firend -> friend +freind -> friend +heigth -> height +iamge -> image +inital -> initial +intput -> input +laguage -> language +lenght -> length +levle -> level +libary -> library +:moeny -> money +mysefl -> myself +ouptut -> output +ouput -> output +probaly -> probably +probelm -> problem +recrod -> record +reponse -> response +reprot -> report +singel -> single +stregth -> strength +strengh -> strength +tkaes -> takes +therfore -> therefore +todya -> today +toghether -> together +unkown -> unknown +unqiue -> unique +widht -> width + + +## Words with tricky spelling. +# If you are a good speller, you could drop this section. +aberation -> aberration +accross -> across +adviced -> advised +aledge -> allege +alledge -> allege +amature -> amateur +anomolous -> anomalous +anomoly -> anomaly +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +asthetic -> aesthetic +auxilary -> auxiliary +auxillary -> auxiliary +auxilliary -> auxiliary +bankrupcy -> bankruptcy +busness -> business +bussiness -> business +calander -> calendar +commitee -> committee +comittee -> committee +competance -> competence +competant -> competent +concensus -> consensus +cognizent -> cognizant +copywrite: -> copyright +choosen -> chosen +collegue -> colleague +excercise -> exercise +:grammer -> grammar +:guage -> gauge +govement -> government +govenment -> government +goverment -> government +governmnet -> government +govorment -> government +govornment -> government +guaratee -> guarantee +garantee -> guarantee +gaurantee -> guarantee +heirarchy -> hierarchy +hygeine -> hygiene +hypocracy -> hypocrisy +hypocrasy -> hypocrisy +hypocricy -> hypocrisy +hypocrit: -> hypocrite +looses: -> loses +maintence -> maintenance +morgage -> mortgage +neccesary -> necessary +necesary -> necessary +pallete -> palette +paralel -> parallel +parralel -> parallel +parrallel -> parallel +priviledge -> privilege +probablly -> probably +prominant -> prominent +propogate -> propagate +proove -> prove +psuedo -> pseudo +reciept -> receipt +# Catch misspellings of "receives", "receiving", etc. +receiev -> receiv +reciev -> receiv +recepient -> recipient +recipiant -> recipient +relevent -> relevant +repitition -> repetition +safty -> safety +saftey -> safety +# Catch misspellings of "separate", "separating", etc. +seperat -> separat +spectogram -> spectrogram +symetric -> symmetric +tolerence -> tolerance + + +## Words particularly for coding. +# Entries for common code keywords ("const") and terminology ("lookup"). +cacheing -> caching +complier -> compiler +doulbe -> double +dyanmic -> dynamic +# As in "execute", "executable", "executing", ... +excecut -> execut +failse -> false +fales -> false +fasle -> false +flase -> false +indeces -> indices +indecies -> indices +indicies -> indices +interator -> iterator +looup -> lookup +namesapce -> namespace +namespcae -> namespace +nulltpr -> nullptr +operaotr -> operator +overide -> override +ovveride -> override +poitner -> pointer +:rference -> reference +referece -> reference +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +teamplate -> template +tempalte -> template +:ture -> true +retrun -> return +retun -> return +reutrn -> return +cosnt -> const +virutal -> virtual +vitual -> virtual +yeild -> yield + + +## Catch skipped spaces between common words. +:alot: -> a lot +:andteh -> and the +:andthe -> and the +:asthe -> as the +:atthe -> at the +abouta -> about a +aboutit -> about it +aboutthe -> about the +:tothe -> to the +didnot -> did not +fromthe -> from the + + +## Various additional entries. +:agred -> agreed +:ajust -> adjust +:anual -> annual +:asign -> assign +:aslo: -> also +:casue -> cause +:choses -> chooses +:gaurd -> guard +:haev -> have +:hapen -> happen +:idaes -> ideas +:jsut: -> just +:jstu: -> just +:knwo -> know +:konw -> know +:kwno -> know +:ocuntry -> country +:ocur -> occur +:socre -> score +:szie -> size +:the:the: -> the +:turth -> truth +:uesd: -> used +:usally -> usually +abilties -> abilities +abilty -> ability +abvove -> above +accesories -> accessories +accomodate -> accommodate +acommodate -> accommodate +acomplish -> accomplish +actualy -> actually +acurate -> accurate +acutally -> actually +addtion -> addition +againnst -> against +aganist -> against +aggreed -> agreed +agianst -> against +ahppn -> happen +allign -> align +anytying -> anything +aquire -> acquire +availabe -> available +availaible -> available +availalbe -> available +availble -> available +availiable -> available +avalable -> available +avaliable -> available +avilable -> available +bandwith -> bandwidth +begginer -> beginner +beleif -> belief +beleive -> believe +belive -> believe +breif -> brief +burried -> buried +caluclate -> calculate +caluculate -> calculate +calulate -> calculate +catagory -> category +cauhgt -> caught +ceratin -> certain +certian -> certain +cheif -> chief +cieling -> ceiling +circut -> circuit +clasic -> classic +cmoputer -> computer +coform -> conform +comming: -> coming +considerd -> considered +dervied -> derived +desicion -> decision +diferent -> different +diferrent -> different +differnt -> different +diffrent -> different +divison -> division +effecient -> efficient +eligable -> eligible +elpased -> elapsed +embarass -> embarrass +embeded -> embedded +encypt -> encrypt +finaly -> finally +foriegn -> foreign +foward -> forward +fraciton -> fraction +fucntion -> function +fufill -> fulfill +fullfill -> fulfill +futher -> further +ganerate -> generate +generaly -> generally +greatful -> grateful +heigher -> higher +higest -> highest +howver -> however +hydogen -> hydrogen +importamt -> important +inclued -> include +insted -> instead +intrest -> interest +invliad -> invalid +largst -> largest +learnign -> learning +liasion -> liaison +likly -> likely +lisense -> license +listner -> listener +macthing -> matching +manefist -> manifest +mesage -> message +naturual -> natural +occassion -> occasion +occured -> occurred +particualr -> particular +paticular -> particular +peice -> piece +perhasp -> perhaps +perheaps -> perhaps +perhpas -> perhaps +perphas -> perhaps +persue -> pursue +posess -> possess +postion -> position +preiod -> period +primarly -> primarily +privte -> private +proccess -> process +proeprty -> property +propery -> property +realtion -> relation +reasearch -> research +recuring -> recurring +refered -> referred +regluar -> regular +releated -> related +resutl -> result +reuslt -> result +reveiw -> review +satisifed -> satisfied +scheduel -> schedule +sequnce -> sequence +similiar -> similar +simmilar -> similar +slighly -> slightly +somehwat -> somewhat +statment -> statement +sucess -> success +succsess -> success +sugest -> suggest +sumary -> summary +supress -> suppress +surpress -> suppress +thresold -> threshold +tongiht -> tonight +tranpose -> transpose +typcial -> typical +udpate -> update +ususally -> usually +verticies -> vertices +whereever -> wherever +wherre -> where +wierd -> weird + diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h new file mode 100644 index 000000000000..cba21055fe0e --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h @@ -0,0 +1,52 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. + +// default options applied when eeprom is cleared +#define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable +#define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable +#define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) +#define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) +#define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers + +// Caps Lock RGB indicator color +#define CAPS_LOCK_INDICATOR_COLOR RGB_RED + +// Dynamic Fn Layer RGB indicator options +#define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange + +// Caps Word is activated by double-tapping left Shift. Replace this with +// #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word +// by single-tapping both left and right Shift togeter. +#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_RED + +// Caps Word will light left Shift, left Control and left Option (or left Windows +// key) when acitvated. Remove this line if you want Caps Word to only light left +// Shift when enabled. +#define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 510287acecb0..ea0de66b58b8 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Keychron (https://www.keychron.com) +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 @@ -16,14 +16,38 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "keymap_user.h" +#include "keymap_user_config.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_user.h" +#endif + +// clang-format off -enum layers{ - MAC_BASE, - MAC_FN, - WIN_BASE, - WIN_FN +enum my_bootloader_state { + BOOTLOADER_INACTIVE, + BOOTLOADER_PRESSED, + BOOTLOADER_WAIT, + BOOTLOADER_DO +} bootloader_state; + +enum my_keycodes { + KC_LIGHT_TAB_TOGGLE = QK_USER_0, + KC_LIGHT_ALPHAS_TOGGLE, + KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, + KC_FN_LAYER_COLOR_TOGGLE, + KC_LOCK_BLANK_MAC }; +#define KC_LTTOG KC_LIGHT_TAB_TOGGLE +#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE +#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE +#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE +#define KC_LBMAC KC_LOCK_BLANK_MAC + +static bool win_mode; +static bool win_mode_was_activated; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_82( KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_MUTE, @@ -34,12 +58,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD,MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN] = LAYOUT_ansi_82( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + KC_LBMAC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, + AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, NK_TOGG, _______, LCAG(KC_W), LCAG(KC_D), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), [WIN_BASE] = LAYOUT_ansi_82( KC_ESC, 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_DEL, KC_MUTE, @@ -51,13 +75,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [WIN_FN] = LAYOUT_ansi_82( _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; +// clang-format on + #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, @@ -67,10 +93,245 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { }; #endif -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keychron(keycode, record)) { - return false; +void matrix_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} + +void keyboard_post_init_user(void) { + user_config_read_eeprom(); +} + +void housekeeping_task_user(void) { + switch(bootloader_state) { + case BOOTLOADER_DO: + // bootloader was pressed two frames ago. RGB should now be off, + // so we can call the bootloader. + reset_keyboard(); + break; + case BOOTLOADER_WAIT: + // bootloader was pressed on previous frame, we wait this frame and + // set flag to do bootloader at end of next frame. For some reason, my + // Q2 needed this extra wait frame. + bootloader_state = BOOTLOADER_DO; + break; + case BOOTLOADER_PRESSED: + // User pressed bootloader keycode and RGB was disabled earlier in this + // frame. However RGB changes wont take place immediately, so we set a + // flag here which will be caught at end of the next frame. + bootloader_state = BOOTLOADER_WAIT; + break; + default: + break; + } + + housekeeping_task_keychron(); +} + +bool dip_switch_update_user(uint8_t index, bool active) { + win_mode = (index == 0 && active ? true : false); + return true; +} + +bool is_win_mode(void) { return win_mode; } + +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case MAC_BASE: + if (!is_win_mode() && win_mode_was_activated) { + // switch was moved to mac mode + win_mode_was_activated = false; + + // check enable/disable + if (user_config_get_enable_mac_base()) { +// rgb_matrix_enable_noeeprom(); + + // load mac base settings + rgb_matrix_reload_from_eeprom(); + + rgb_matrix_enable_noeeprom(); + } else { + rgb_matrix_disable_noeeprom(); + } + } + break; + case WIN_BASE: + if (is_win_mode() && !win_mode_was_activated) { + // switch was moved to win mode + win_mode_was_activated = true; + + // check enable/disable + if (user_config_get_enable_win_base()) { + rgb_matrix_enable_noeeprom(); + + // load win base settings + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + } else { + rgb_matrix_disable_noeeprom(); + } + } + break; + default: // for any other layers, or the default layer + break; } + return state; +} +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (process_record_keychron(keycode, record)) { + switch (keycode) { + case QK_BOOT: + // We want to turn off LEDs before calling bootloader, so here + // we call rgb_matrix_disable_noeeprom() and set a flag because + // the LEDs won't be updated until the next frame. + if (record->event.pressed) { + rgb_matrix_disable_noeeprom(); + bootloader_state = BOOTLOADER_PRESSED; + } + return false; // Skip all further processing of this key + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_toggle_noeeprom(); + if (win_mode) { + user_config_toggle_enable_win_base(); + } else { + user_config_toggle_enable_mac_base(); + } + } + return false; // Skip all further processing of this key + case RGB_MOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_RMOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_reverse_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case KC_LIGHT_TAB_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_tab(); + } + return false; // Skip all further processing of this key + case KC_LIGHT_ALPHAS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_alphas(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_transparent_keys_off(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_COLOR_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_color_enable(); + } + return false; // Skip all further processing of this key + case KC_LOCK_BLANK_MAC: + if (record->event.pressed) { + send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } + } return true; } diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c new file mode 100644 index 000000000000..966a79f0182c --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c @@ -0,0 +1,344 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 "keychron_common.h" +#include "keymap_user.h" +#include "keymap_user_config.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_user.h" +#endif + +// clang-format off + +enum my_bootloader_state { + BOOTLOADER_INACTIVE, + BOOTLOADER_PRESSED, + BOOTLOADER_WAIT, + BOOTLOADER_DO +} bootloader_state; + +enum my_keycodes { + KC_LIGHT_TAB_TOGGLE = QK_USER_0, + KC_LIGHT_ALPHAS_TOGGLE, + KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, + KC_FN_LAYER_COLOR_TOGGLE, + KC_LOCK_BLANK_MAC +}; + +#define KC_LTTOG KC_LIGHT_TAB_TOGGLE +#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE +#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE +#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE +#define KC_LBMAC KC_LOCK_BLANK_MAC + +static bool win_mode; +static bool win_mode_was_activated; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + // Mac Fn1 + [_FN1] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, G(KC_0), + _______, KC_LBMAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_LEFT), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_RGHT), + _______, _______, _______, _______, _______, _______, _______, _______, LCAG(KC_W), LCAG(KC_D), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + // Win Fn1 + [_FN2] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, C(KC_0), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + // Combined Mac Win Fn2 + [_FN3] = LAYOUT_ansi_67( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +// clang-format on + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FN1] = { ENCODER_CCW_CW(G(KC_MINS), G(KC_EQL)) }, + [_FN2] = { ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)) }, + [_FN3] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, +}; +#endif + +void matrix_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} + +void keyboard_post_init_user(void) { + user_config_read_eeprom(); +} + +void housekeeping_task_user(void) { + switch(bootloader_state) { + case BOOTLOADER_DO: + // bootloader was pressed two frames ago. RGB should now be off, + // so we can call the bootloader. + reset_keyboard(); + break; + case BOOTLOADER_WAIT: + // bootloader was pressed on previous frame, we wait this frame and + // set flag to do bootloader at end of next frame. For some reason, my + // Q2 needed this extra wait frame. + bootloader_state = BOOTLOADER_DO; + break; + case BOOTLOADER_PRESSED: + // User pressed bootloader keycode and RGB was disabled earlier in this + // frame. However RGB changes wont take place immediately, so we set a + // flag here which will be caught at end of the next frame. + bootloader_state = BOOTLOADER_WAIT; + break; + default: + break; + } + + housekeeping_task_keychron(); +} + +bool dip_switch_update_user(uint8_t index, bool active) { + win_mode = (index == 0 && active ? true : false); + return true; +} + +bool is_win_mode(void) { return win_mode; } + +layer_state_t layer_state_set_user(layer_state_t state) { + switch (get_highest_layer(state)) { + case MAC_BASE: + if (!is_win_mode() && win_mode_was_activated) { + // switch was moved to mac mode + win_mode_was_activated = false; + + // check enable/disable + if (user_config_get_enable_mac_base()) { +// rgb_matrix_enable_noeeprom(); + + // load mac base settings + rgb_matrix_reload_from_eeprom(); + + rgb_matrix_enable_noeeprom(); + } else { + rgb_matrix_disable_noeeprom(); + } + } + break; + case WIN_BASE: + if (is_win_mode() && !win_mode_was_activated) { + // switch was moved to win mode + win_mode_was_activated = true; + + // check enable/disable + if (user_config_get_enable_win_base()) { + rgb_matrix_enable_noeeprom(); + + // load win base settings + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + } else { + rgb_matrix_disable_noeeprom(); + } + } + break; + default: // for any other layers, or the default layer + break; + } + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (process_record_keychron(keycode, record)) { + switch (keycode) { + case QK_BOOT: + // We want to turn off LEDs before calling bootloader, so here + // we call rgb_matrix_disable_noeeprom() and set a flag because + // the LEDs won't be updated until the next frame. + if (record->event.pressed) { + rgb_matrix_disable_noeeprom(); + bootloader_state = BOOTLOADER_PRESSED; + } + return false; // Skip all further processing of this key + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_toggle_noeeprom(); + if (win_mode) { + user_config_toggle_enable_win_base(); + } else { + user_config_toggle_enable_mac_base(); + } + } + return false; // Skip all further processing of this key + case RGB_MOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_RMOD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_step_reverse_noeeprom(); + user_config_set_mode_win_base(rgb_matrix_get_mode()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_HUD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_hue_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_sat_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_VAD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_val_noeeprom(); + user_config_set_hsv_win_base(rgb_matrix_get_hsv()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPI: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_increase_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case RGB_SPD: + if (win_mode) { + if (record->event.pressed) { + rgb_matrix_decrease_speed_noeeprom(); + user_config_set_spd_win_base(rgb_matrix_get_speed()); + } + return false; // Skip all further processing of this key + } else { + return true; // Allow further processing of this key + } + case KC_LIGHT_TAB_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_tab(); + } + return false; // Skip all further processing of this key + case KC_LIGHT_ALPHAS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_caps_lock_light_alphas(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_transparent_keys_off(); + } + return false; // Skip all further processing of this key + case KC_FN_LAYER_COLOR_TOGGLE: + if (record->event.pressed) { + user_config_toggle_fn_layer_color_enable(); + } + return false; // Skip all further processing of this key + case KC_LOCK_BLANK_MAC: + if (record->event.pressed) { + send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } + } + return true; +} diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h new file mode 100644 index 000000000000..d1eed4d3d63c --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h @@ -0,0 +1,26 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +bool is_win_mode(void); diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c new file mode 100644 index 000000000000..a15c91712346 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -0,0 +1,179 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 "keymap_user_config.h" + +typedef struct { + bool caps_lock_light_tab; + bool caps_lock_light_alphas; + bool fn_layer_transparent_keys_off; + bool fn_layer_color_enable; + uint8_t enable_mac_base; + uint8_t enable_win_base; + uint8_t mode_win_base; + uint8_t spd_win_base; + HSV hsv_win_base; + HSV hsv_mac_fn1; + HSV hsv_win_fn1; + HSV hsv_fn2; +} user_config_t; + +user_config_t user_config; + +void eeconfig_init_user(void) { + user_config.caps_lock_light_tab = DEFAULT_CAPS_LOCK_LIGHT_TAB; + user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; + user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; + user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; + user_config.enable_mac_base = DEFAULT_ENABLE_MAC_BASE; + user_config.enable_win_base = DEFAULT_ENABLE_WIN_BASE; + user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; + user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; + user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; + user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; + user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; + user_config_write_eeprom(); +} + +void user_config_read_eeprom(void) { + eeconfig_read_user_datablock(&user_config); +} + +void user_config_write_eeprom(void) { + eeconfig_update_user_datablock(&user_config); +} + +// getters + +bool user_config_get_caps_lock_light_tab(void) { + return user_config.caps_lock_light_tab; +} + +bool user_config_get_caps_lock_light_alphas(void) { + return user_config.caps_lock_light_alphas; +} + +bool user_config_get_fn_layer_transparent_keys_off(void) { + return user_config.fn_layer_transparent_keys_off; +} + +bool user_config_get_fn_layer_color_enable(void) { + return user_config.fn_layer_color_enable; +} + +uint8_t user_config_get_enable_mac_base(void) { + return user_config.enable_mac_base; +} + +uint8_t user_config_get_enable_win_base(void) { + return user_config.enable_win_base; +} + +uint8_t user_config_get_mode_win_base(void) { + return user_config.mode_win_base; +} + +uint8_t user_config_get_spd_win_base(void) { + return user_config.spd_win_base; +} + +HSV user_config_get_hsv_win_base(void) { + return user_config.hsv_win_base; +} + +HSV user_config_get_hsv_mac_fn1(void) { + return user_config.hsv_mac_fn1; +} + +HSV user_config_get_hsv_win_fn1(void) { + return user_config.hsv_win_fn1; +} + +HSV user_config_get_hsv_fn2(void) { + return user_config.hsv_fn2; +} + +// setters + +void user_config_toggle_caps_lock_light_tab(void) { + user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit + user_config_write_eeprom(); +} + +void user_config_toggle_caps_lock_light_alphas(void) { + user_config.caps_lock_light_alphas ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_fn_layer_transparent_keys_off(void) { + user_config.fn_layer_transparent_keys_off ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_fn_layer_color_enable(void) { + user_config.fn_layer_color_enable ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_enable_mac_base(void) { + user_config.enable_mac_base ^= 1; + user_config_write_eeprom(); +} + +void user_config_toggle_enable_win_base(void) { + user_config.enable_win_base ^= 1; + user_config_write_eeprom(); +} + +void user_config_set_mode_win_base(uint8_t mode) { + user_config.mode_win_base = mode; + user_config_write_eeprom(); +} + +void user_config_set_spd_win_base(uint8_t spd) { + user_config.spd_win_base = spd; + user_config_write_eeprom(); +} + +void user_config_set_hsv_win_base(HSV hsv) { + user_config.hsv_win_base = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_mac_fn1(HSV hsv) { + user_config.hsv_mac_fn1 = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_win_fn1(HSV hsv) { + user_config.hsv_win_fn1 = hsv; + user_config_write_eeprom(); +} + +void user_config_set_hsv_fn2(HSV hsv) { + user_config.hsv_fn2 = hsv; + user_config_write_eeprom(); +} + + + + + + + + + diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h new file mode 100644 index 000000000000..f07d4eb427fa --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -0,0 +1,52 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 + +void user_config_read_eeprom(void); +void user_config_write_eeprom(void); + +// getters + +bool user_config_get_caps_lock_light_tab(void); +bool user_config_get_caps_lock_light_alphas(void); +bool user_config_get_fn_layer_transparent_keys_off(void); +bool user_config_get_fn_layer_color_enable(void); +uint8_t user_config_get_enable_mac_base(void); +uint8_t user_config_get_enable_win_base(void); +uint8_t user_config_get_mode_win_base(void); +uint8_t user_config_get_spd_win_base(void); +HSV user_config_get_hsv_win_base(void); +HSV user_config_get_hsv_mac_fn1(void); +HSV user_config_get_hsv_win_fn1(void); +HSV user_config_get_hsv_fn2(void); + +// setters + +void user_config_toggle_caps_lock_light_tab(void); +void user_config_toggle_caps_lock_light_alphas(void); +void user_config_toggle_fn_layer_transparent_keys_off(void); +void user_config_toggle_fn_layer_color_enable(void); +void user_config_toggle_enable_mac_base(void); +void user_config_toggle_enable_win_base(void); +void user_config_set_mode_win_base(uint8_t mode); +void user_config_set_spd_win_base(uint8_t spd); +void user_config_set_hsv_win_base(HSV hsv); +void user_config_set_hsv_mac_fn1(HSV hsv); +void user_config_set_hsv_win_fn1(HSV hsv); +void user_config_set_hsv_fn2(HSV hsv); + + diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md new file mode 100644 index 000000000000..55a792f47e05 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -0,0 +1,139 @@ +## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.0 + +### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. + +## Features: +- Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. + +- SEVERED! Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) + +- Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) + - Uses getreuer's 400 entry autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) + +- Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) + +- Caps Lock RGB indicator. Will light Caps Lock key with options to also light Tab key (useful for some keycap sets), and/or light all alpha keys. + +- Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. + +##### Notes: + +###### RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. +###### Toggling RGB mode off will disable RGB for all layers and indicators. RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off for each base layer. The indicators will remain at full brightness. +###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. + +## Config.h options + +Default options (these defaults will be applied whenever the eeprom is cleared): + +``` + #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable + #define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable + #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) + #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers +``` + +Caps Lock RGB indicator option: + +``` + #define CAPS_LOCK_INDICATOR_COLOR RGB_RED +``` + +Dynamic Fn Layer RGB indicator options: + +``` + #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange + #define FN2_LAYER_COLOR RGB_YELLOW +``` + +Caps Word options: + +``` + // Caps Word is activated by double-tapping left Shift. Replace this with + // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word + // by single-tapping both left and right Shift togeter. + #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_RED + + // Caps Word will light left Shift, left Control and left Option (or left Windows + // key) when acitvated. Remove this line if you want Caps Word to only light left + // Shift when enabled. + #define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER +``` + +## This keymap makes the following layout changes over the factory firmware + +- Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) +- Fn2+Left Shift toggles Autocorrect on/off +- Fn2+Backspace enters DFU mode (but does not reset eeprom) +- Fn2+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) + - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. +- Fn2+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) + - toggle lighting all the alpha keys when Caps Lock is enabled. +- Fn2+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) + - toggle turning off RGB for keys with no definition +- Fn2+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR + +- Uses Grave Escape on key to the left of the 1 key: + - Base Layer: key functions as ESC, shift+key gives ~ + - Fn1 Layer: Fn1+key gives ` + - Fn2 Layer: Fn2+key gives ~ + +- Changes the two vertical keys under the knob as follows: + - Base Layer: PGUP and PGDN + - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) + - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) + +- Changes the knob to function as follows: + - Base Layer: volume up, down Press: mute + - Fn1 Layer: zoom in, out Press: return to 100% zoom + - Fn2 Layer: LED brighness inc, dec Press: backlight toggle + +- Mac mode only + - Fn1+Q (KC_LBMAC) will lock and sleep display + - Fn1+< sets my secondary display to 0° rotation + - Fn1+> sets my secondary display to 90° rotation + + Note: display rotation requires additional software and changes made, see this link for more information: + [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + +All custom keycodes can be moved to different keys in VIA by using the following: +- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Off Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac + +## Known Issues + +1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working +2. Keychron LED test Fn1+Home+Right is not working + +It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. + + +#### USE AT YOUR OWN RISK + +## Changelog: + +v2.0.0 April 7, 2023 +- added different RGB settings for Mac Base and Win Base layers + +v1.0.1 April 4, 2023 +- made requested changes by QMK reveiwers +- removed optional .json file and baked my layout changes into the firmware + +v1.0.0 March 19, 2023 +- Carried over features from my Q1V2 keymap. diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c new file mode 100644 index 000000000000..85fa58ed89da --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -0,0 +1,99 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 "keychron_common.h" +#include "rgb_matrix_user.h" +#include "keymap_user.h" +#include "keymap_user_config.h" + +keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; + +void rgb_matrix_init_user(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + uint8_t led_index = g_led_config.matrix_co[row][col]; + if (led_index != NO_LED) { + led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; + } + } + } +} + +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { + case MAC_BASE: + case WIN_BASE: +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); + } +#endif + break; + case MAC_FN: + case WIN_FN: +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } + break; + } + return false; +} + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = led_min; i < led_max; i++) { + uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); + if ((*is_keycode)(keycode)) { + rgb_matrix_set_color(i, red, green, blue); + } + } +} + +bool is_caps_lock_indicator(uint16_t keycode) { + bool indicator = keycode == KC_CAPS; + + if (user_config_get_caps_lock_light_tab()) { + indicator = keycode == KC_TAB || keycode == KC_CAPS; + } + + if (user_config_get_caps_lock_light_alphas()) { + return (KC_A <= keycode && keycode <= KC_Z) || indicator; + } else { + return indicator; + } +} + +bool is_caps_word_indicator(uint16_t keycode) { + bool indicator = keycode == KC_LSFT; +#ifdef CAPS_WORD_LIGHT_LOWER_LEFT_CORNER + indicator = keycode == KC_LSFT || keycode == KC_LCTL || keycode == KC_LOPTN; +#endif + return indicator; +} + +bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } +bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h new file mode 100644 index 000000000000..c6d5e65548d6 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h @@ -0,0 +1,24 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 + +void rgb_matrix_init_user(void); +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); +bool is_caps_lock_indicator(uint16_t keycode); +bool is_caps_word_indicator(uint16_t keycode); +bool is_transparent(uint16_t keycode); +bool is_not_transparent(uint16_t keycode); diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk index 9cf1a9b56cba..b54f6bf491b3 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk @@ -1,5 +1,13 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes +CAPS_WORD_ENABLE = yes +AUTOCORRECT_ENABLE = yes + +SRC += keymap_user_config.c + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_matrix_user.c +endif VPATH += keyboards/keychron/common SRC += keychron_common.c From 8faa4530c935fc4b0f7c159090e27f85e9c21a12 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 02:16:09 -0400 Subject: [PATCH 104/160] moved layer code back to rgb_matrix_user temporarily --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 6 ++-- .../keymaps/mkillewald/rgb_matrix_user.c | 35 +++++++++++++++++++ .../ansi_encoder/keymaps/mkillewald/rules.mk | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index ea0de66b58b8..53c4f8ed083b 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -46,7 +46,7 @@ enum my_keycodes { #define KC_LBMAC KC_LOCK_BLANK_MAC static bool win_mode; -static bool win_mode_was_activated; +//static bool win_mode_was_activated; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_82( @@ -136,7 +136,7 @@ bool dip_switch_update_user(uint8_t index, bool active) { bool is_win_mode(void) { return win_mode; } -layer_state_t layer_state_set_user(layer_state_t state) { +/*layer_state_t layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case MAC_BASE: if (!is_win_mode() && win_mode_was_activated) { @@ -180,7 +180,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { break; } return state; -} +}*/ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index 85fa58ed89da..a2a210ed7e5f 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -22,6 +22,8 @@ keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; +static bool win_mode_was_activated; + void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { @@ -38,6 +40,39 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: + if (is_win_mode() && !win_mode_was_activated) { + // switch was moved to win mode + win_mode_was_activated = true; + + // check enable/disable + if (user_config_get_enable_win_base()) { + rgb_matrix_enable_noeeprom(); + + // load win base settings + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + } else { + rgb_matrix_disable_noeeprom(); + } + } else if (!is_win_mode() && win_mode_was_activated) { + // switch was moved to mac mode + win_mode_was_activated = false; + + // check enable/disable + if (user_config_get_enable_mac_base()) { + rgb_matrix_enable_noeeprom(); + + // load mac base settings + rgb_matrix_reload_from_eeprom(); + + rgb_matrix_enable_noeeprom(); + } else { + rgb_matrix_disable_noeeprom(); + } + } #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk index b54f6bf491b3..f83207e0afb1 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk @@ -1,7 +1,7 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes -AUTOCORRECT_ENABLE = yes +AUTOCORRECT_ENABLE = no SRC += keymap_user_config.c From 8f64e80ce974a45940e8bc35bfdc3a226b1d25a8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 02:24:15 -0400 Subject: [PATCH 105/160] updated readme --- .../ansi_encoder/keymaps/mkillewald/readme.md | 45 +++++-------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 55a792f47e05..713f344855e0 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,11 +1,11 @@ -## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.0 +## Keychron Q1 RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.0 ### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- SEVERED! Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Uses getreuer's 400 entry autocorrect dictionary. @@ -52,7 +52,6 @@ Dynamic Fn Layer RGB indicator options: ``` #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange - #define FN2_LAYER_COLOR RGB_YELLOW ``` Caps Word options: @@ -75,34 +74,19 @@ Caps Word options: ## This keymap makes the following layout changes over the factory firmware - Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) -- Fn2+Left Shift toggles Autocorrect on/off -- Fn2+Backspace enters DFU mode (but does not reset eeprom) -- Fn2+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) +- Fn+Left Shift toggles Autocorrect on/off +- Fn+Backspace enters DFU mode (but does not reset eeprom) +- Fn+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. -- Fn2+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) +- Fn+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) - toggle lighting all the alpha keys when Caps Lock is enabled. -- Fn2+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) +- Fn+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) - toggle turning off RGB for keys with no definition -- Fn2+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) +- Fn+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR -- Uses Grave Escape on key to the left of the 1 key: - - Base Layer: key functions as ESC, shift+key gives ~ - - Fn1 Layer: Fn1+key gives ` - - Fn2 Layer: Fn2+key gives ~ - -- Changes the two vertical keys under the knob as follows: - - Base Layer: PGUP and PGDN - - Fn1 Layer: Home and End (Mac mode does Cmd-left and Cmd-right) - - Fn2 Layer: Delete and Home (Mac mode Home returns to top of page) - -- Changes the knob to function as follows: - - Base Layer: volume up, down Press: mute - - Fn1 Layer: zoom in, out Press: return to 100% zoom - - Fn2 Layer: LED brighness inc, dec Press: backlight toggle - - Mac mode only - - Fn1+Q (KC_LBMAC) will lock and sleep display + - Fn+Esc (KC_LBMAC) will lock and sleep display - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation @@ -128,12 +112,5 @@ It seems Keychron has not pushed the relavant code to the main QMK repo yet. I s ## Changelog: -v2.0.0 April 7, 2023 -- added different RGB settings for Mac Base and Win Base layers - -v1.0.1 April 4, 2023 -- made requested changes by QMK reveiwers -- removed optional .json file and baked my layout changes into the firmware - -v1.0.0 March 19, 2023 -- Carried over features from my Q1V2 keymap. +v2.0.0 April 11, 2023 +- copied code from Q2 v2.0.0 firware over From a0d2401154f39e0fe43fc1bfde4e8da16c8dd201 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:10:48 -0400 Subject: [PATCH 106/160] enabled separate RGB toggle for each base layer (Mac / Win) --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 63 +++++++------------ .../keymaps/mkillewald/keymap_user.h | 2 - .../ansi_encoder/keymaps/mkillewald/readme.md | 8 ++- .../keymaps/mkillewald/rgb_matrix_user.c | 35 ----------- 4 files changed, 29 insertions(+), 79 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 53c4f8ed083b..0e30fc9701ee 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -22,6 +22,8 @@ # include "rgb_matrix_user.h" #endif +#include "print.h" + // clang-format off enum my_bootloader_state { @@ -46,7 +48,6 @@ enum my_keycodes { #define KC_LBMAC KC_LOCK_BLANK_MAC static bool win_mode; -//static bool win_mode_was_activated; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_82( @@ -134,53 +135,37 @@ bool dip_switch_update_user(uint8_t index, bool active) { return true; } -bool is_win_mode(void) { return win_mode; } - -/*layer_state_t layer_state_set_user(layer_state_t state) { +layer_state_t default_layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case MAC_BASE: - if (!is_win_mode() && win_mode_was_activated) { - // switch was moved to mac mode - win_mode_was_activated = false; - - // check enable/disable - if (user_config_get_enable_mac_base()) { -// rgb_matrix_enable_noeeprom(); - - // load mac base settings - rgb_matrix_reload_from_eeprom(); - - rgb_matrix_enable_noeeprom(); - } else { - rgb_matrix_disable_noeeprom(); - } + // load mac base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_reload_from_eeprom(); + + // check disable + if (!user_config_get_enable_mac_base()) { + rgb_matrix_disable_noeeprom(); } break; case WIN_BASE: - if (is_win_mode() && !win_mode_was_activated) { - // switch was moved to win mode - win_mode_was_activated = true; - - // check enable/disable - if (user_config_get_enable_win_base()) { - rgb_matrix_enable_noeeprom(); - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - } else { - rgb_matrix_disable_noeeprom(); - } + // load win base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + + // check disable + if (!user_config_get_enable_win_base()) { + rgb_matrix_disable_noeeprom(); } break; - default: // for any other layers, or the default layer + default: break; } - return state; -}*/ + return state; +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (process_record_keychron(keycode, record)) { diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h index d1eed4d3d63c..35d2483aa677 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h @@ -22,5 +22,3 @@ enum layers{ WIN_BASE, WIN_FN }; - -bool is_win_mode(void); diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 713f344855e0..46f4a34e324b 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,4 +1,4 @@ -## Keychron Q1 RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.0 +## Keychron Q1 RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.1 ### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. @@ -19,8 +19,7 @@ ##### Notes: -###### RGB mode can only be toggled on/off when keyboard mode switch set to Mac. The RGB toggle will have no effect if the keyboard mode switch is set to Win. -###### Toggling RGB mode off will disable RGB for all layers and indicators. RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off for each base layer. The indicators will remain at full brightness. +###### Toggling RGB mode off will disable RGB for and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. ###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. ## Config.h options @@ -112,5 +111,8 @@ It seems Keychron has not pushed the relavant code to the main QMK repo yet. I s ## Changelog: +v2.0.1 April 11, 2023 +- enabled separate RGB toggle for each base layer (Mac / Win) + v2.0.0 April 11, 2023 - copied code from Q2 v2.0.0 firware over diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c index a2a210ed7e5f..85fa58ed89da 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c @@ -22,8 +22,6 @@ keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; -static bool win_mode_was_activated; - void rgb_matrix_init_user(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { @@ -40,39 +38,6 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { switch (current_layer) { case MAC_BASE: case WIN_BASE: - if (is_win_mode() && !win_mode_was_activated) { - // switch was moved to win mode - win_mode_was_activated = true; - - // check enable/disable - if (user_config_get_enable_win_base()) { - rgb_matrix_enable_noeeprom(); - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - } else { - rgb_matrix_disable_noeeprom(); - } - } else if (!is_win_mode() && win_mode_was_activated) { - // switch was moved to mac mode - win_mode_was_activated = false; - - // check enable/disable - if (user_config_get_enable_mac_base()) { - rgb_matrix_enable_noeeprom(); - - // load mac base settings - rgb_matrix_reload_from_eeprom(); - - rgb_matrix_enable_noeeprom(); - } else { - rgb_matrix_disable_noeeprom(); - } - } #ifdef CAPS_LOCK_INDICATOR_COLOR if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); From abdb2e0af8d6f10c42393ee9718bdee3d9a175c6 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:20:33 -0400 Subject: [PATCH 107/160] updated readme --- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 46f4a34e324b..d71ed0d2aa4c 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -19,7 +19,7 @@ ##### Notes: -###### Toggling RGB mode off will disable RGB for and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. +###### Toggling RGB mode off will disable RGB and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. ###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. ## Config.h options From 04ced2f854c90a12bfd988699523eb83ebf33593 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:35:52 -0400 Subject: [PATCH 108/160] converted bools to uint8_t --- .../ansi_encoder/keymaps/mkillewald/config.h | 8 ++--- .../keymaps/mkillewald/keymap_user_config.c | 16 ++++----- .../keymaps/mkillewald/keymap_user_config.h | 8 ++--- .../ansi_encoder/keymaps/mkillewald/readme.md | 34 +++++++++---------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h index cba21055fe0e..372432cea993 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h @@ -19,10 +19,10 @@ #define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. // default options applied when eeprom is cleared -#define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable -#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable -#define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable -#define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable +#define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index a15c91712346..31591422bc6f 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -18,10 +18,10 @@ #include "keymap_user_config.h" typedef struct { - bool caps_lock_light_tab; - bool caps_lock_light_alphas; - bool fn_layer_transparent_keys_off; - bool fn_layer_color_enable; + uint8_t caps_lock_light_tab; + uint8_t caps_lock_light_alphas; + uint8_t fn_layer_transparent_keys_off; + uint8_t fn_layer_color_enable; uint8_t enable_mac_base; uint8_t enable_win_base; uint8_t mode_win_base; @@ -59,19 +59,19 @@ void user_config_write_eeprom(void) { // getters -bool user_config_get_caps_lock_light_tab(void) { +uint8_t user_config_get_caps_lock_light_tab(void) { return user_config.caps_lock_light_tab; } -bool user_config_get_caps_lock_light_alphas(void) { +uint8_t user_config_get_caps_lock_light_alphas(void) { return user_config.caps_lock_light_alphas; } -bool user_config_get_fn_layer_transparent_keys_off(void) { +uint8_t user_config_get_fn_layer_transparent_keys_off(void) { return user_config.fn_layer_transparent_keys_off; } -bool user_config_get_fn_layer_color_enable(void) { +uint8_t user_config_get_fn_layer_color_enable(void) { return user_config.fn_layer_color_enable; } diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h index f07d4eb427fa..34d7560e48c7 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h @@ -21,10 +21,10 @@ void user_config_write_eeprom(void); // getters -bool user_config_get_caps_lock_light_tab(void); -bool user_config_get_caps_lock_light_alphas(void); -bool user_config_get_fn_layer_transparent_keys_off(void); -bool user_config_get_fn_layer_color_enable(void); +uint8_t user_config_get_caps_lock_light_tab(void); +uint8_t user_config_get_caps_lock_light_alphas(void); +uint8_t user_config_get_fn_layer_transparent_keys_off(void); +uint8_t user_config_get_fn_layer_color_enable(void); uint8_t user_config_get_enable_mac_base(void); uint8_t user_config_get_enable_win_base(void); uint8_t user_config_get_mode_win_base(void); diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index d71ed0d2aa4c..76a09970a4f1 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -8,8 +8,8 @@ - Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - - Uses getreuer's 400 entry autocorrect dictionary. - [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) + - Uses getreuer's autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) - Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) @@ -17,7 +17,7 @@ - Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. -##### Notes: +##### Notes: ###### Toggling RGB mode off will disable RGB and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. ###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. @@ -27,10 +27,10 @@ Default options (these defaults will be applied whenever the eeprom is cleared): ``` - #define DEFAULT_CAPS_LOCK_LIGHT_TAB false // true = enable, false = disable - #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA true // true = enable, false = disable - #define DEFAULT_FN_LAYER_TRANSPARENT_OFF false // true = enable, false = disable - #define DEFAULT_FN_LAYER_SHOW_COLOR true // true = enable, false = disable + #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) @@ -39,7 +39,7 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers -``` +``` Caps Lock RGB indicator option: @@ -56,9 +56,9 @@ Dynamic Fn Layer RGB indicator options: Caps Word options: ``` - // Caps Word is activated by double-tapping left Shift. Replace this with - // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word - // by single-tapping both left and right Shift togeter. + // Caps Word is activated by double-tapping left Shift. Replace this with + // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word + // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD // Caps Word RGB indicator color @@ -76,20 +76,20 @@ Caps Word options: - Fn+Left Shift toggles Autocorrect on/off - Fn+Backspace enters DFU mode (but does not reset eeprom) - Fn+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) - - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. + - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. - Fn+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) - - toggle lighting all the alpha keys when Caps Lock is enabled. + - toggle lighting all the alpha keys when Caps Lock is enabled. - Fn+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) - - toggle turning off RGB for keys with no definition + - toggle turning off RGB for keys with no definition - Fn+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) - - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR - Mac mode only - Fn+Esc (KC_LBMAC) will lock and sleep display - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation - - Note: display rotation requires additional software and changes made, see this link for more information: + + Note: display rotation requires additional software and changes made, see this link for more information: [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) All custom keycodes can be moved to different keys in VIA by using the following: From ff1436351d858564343c7819be598c17c6679594 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:39:26 -0400 Subject: [PATCH 109/160] added autocorrection_dict.txt --- .../mkillewald/autocorrection_dict.txt | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt new file mode 100644 index 000000000000..8280fcf703b9 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt @@ -0,0 +1,85 @@ +# Copyright 2021-2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +:guage -> gauge +:the the: -> the +:thier -> their +:ture -> true +accomodate -> accommodate +acommodate -> accommodate +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +aquire -> acquire +becuase -> because +cauhgt -> caught +cheif -> chief +choosen -> chosen +cieling -> ceiling +collegue -> colleague +concensus -> consensus +contians -> contains +cosnt -> const +dervied -> derived +dosen't -> doesn't +fales -> false +fasle -> false +fitler -> filter +flase -> false +foward -> forward +frequecy -> frequency +gaurantee -> guarantee +guaratee -> guarantee +heigth -> height +heirarchy -> hierarchy +inclued -> include +interator -> iterator +intput -> input +invliad -> invalid +lenght -> length +liasion -> liaison +libary -> library +listner -> listener +looses: -> loses +looup -> lookup +manefist -> manifest +namesapce -> namespace +namespcae -> namespace +occassion -> occasion +occured -> occurred +ouptut -> output +ouput -> output +overide -> override +postion -> position +priviledge -> privilege +psuedo -> pseudo +recieve -> receive +refered -> referred +relevent -> relevant +repitition -> repetition +reuslt -> result +retrun -> return +retun -> return +reutrn -> return +saftey -> safety +seperate -> separate +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +thresold -> threshold +udpate -> update +widht -> width \ No newline at end of file From f86ccf473358bba98b36bd6a6ce06ea048d8659b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:40:09 -0400 Subject: [PATCH 110/160] removed autocorrection_dict_extra.txt --- .../mkillewald/autocorrection_dict_extra.txt | 473 ------------------ 1 file changed, 473 deletions(-) delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt deleted file mode 100644 index b5f293d96cb1..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt +++ /dev/null @@ -1,473 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# This is a larger example typo dictionary containing 400 entries. It builds to -# a table of about 6000 bytes, so you'll need a keyboard with a generous -# amount of free firmware space to use the full dictionary. Alternatively, pick -# out a subset of entries to a separate file, then build a table from that. -# -# Dictionary syntax: -# Each line of this file defines one typo correction entry with the syntax -# "typo -> correction". Typos and corrections are case insensitive, and any -# whitespace before or after the typo and correction is ignored. The typo must be -# only the letters a-z, or the special character : representing a word break. -# -# For documentation about how to use this dictionary, see -# https://getreuer.info/posts/keyboards/autocorrection -# -# Further resources: -# * Wikipedia has a large list of common typos at -# https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines -# -# * EmacsWiki has another list of typos at -# https://www.emacswiki.org/emacs/autocorrection_abbrev_defs -# -# * You can find data on English word frequencies at -# https://www.wordfrequency.info/samples.asp - - -## 10 most common words. -# The words "there", "about", "their", "would", "people", "which", "could", -# "think", "other", and "because" are among the most common words in English -# that are 5 letters or longer. (We don't include entries for words shorter than -# that to avoid false triggering.) -:htere -> there -abbout -> about -abotu -> about -baout -> about -:theri -> their -:thier -> their -:owudl -> would -woudl -> would -peaple -> people -peolpe -> people -peopel -> people -poeple -> people -poeople -> people -:hwihc -> which -whcih -> which -whihc -> which -whlch -> which -wihch -> which -coudl -> could -:htikn -> think -:htink -> think -thikn -> think -thiunk -> think -tihkn -> think -:olther -> other -:otehr -> other -baceause -> because -beacuse -> because -becasue -> because -beccause -> because -becouse -> because -becuase -> because - -## Common words, 11-20. -theese -> these -:goign -> going -:gonig -> going -:yaers -> years -:yeasr -> years -:thsoe -> those -shoudl -> should -raelly -> really -realy -> really -relaly -> really -bedore -> before -befoer -> before -littel -> little -beeing -> being -:hwile -> while - -## Common words, 21-30. -aroud -> around -arround -> around -arund -> around -thign -> thing -thigsn -> things -thnigs -> things -anohter -> another -beteen -> between -beween -> between -bewteen -> between -:eveyr -> every -:graet -> great -:agian -> again -:sicne -> since -alwasy -> always -alwyas -> always -throught -> thought - - -## Words especially susceptible to skipping or transposing a letter. -# These entries are for words that are easy enough to spell, but not necessarily -# easy to press the keys in the right order. -# Catch misspellings of "achieves", "achieving", etc. -:acheiv -> achiev -almsot -> almost -alomst -> almost -chnage -> change -chekc -> check -childen -> children -claer -> clear -comapny -> company -contian -> contain -elasped -> elapsed -feild -> field -fitler -> filter -firts -> first -follwo -> follow -:foudn -> found -frequecy -> frequency -firend -> friend -freind -> friend -heigth -> height -iamge -> image -inital -> initial -intput -> input -laguage -> language -lenght -> length -levle -> level -libary -> library -:moeny -> money -mysefl -> myself -ouptut -> output -ouput -> output -probaly -> probably -probelm -> problem -recrod -> record -reponse -> response -reprot -> report -singel -> single -stregth -> strength -strengh -> strength -tkaes -> takes -therfore -> therefore -todya -> today -toghether -> together -unkown -> unknown -unqiue -> unique -widht -> width - - -## Words with tricky spelling. -# If you are a good speller, you could drop this section. -aberation -> aberration -accross -> across -adviced -> advised -aledge -> allege -alledge -> allege -amature -> amateur -anomolous -> anomalous -anomoly -> anomaly -aparent -> apparent -aparrent -> apparent -apparant -> apparent -apparrent -> apparent -asthetic -> aesthetic -auxilary -> auxiliary -auxillary -> auxiliary -auxilliary -> auxiliary -bankrupcy -> bankruptcy -busness -> business -bussiness -> business -calander -> calendar -commitee -> committee -comittee -> committee -competance -> competence -competant -> competent -concensus -> consensus -cognizent -> cognizant -copywrite: -> copyright -choosen -> chosen -collegue -> colleague -excercise -> exercise -:grammer -> grammar -:guage -> gauge -govement -> government -govenment -> government -goverment -> government -governmnet -> government -govorment -> government -govornment -> government -guaratee -> guarantee -garantee -> guarantee -gaurantee -> guarantee -heirarchy -> hierarchy -hygeine -> hygiene -hypocracy -> hypocrisy -hypocrasy -> hypocrisy -hypocricy -> hypocrisy -hypocrit: -> hypocrite -looses: -> loses -maintence -> maintenance -morgage -> mortgage -neccesary -> necessary -necesary -> necessary -pallete -> palette -paralel -> parallel -parralel -> parallel -parrallel -> parallel -priviledge -> privilege -probablly -> probably -prominant -> prominent -propogate -> propagate -proove -> prove -psuedo -> pseudo -reciept -> receipt -# Catch misspellings of "receives", "receiving", etc. -receiev -> receiv -reciev -> receiv -recepient -> recipient -recipiant -> recipient -relevent -> relevant -repitition -> repetition -safty -> safety -saftey -> safety -# Catch misspellings of "separate", "separating", etc. -seperat -> separat -spectogram -> spectrogram -symetric -> symmetric -tolerence -> tolerance - - -## Words particularly for coding. -# Entries for common code keywords ("const") and terminology ("lookup"). -cacheing -> caching -complier -> compiler -doulbe -> double -dyanmic -> dynamic -# As in "execute", "executable", "executing", ... -excecut -> execut -failse -> false -fales -> false -fasle -> false -flase -> false -indeces -> indices -indecies -> indices -indicies -> indices -interator -> iterator -looup -> lookup -namesapce -> namespace -namespcae -> namespace -nulltpr -> nullptr -operaotr -> operator -overide -> override -ovveride -> override -poitner -> pointer -:rference -> reference -referece -> reference -singed -> signed -stirng -> string -strign -> string -swithc -> switch -swtich -> switch -teamplate -> template -tempalte -> template -:ture -> true -retrun -> return -retun -> return -reutrn -> return -cosnt -> const -virutal -> virtual -vitual -> virtual -yeild -> yield - - -## Catch skipped spaces between common words. -:alot: -> a lot -:andteh -> and the -:andthe -> and the -:asthe -> as the -:atthe -> at the -abouta -> about a -aboutit -> about it -aboutthe -> about the -:tothe -> to the -didnot -> did not -fromthe -> from the - - -## Various additional entries. -:agred -> agreed -:ajust -> adjust -:anual -> annual -:asign -> assign -:aslo: -> also -:casue -> cause -:choses -> chooses -:gaurd -> guard -:haev -> have -:hapen -> happen -:idaes -> ideas -:jsut: -> just -:jstu: -> just -:knwo -> know -:konw -> know -:kwno -> know -:ocuntry -> country -:ocur -> occur -:socre -> score -:szie -> size -:the:the: -> the -:turth -> truth -:uesd: -> used -:usally -> usually -abilties -> abilities -abilty -> ability -abvove -> above -accesories -> accessories -accomodate -> accommodate -acommodate -> accommodate -acomplish -> accomplish -actualy -> actually -acurate -> accurate -acutally -> actually -addtion -> addition -againnst -> against -aganist -> against -aggreed -> agreed -agianst -> against -ahppn -> happen -allign -> align -anytying -> anything -aquire -> acquire -availabe -> available -availaible -> available -availalbe -> available -availble -> available -availiable -> available -avalable -> available -avaliable -> available -avilable -> available -bandwith -> bandwidth -begginer -> beginner -beleif -> belief -beleive -> believe -belive -> believe -breif -> brief -burried -> buried -caluclate -> calculate -caluculate -> calculate -calulate -> calculate -catagory -> category -cauhgt -> caught -ceratin -> certain -certian -> certain -cheif -> chief -cieling -> ceiling -circut -> circuit -clasic -> classic -cmoputer -> computer -coform -> conform -comming: -> coming -considerd -> considered -dervied -> derived -desicion -> decision -diferent -> different -diferrent -> different -differnt -> different -diffrent -> different -divison -> division -effecient -> efficient -eligable -> eligible -elpased -> elapsed -embarass -> embarrass -embeded -> embedded -encypt -> encrypt -finaly -> finally -foriegn -> foreign -foward -> forward -fraciton -> fraction -fucntion -> function -fufill -> fulfill -fullfill -> fulfill -futher -> further -ganerate -> generate -generaly -> generally -greatful -> grateful -heigher -> higher -higest -> highest -howver -> however -hydogen -> hydrogen -importamt -> important -inclued -> include -insted -> instead -intrest -> interest -invliad -> invalid -largst -> largest -learnign -> learning -liasion -> liaison -likly -> likely -lisense -> license -listner -> listener -macthing -> matching -manefist -> manifest -mesage -> message -naturual -> natural -occassion -> occasion -occured -> occurred -particualr -> particular -paticular -> particular -peice -> piece -perhasp -> perhaps -perheaps -> perhaps -perhpas -> perhaps -perphas -> perhaps -persue -> pursue -posess -> possess -postion -> position -preiod -> period -primarly -> primarily -privte -> private -proccess -> process -proeprty -> property -propery -> property -realtion -> relation -reasearch -> research -recuring -> recurring -refered -> referred -regluar -> regular -releated -> related -resutl -> result -reuslt -> result -reveiw -> review -satisifed -> satisfied -scheduel -> schedule -sequnce -> sequence -similiar -> similar -simmilar -> similar -slighly -> slightly -somehwat -> somewhat -statment -> statement -sucess -> success -succsess -> success -sugest -> suggest -sumary -> summary -supress -> suppress -surpress -> suppress -thresold -> threshold -tongiht -> tonight -tranpose -> transpose -typcial -> typical -udpate -> update -ususally -> usually -verticies -> vertices -whereever -> wherever -wherre -> where -wierd -> weird - From 25943c337b8de9b4fbf68f09b4fbc8ca5da5aa36 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:42:46 -0400 Subject: [PATCH 111/160] using smaller autocorrect dictionary --- .../keymaps/mkillewald/autocorrect_data.h | 879 +++--------------- 1 file changed, 123 insertions(+), 756 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h index ff25efaf6cba..a092cc777346 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h @@ -25,785 +25,152 @@ #pragma once -// Autocorrection dictionary (400 entries): -// :htere -> there -// abbout -> about -// abotu -> about -// baout -> about -// :theri -> their +// Autocorrection dictionary (71 entries): +// :guage -> gauge +// :the:the: -> the // :thier -> their -// :owudl -> would -// woudl -> would -// peaple -> people -// peolpe -> people -// peopel -> people -// poeple -> people -// poeople -> people -// :hwihc -> which -// whcih -> which -// whihc -> which -// whlch -> which -// wihch -> which -// coudl -> could -// :htikn -> think -// :htink -> think -// thikn -> think -// thiunk -> think -// tihkn -> think -// :olther -> other -// :otehr -> other -// baceause -> because -// beacuse -> because -// becasue -> because -// beccause -> because -// becouse -> because -// becuase -> because -// theese -> these -// :goign -> going -// :gonig -> going -// :yaers -> years -// :yeasr -> years -// :thsoe -> those -// shoudl -> should -// raelly -> really -// realy -> really -// relaly -> really -// bedore -> before -// befoer -> before -// littel -> little -// beeing -> being -// :hwile -> while -// aroud -> around -// arround -> around -// arund -> around -// thign -> thing -// thigsn -> things -// thnigs -> things -// anohter -> another -// beteen -> between -// beween -> between -// bewteen -> between -// :eveyr -> every -// :graet -> great -// :agian -> again -// :sicne -> since -// alwasy -> always -// alwyas -> always -// throught -> thought -// :acheiv -> achiev -// almsot -> almost -// alomst -> almost -// chnage -> change -// chekc -> check -// childen -> children -// claer -> clear -// comapny -> company -// contian -> contain -// elasped -> elapsed -// feild -> field -// fitler -> filter -// firts -> first -// follwo -> follow -// :foudn -> found -// frequecy -> frequency -// firend -> friend -// freind -> friend -// heigth -> height -// iamge -> image -// inital -> initial -// intput -> input -// laguage -> language -// lenght -> length -// levle -> level -// libary -> library -// :moeny -> money -// mysefl -> myself -// ouptut -> output -// ouput -> output -// probaly -> probably -// probelm -> problem -// recrod -> record -// reponse -> response -// reprot -> report -// singel -> single -// stregth -> strength -// strengh -> strength -// tkaes -> takes -// therfore -> therefore -// todya -> today -// toghether -> together -// unkown -> unknown -// unqiue -> unique -// widht -> width -// aberation -> aberration -// accross -> across -// adviced -> advised -// aledge -> allege -// alledge -> allege -// amature -> amateur -// anomolous -> anomalous -// anomoly -> anomaly +// :ture -> true +// accomodate -> accommodate +// acommodate -> accommodate // aparent -> apparent // aparrent -> apparent // apparant -> apparent // apparrent -> apparent -// asthetic -> aesthetic -// auxilary -> auxiliary -// auxillary -> auxiliary -// auxilliary -> auxiliary -// bankrupcy -> bankruptcy -// busness -> business -// bussiness -> business -// calander -> calendar -// commitee -> committee -// comittee -> committee -// competance -> competence -// competant -> competent -// concensus -> consensus -// cognizent -> cognizant -// copywrite: -> copyright -// choosen -> chosen -// collegue -> colleague -// excercise -> exercise -// :grammer -> grammar -// :guage -> gauge -// govement -> government -// govenment -> government -// goverment -> government -// governmnet -> government -// govorment -> government -// govornment -> government -// guaratee -> guarantee -// garantee -> guarantee -// gaurantee -> guarantee -// heirarchy -> hierarchy -// hygeine -> hygiene -// hypocracy -> hypocrisy -// hypocrasy -> hypocrisy -// hypocricy -> hypocrisy -// hypocrit: -> hypocrite -// looses: -> loses -// maintence -> maintenance -// morgage -> mortgage -// neccesary -> necessary -// necesary -> necessary -// pallete -> palette -// paralel -> parallel -// parralel -> parallel -// parrallel -> parallel -// priviledge -> privilege -// probablly -> probably -// prominant -> prominent -// propogate -> propagate -// proove -> prove -// psuedo -> pseudo -// reciept -> receipt -// receiev -> receiv -// reciev -> receiv -// recepient -> recipient -// recipiant -> recipient -// relevent -> relevant -// repitition -> repetition -// safty -> safety -// saftey -> safety -// seperat -> separat -// spectogram -> spectrogram -// symetric -> symmetric -// tolerence -> tolerance -// cacheing -> caching -// complier -> compiler -// doulbe -> double -// dyanmic -> dynamic -// excecut -> execut -// failse -> false -// fales -> false -// fasle -> false -// flase -> false -// indeces -> indices -// indecies -> indices -// indicies -> indices -// interator -> iterator -// looup -> lookup -// namesapce -> namespace -// namespcae -> namespace -// nulltpr -> nullptr -// operaotr -> operator -// overide -> override -// ovveride -> override -// poitner -> pointer -// :rference -> reference -// referece -> reference -// singed -> signed -// stirng -> string -// strign -> string -// swithc -> switch -// swtich -> switch -// teamplate -> template -// tempalte -> template -// :ture -> true -// retrun -> return -// retun -> return -// reutrn -> return -// cosnt -> const -// virutal -> virtual -// vitual -> virtual -// yeild -> yield -// :alot: -> a lot -// :andteh -> and the -// :andthe -> and the -// :asthe -> as the -// :atthe -> at the -// abouta -> about a -// aboutit -> about it -// aboutthe -> about the -// :tothe -> to the -// didnot -> did not -// fromthe -> from the -// :agred -> agreed -// :ajust -> adjust -// :anual -> annual -// :asign -> assign -// :aslo: -> also -// :casue -> cause -// :choses -> chooses -// :gaurd -> guard -// :haev -> have -// :hapen -> happen -// :idaes -> ideas -// :jsut: -> just -// :jstu: -> just -// :knwo -> know -// :konw -> know -// :kwno -> know -// :ocuntry -> country -// :ocur -> occur -// :socre -> score -// :szie -> size -// :the:the: -> the -// :turth -> truth -// :uesd: -> used -// :usally -> usually -// abilties -> abilities -// abilty -> ability -// abvove -> above -// accesories -> accessories -// accomodate -> accommodate -// acommodate -> accommodate -// acomplish -> accomplish -// actualy -> actually -// acurate -> accurate -// acutally -> actually -// addtion -> addition -// againnst -> against -// aganist -> against -// aggreed -> agreed -// agianst -> against -// ahppn -> happen -// allign -> align -// anytying -> anything // aquire -> acquire -// availabe -> available -// availaible -> available -// availalbe -> available -// availble -> available -// availiable -> available -// avalable -> available -// avaliable -> available -// avilable -> available -// bandwith -> bandwidth -// begginer -> beginner -// beleif -> belief -// beleive -> believe -// belive -> believe -// breif -> brief -// burried -> buried -// caluclate -> calculate -// caluculate -> calculate -// calulate -> calculate -// catagory -> category +// becuase -> because // cauhgt -> caught -// ceratin -> certain -// certian -> certain // cheif -> chief +// choosen -> chosen // cieling -> ceiling -// circut -> circuit -// clasic -> classic -// cmoputer -> computer -// coform -> conform -// comming: -> coming -// considerd -> considered +// collegue -> colleague +// concensus -> consensus +// contians -> contains +// cosnt -> const // dervied -> derived -// desicion -> decision -// diferent -> different -// diferrent -> different -// differnt -> different -// diffrent -> different -// divison -> division -// effecient -> efficient -// eligable -> eligible -// elpased -> elapsed -// embarass -> embarrass -// embeded -> embedded -// encypt -> encrypt -// finaly -> finally -// foriegn -> foreign +// dosen't -> doesn't +// fales -> false +// fasle -> false +// fitler -> filter +// flase -> false // foward -> forward -// fraciton -> fraction -// fucntion -> function -// fufill -> fulfill -// fullfill -> fulfill -// futher -> further -// ganerate -> generate -// generaly -> generally -// greatful -> grateful -// heigher -> higher -// higest -> highest -// howver -> however -// hydogen -> hydrogen -// importamt -> important +// frequecy -> frequency +// gaurantee -> guarantee +// guaratee -> guarantee +// heigth -> height +// heirarchy -> hierarchy // inclued -> include -// insted -> instead -// intrest -> interest +// interator -> iterator +// intput -> input // invliad -> invalid -// largst -> largest -// learnign -> learning +// lenght -> length // liasion -> liaison -// likly -> likely -// lisense -> license +// libary -> library // listner -> listener -// macthing -> matching +// looses: -> loses +// looup -> lookup // manefist -> manifest -// mesage -> message -// naturual -> natural +// namesapce -> namespace +// namespcae -> namespace // occassion -> occasion // occured -> occurred -// particualr -> particular -// paticular -> particular -// peice -> piece -// perhasp -> perhaps -// perheaps -> perhaps -// perhpas -> perhaps -// perphas -> perhaps -// persue -> pursue -// posess -> possess +// ouptut -> output +// ouput -> output +// overide -> override // postion -> position -// preiod -> period -// primarly -> primarily -// privte -> private -// proccess -> process -// proeprty -> property -// propery -> property -// realtion -> relation -// reasearch -> research -// recuring -> recurring +// priviledge -> privilege +// psuedo -> pseudo +// recieve -> receive // refered -> referred -// regluar -> regular -// releated -> related -// resutl -> result +// relevent -> relevant +// repitition -> repetition // reuslt -> result -// reveiw -> review -// satisifed -> satisfied -// scheduel -> schedule -// sequnce -> sequence -// similiar -> similar -// simmilar -> similar -// slighly -> slightly -// somehwat -> somewhat -// statment -> statement -// sucess -> success -// succsess -> success -// sugest -> suggest -// sumary -> summary -// supress -> suppress -// surpress -> suppress +// retrun -> return +// retun -> return +// reutrn -> return +// saftey -> safety +// seperate -> separate +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch // thresold -> threshold -// tongiht -> tonight -// tranpose -> transpose -// typcial -> typical // udpate -> update -// ususally -> usually -// verticies -> vertices -// whereever -> wherever -// wherre -> where -// wierd -> weird +// widht -> width -#define AUTOCORRECT_MIN_LENGTH 5 // "abotu" -#define AUTOCORRECT_MAX_LENGTH 10 // "auxilliary" -#define DICTIONARY_SIZE 5967 +#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" +#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" +#define DICTIONARY_SIZE 1120 static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { - 0x6C, 0x43, 0x00, 0x04, 0xD4, 0x00, 0x06, 0xEC, 0x00, 0x07, 0x64, 0x01, 0x08, 0x0F, 0x03, 0x09, - 0xA9, 0x08, 0x0A, 0xCC, 0x08, 0x0B, 0x44, 0x09, 0x0C, 0xF6, 0x09, 0x0E, 0x00, 0x0A, 0x0F, 0x1C, - 0x0A, 0x10, 0x4F, 0x0B, 0x11, 0x81, 0x0B, 0x12, 0xAF, 0x0D, 0x13, 0xE3, 0x0D, 0x15, 0xFD, 0x0D, - 0x16, 0xC2, 0x0F, 0x17, 0x79, 0x11, 0x18, 0xC9, 0x14, 0x19, 0xD2, 0x14, 0x1A, 0x08, 0x15, 0x1C, - 0x22, 0x15, 0x00, 0x47, 0x59, 0x00, 0x08, 0x63, 0x00, 0x0A, 0x82, 0x00, 0x12, 0x8E, 0x00, 0x16, - 0x98, 0x00, 0x17, 0xA3, 0x00, 0x18, 0xCA, 0x00, 0x00, 0x16, 0x08, 0x18, 0x2C, 0x00, 0x83, 0x73, - 0x65, 0x64, 0x00, 0x4B, 0x6A, 0x00, 0x17, 0x73, 0x00, 0x00, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, - 0x00, 0x84, 0x00, 0x0C, 0x15, 0x1A, 0x1C, 0x13, 0x12, 0x06, 0x00, 0x85, 0x72, 0x69, 0x67, 0x68, - 0x74, 0x00, 0x11, 0x0C, 0x10, 0x10, 0x12, 0x06, 0x00, 0x84, 0x69, 0x6E, 0x67, 0x00, 0x0F, 0x16, - 0x04, 0x2C, 0x00, 0x83, 0x6C, 0x73, 0x6F, 0x00, 0x08, 0x16, 0x12, 0x12, 0x0F, 0x00, 0x84, 0x73, - 0x65, 0x73, 0x00, 0x4C, 0xAD, 0x00, 0x12, 0xB7, 0x00, 0x18, 0xC1, 0x00, 0x00, 0x15, 0x06, 0x12, - 0x13, 0x1C, 0x0B, 0x00, 0x80, 0x65, 0x00, 0x0F, 0x04, 0x2C, 0x00, 0x83, 0x20, 0x6C, 0x6F, 0x74, - 0x00, 0x16, 0x0D, 0x2C, 0x00, 0x83, 0x75, 0x73, 0x74, 0x00, 0x17, 0x16, 0x0D, 0x2C, 0x00, 0x83, - 0x75, 0x73, 0x74, 0x00, 0x57, 0xDB, 0x00, 0x1C, 0xE4, 0x00, 0x00, 0x18, 0x12, 0x05, 0x04, 0x00, - 0x80, 0x20, 0x61, 0x00, 0x07, 0x12, 0x17, 0x00, 0x81, 0x61, 0x79, 0x00, 0x4B, 0xF6, 0x00, 0x0C, - 0x1C, 0x01, 0x0E, 0x5C, 0x01, 0x00, 0x4C, 0xFD, 0x00, 0x17, 0x14, 0x01, 0x00, 0x4B, 0x04, 0x01, - 0x1A, 0x0A, 0x01, 0x00, 0x1A, 0x00, 0x81, 0x63, 0x68, 0x00, 0x0B, 0x2C, 0x00, 0x84, 0x77, 0x68, - 0x69, 0x63, 0x68, 0x00, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, 0x00, 0x50, 0x29, 0x01, 0x15, - 0x35, 0x01, 0x16, 0x43, 0x01, 0x17, 0x4C, 0x01, 0x00, 0x11, 0x04, 0x1C, 0x07, 0x00, 0x84, 0x6E, - 0x61, 0x6D, 0x69, 0x63, 0x00, 0x17, 0x08, 0x10, 0x1C, 0x16, 0x00, 0x84, 0x6D, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x00, 0x04, 0x0F, 0x06, 0x00, 0x81, 0x73, 0x69, 0x63, 0x00, 0x08, 0x0B, 0x17, 0x16, - 0x04, 0x00, 0x86, 0x65, 0x73, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x00, 0x08, 0x0B, 0x06, 0x00, - 0x81, 0x63, 0x6B, 0x00, 0x44, 0x7A, 0x01, 0x08, 0x86, 0x01, 0x0F, 0x54, 0x02, 0x11, 0x7C, 0x02, - 0x12, 0xB4, 0x02, 0x15, 0xCF, 0x02, 0x18, 0x07, 0x03, 0x00, 0x0C, 0x0F, 0x19, 0x11, 0x0C, 0x00, - 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x46, 0xA8, 0x01, 0x07, 0xB2, 0x01, 0x08, 0xBC, 0x01, 0x09, - 0xC7, 0x01, 0x0A, 0xD4, 0x01, 0x0C, 0xDE, 0x01, 0x13, 0xF8, 0x01, 0x15, 0x03, 0x02, 0x16, 0x26, - 0x02, 0x17, 0x32, 0x02, 0x18, 0x4B, 0x02, 0x00, 0x0C, 0x19, 0x07, 0x04, 0x00, 0x82, 0x73, 0x65, - 0x64, 0x00, 0x08, 0x05, 0x10, 0x08, 0x00, 0x81, 0x64, 0x65, 0x64, 0x00, 0x15, 0x0A, 0x0A, 0x04, - 0x00, 0x84, 0x72, 0x65, 0x65, 0x64, 0x00, 0x0C, 0x16, 0x0C, 0x17, 0x04, 0x16, 0x00, 0x83, 0x66, - 0x69, 0x65, 0x64, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, 0x00, 0x55, 0xE5, - 0x01, 0x19, 0xEE, 0x01, 0x00, 0x15, 0x18, 0x05, 0x00, 0x83, 0x69, 0x65, 0x64, 0x00, 0x15, 0x08, - 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x16, 0x04, 0x0F, 0x08, 0x00, 0x83, 0x70, 0x73, - 0x65, 0x64, 0x00, 0x48, 0x0D, 0x02, 0x0A, 0x16, 0x02, 0x18, 0x1D, 0x02, 0x00, 0x09, 0x08, 0x15, - 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x04, 0x2C, 0x00, 0x80, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, - 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x04, 0x13, 0x0F, 0x08, 0x00, 0x84, 0x61, 0x70, 0x73, 0x65, - 0x64, 0x00, 0x44, 0x39, 0x02, 0x16, 0x44, 0x02, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x84, 0x61, - 0x74, 0x65, 0x64, 0x00, 0x11, 0x0C, 0x00, 0x80, 0x61, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, - 0x81, 0x64, 0x65, 0x00, 0x4C, 0x5B, 0x02, 0x12, 0x70, 0x02, 0x00, 0x08, 0x00, 0x49, 0x64, 0x02, - 0x1C, 0x6A, 0x02, 0x00, 0x83, 0x69, 0x65, 0x6C, 0x64, 0x00, 0x83, 0x69, 0x65, 0x6C, 0x64, 0x00, - 0x16, 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x48, 0x86, 0x02, 0x0C, - 0x91, 0x02, 0x18, 0x9B, 0x02, 0x00, 0x15, 0x0C, 0x09, 0x00, 0x84, 0x72, 0x69, 0x65, 0x6E, 0x64, - 0x00, 0x08, 0x15, 0x09, 0x00, 0x83, 0x69, 0x65, 0x6E, 0x64, 0x00, 0x52, 0xA2, 0x02, 0x15, 0xAC, - 0x02, 0x00, 0x15, 0x15, 0x04, 0x00, 0x84, 0x6F, 0x75, 0x6E, 0x64, 0x00, 0x04, 0x00, 0x82, 0x6F, - 0x75, 0x6E, 0x64, 0x00, 0x4C, 0xBB, 0x02, 0x15, 0xC6, 0x02, 0x00, 0x08, 0x15, 0x13, 0x00, 0x84, - 0x65, 0x72, 0x69, 0x6F, 0x64, 0x00, 0x06, 0x08, 0x15, 0x00, 0x82, 0x6F, 0x72, 0x64, 0x00, 0x44, - 0xD9, 0x02, 0x08, 0xE4, 0x02, 0x18, 0xFD, 0x02, 0x00, 0x1A, 0x12, 0x09, 0x00, 0x83, 0x72, 0x77, - 0x61, 0x72, 0x64, 0x00, 0x47, 0xEB, 0x02, 0x0C, 0xF5, 0x02, 0x00, 0x0C, 0x16, 0x11, 0x12, 0x06, - 0x00, 0x80, 0x65, 0x64, 0x00, 0x1A, 0x00, 0x83, 0x65, 0x69, 0x72, 0x64, 0x00, 0x04, 0x0A, 0x2C, - 0x00, 0x83, 0x75, 0x61, 0x72, 0x64, 0x00, 0x12, 0x15, 0x04, 0x00, 0x80, 0x6E, 0x64, 0x00, 0x44, - 0x43, 0x03, 0x05, 0x50, 0x03, 0x06, 0x7B, 0x03, 0x07, 0xFB, 0x03, 0x08, 0x17, 0x04, 0x0A, 0x6B, - 0x04, 0x0B, 0xE3, 0x04, 0x0C, 0x34, 0x05, 0x0F, 0x3D, 0x05, 0x11, 0x00, 0x06, 0x12, 0x1B, 0x06, - 0x13, 0x25, 0x06, 0x15, 0x2F, 0x06, 0x16, 0x9C, 0x06, 0x17, 0x52, 0x07, 0x18, 0x2D, 0x08, 0x19, - 0x73, 0x08, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, - 0x44, 0x57, 0x03, 0x0F, 0x61, 0x03, 0x00, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x80, 0x6C, 0x65, - 0x00, 0x44, 0x68, 0x03, 0x18, 0x73, 0x03, 0x00, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x82, 0x62, - 0x6C, 0x65, 0x00, 0x12, 0x07, 0x00, 0x82, 0x62, 0x6C, 0x65, 0x00, 0x48, 0x88, 0x03, 0x0C, 0x93, - 0x03, 0x11, 0x9C, 0x03, 0x13, 0xEE, 0x03, 0x00, 0x15, 0x08, 0x09, 0x08, 0x15, 0x00, 0x81, 0x6E, - 0x63, 0x65, 0x00, 0x08, 0x13, 0x00, 0x83, 0x69, 0x65, 0x63, 0x65, 0x00, 0x44, 0xA6, 0x03, 0x08, - 0xB3, 0x03, 0x18, 0xE4, 0x03, 0x00, 0x17, 0x08, 0x13, 0x10, 0x12, 0x06, 0x00, 0x83, 0x65, 0x6E, - 0x63, 0x65, 0x00, 0x55, 0xBA, 0x03, 0x17, 0xD9, 0x03, 0x00, 0x08, 0x00, 0x49, 0xC3, 0x03, 0x0F, - 0xD0, 0x03, 0x00, 0x15, 0x2C, 0x00, 0x86, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x63, 0x65, 0x00, - 0x12, 0x17, 0x00, 0x83, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x11, 0x0C, 0x04, 0x10, 0x00, 0x81, 0x61, - 0x6E, 0x63, 0x65, 0x00, 0x14, 0x08, 0x16, 0x00, 0x82, 0x65, 0x6E, 0x63, 0x65, 0x00, 0x04, 0x16, - 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x00, - 0x52, 0x07, 0x04, 0x19, 0x0D, 0x04, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, 0x12, 0x00, 0x85, - 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x00, 0x17, 0x00, 0x44, 0x26, 0x04, 0x0C, 0x31, 0x04, 0x11, - 0x3B, 0x04, 0x17, 0x5E, 0x04, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, 0x74, 0x65, 0x65, - 0x00, 0x10, 0x10, 0x12, 0x06, 0x00, 0x81, 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x00, 0x44, 0x45, - 0x04, 0x18, 0x51, 0x04, 0x00, 0x0A, 0x00, 0x86, 0x75, 0x61, 0x72, 0x61, 0x6E, 0x74, 0x65, 0x65, - 0x00, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, 0x74, 0x65, 0x65, 0x00, 0x0C, 0x10, - 0x12, 0x06, 0x00, 0x84, 0x6D, 0x69, 0x74, 0x74, 0x65, 0x65, 0x00, 0x44, 0x75, 0x04, 0x07, 0xB8, - 0x04, 0x10, 0xDA, 0x04, 0x00, 0x4A, 0x82, 0x04, 0x11, 0x8D, 0x04, 0x16, 0x96, 0x04, 0x18, 0x9F, - 0x04, 0x00, 0x15, 0x12, 0x10, 0x00, 0x83, 0x74, 0x67, 0x61, 0x67, 0x65, 0x00, 0x0B, 0x06, 0x00, - 0x83, 0x61, 0x6E, 0x67, 0x65, 0x00, 0x08, 0x10, 0x00, 0x82, 0x73, 0x61, 0x67, 0x65, 0x00, 0x0A, - 0x00, 0x6C, 0xA8, 0x04, 0x04, 0xAE, 0x04, 0x00, 0x83, 0x61, 0x75, 0x67, 0x65, 0x00, 0x0F, 0x00, - 0x84, 0x6E, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x00, 0x44, 0xC5, 0x04, 0x0C, 0xCB, - 0x04, 0x0F, 0xD4, 0x04, 0x00, 0x83, 0x6C, 0x65, 0x67, 0x65, 0x00, 0x19, 0x0C, 0x15, 0x13, 0x00, - 0x82, 0x67, 0x65, 0x00, 0x04, 0x00, 0x82, 0x67, 0x65, 0x00, 0x04, 0x0C, 0x00, 0x83, 0x6D, 0x61, - 0x67, 0x65, 0x00, 0x17, 0x00, 0x47, 0xF5, 0x04, 0x10, 0xFF, 0x04, 0x12, 0x09, 0x05, 0x16, 0x12, - 0x05, 0x17, 0x1B, 0x05, 0x00, 0x11, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x12, - 0x15, 0x09, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x17, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, - 0x65, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x44, 0x22, 0x05, 0x18, 0x2A, - 0x05, 0x00, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x12, 0x05, 0x04, 0x00, 0x82, 0x20, - 0x74, 0x68, 0x65, 0x00, 0x1D, 0x16, 0x2C, 0x00, 0x82, 0x69, 0x7A, 0x65, 0x00, 0x45, 0x4D, 0x05, - 0x0C, 0xBE, 0x05, 0x13, 0xC9, 0x05, 0x16, 0xF1, 0x05, 0x19, 0xF9, 0x05, 0x00, 0x44, 0x57, 0x05, - 0x0C, 0xA7, 0x05, 0x0F, 0xB3, 0x05, 0x00, 0x4A, 0x61, 0x05, 0x0C, 0x6B, 0x05, 0x0F, 0x89, 0x05, - 0x00, 0x0C, 0x0F, 0x08, 0x00, 0x83, 0x69, 0x62, 0x6C, 0x65, 0x00, 0x0F, 0x00, 0x44, 0x74, 0x05, - 0x0C, 0x7F, 0x05, 0x00, 0x19, 0x04, 0x00, 0x85, 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x04, - 0x19, 0x04, 0x00, 0x84, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x44, 0x90, 0x05, 0x0C, 0x9B, 0x05, 0x00, - 0x19, 0x04, 0x00, 0x84, 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x19, 0x04, 0x00, 0x85, 0x61, - 0x69, 0x6C, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x04, 0x0F, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x83, 0x62, - 0x6C, 0x65, 0x00, 0x0C, 0x04, 0x19, 0x04, 0x00, 0x82, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x1A, 0x0B, - 0x2C, 0x00, 0x84, 0x77, 0x68, 0x69, 0x6C, 0x65, 0x00, 0x44, 0xD3, 0x05, 0x08, 0xDC, 0x05, 0x12, - 0xE6, 0x05, 0x00, 0x08, 0x13, 0x00, 0x83, 0x6F, 0x70, 0x6C, 0x65, 0x00, 0x12, 0x13, 0x00, 0x84, - 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x00, 0x08, 0x12, 0x13, 0x00, 0x85, 0x65, 0x6F, 0x70, 0x6C, 0x65, - 0x00, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x08, 0x0F, 0x00, 0x81, 0x65, 0x6C, 0x00, - 0x46, 0x07, 0x06, 0x0C, 0x10, 0x06, 0x00, 0x0C, 0x16, 0x2C, 0x00, 0x82, 0x6E, 0x63, 0x65, 0x00, - 0x08, 0x0A, 0x1C, 0x0B, 0x00, 0x83, 0x69, 0x65, 0x6E, 0x65, 0x00, 0x16, 0x0B, 0x17, 0x2C, 0x00, - 0x82, 0x6F, 0x73, 0x65, 0x00, 0x0F, 0x12, 0x08, 0x13, 0x00, 0x82, 0x70, 0x6C, 0x65, 0x00, 0x46, - 0x42, 0x06, 0x08, 0x4C, 0x06, 0x0C, 0x57, 0x06, 0x12, 0x63, 0x06, 0x15, 0x7F, 0x06, 0x18, 0x86, - 0x06, 0x00, 0x12, 0x16, 0x2C, 0x00, 0x83, 0x63, 0x6F, 0x72, 0x65, 0x00, 0x17, 0x0B, 0x2C, 0x00, - 0x84, 0x74, 0x68, 0x65, 0x72, 0x65, 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x00, 0x47, 0x6A, 0x06, 0x09, 0x73, 0x06, 0x00, 0x08, 0x05, 0x00, 0x83, 0x66, 0x6F, - 0x72, 0x65, 0x00, 0x15, 0x08, 0x0B, 0x17, 0x00, 0x83, 0x65, 0x66, 0x6F, 0x72, 0x65, 0x00, 0x08, - 0x0B, 0x1A, 0x00, 0x81, 0x65, 0x00, 0x17, 0x00, 0x6C, 0x8F, 0x06, 0x04, 0x94, 0x06, 0x00, 0x82, - 0x72, 0x75, 0x65, 0x00, 0x10, 0x04, 0x00, 0x82, 0x65, 0x75, 0x72, 0x00, 0x44, 0xB2, 0x06, 0x08, - 0xCB, 0x06, 0x0C, 0xD3, 0x06, 0x0F, 0xE2, 0x06, 0x11, 0xEB, 0x06, 0x12, 0x09, 0x07, 0x18, 0x16, - 0x07, 0x00, 0x4F, 0xB9, 0x06, 0x18, 0xC1, 0x06, 0x00, 0x09, 0x00, 0x83, 0x61, 0x6C, 0x73, 0x65, - 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, 0x08, 0x0B, 0x17, 0x00, 0x82, - 0x73, 0x65, 0x00, 0x06, 0x15, 0x08, 0x06, 0x1B, 0x08, 0x00, 0x86, 0x65, 0x72, 0x63, 0x69, 0x73, - 0x65, 0x00, 0x0C, 0x04, 0x09, 0x00, 0x83, 0x6C, 0x73, 0x65, 0x00, 0x48, 0xF2, 0x06, 0x12, 0xFD, - 0x06, 0x00, 0x16, 0x0C, 0x0F, 0x00, 0x84, 0x63, 0x65, 0x6E, 0x73, 0x65, 0x00, 0x13, 0x08, 0x15, - 0x00, 0x84, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x00, 0x13, 0x11, 0x04, 0x15, 0x17, 0x00, 0x83, - 0x73, 0x70, 0x6F, 0x73, 0x65, 0x00, 0x44, 0x20, 0x07, 0x06, 0x3D, 0x07, 0x12, 0x48, 0x07, 0x00, - 0x46, 0x27, 0x07, 0x08, 0x31, 0x07, 0x00, 0x06, 0x08, 0x05, 0x00, 0x84, 0x61, 0x75, 0x73, 0x65, - 0x00, 0x06, 0x04, 0x05, 0x00, 0x86, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x00, 0x04, 0x08, 0x05, - 0x00, 0x84, 0x63, 0x61, 0x75, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, - 0x65, 0x00, 0x44, 0x5F, 0x07, 0x08, 0x0D, 0x08, 0x0F, 0x18, 0x08, 0x19, 0x24, 0x08, 0x00, 0x47, - 0x6F, 0x07, 0x0A, 0x94, 0x07, 0x0F, 0xA1, 0x07, 0x13, 0xE4, 0x07, 0x15, 0xEE, 0x07, 0x00, 0x12, - 0x10, 0x00, 0x50, 0x79, 0x07, 0x12, 0x88, 0x07, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, - 0x6D, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, - 0x61, 0x74, 0x65, 0x00, 0x12, 0x13, 0x12, 0x15, 0x13, 0x00, 0x84, 0x61, 0x67, 0x61, 0x74, 0x65, - 0x00, 0x46, 0xAB, 0x07, 0x13, 0xB8, 0x07, 0x18, 0xC5, 0x07, 0x00, 0x18, 0x0F, 0x04, 0x06, 0x00, - 0x85, 0x63, 0x75, 0x6C, 0x61, 0x74, 0x65, 0x00, 0x10, 0x04, 0x08, 0x17, 0x00, 0x86, 0x6D, 0x70, - 0x6C, 0x61, 0x74, 0x65, 0x00, 0x46, 0xCC, 0x07, 0x0F, 0xD9, 0x07, 0x00, 0x18, 0x0F, 0x04, 0x06, - 0x00, 0x86, 0x63, 0x75, 0x6C, 0x61, 0x74, 0x65, 0x00, 0x04, 0x06, 0x00, 0x84, 0x63, 0x75, 0x6C, - 0x61, 0x74, 0x65, 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x48, 0xF5, - 0x07, 0x18, 0x02, 0x08, 0x00, 0x11, 0x04, 0x0A, 0x00, 0x86, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x00, 0x06, 0x04, 0x00, 0x84, 0x63, 0x75, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0F, 0x0F, 0x04, - 0x13, 0x00, 0x83, 0x65, 0x74, 0x74, 0x65, 0x00, 0x04, 0x13, 0x10, 0x08, 0x17, 0x00, 0x83, 0x6C, - 0x61, 0x74, 0x65, 0x00, 0x0C, 0x15, 0x13, 0x00, 0x81, 0x61, 0x74, 0x65, 0x00, 0x4A, 0x37, 0x08, - 0x0C, 0x43, 0x08, 0x16, 0x4D, 0x08, 0x00, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, 0x67, - 0x75, 0x65, 0x00, 0x14, 0x11, 0x18, 0x00, 0x83, 0x69, 0x71, 0x75, 0x65, 0x00, 0x44, 0x54, 0x08, - 0x15, 0x69, 0x08, 0x00, 0x06, 0x00, 0x6C, 0x5D, 0x08, 0x08, 0x62, 0x08, 0x00, 0x82, 0x75, 0x73, - 0x65, 0x00, 0x05, 0x00, 0x82, 0x75, 0x73, 0x65, 0x00, 0x08, 0x13, 0x00, 0x84, 0x75, 0x72, 0x73, - 0x75, 0x65, 0x00, 0x4C, 0x7A, 0x08, 0x12, 0x93, 0x08, 0x00, 0x48, 0x81, 0x08, 0x0F, 0x8B, 0x08, - 0x00, 0x0F, 0x08, 0x05, 0x00, 0x83, 0x69, 0x65, 0x76, 0x65, 0x00, 0x08, 0x05, 0x00, 0x81, 0x65, - 0x76, 0x65, 0x00, 0x52, 0x9A, 0x08, 0x19, 0xA1, 0x08, 0x00, 0x15, 0x13, 0x00, 0x82, 0x76, 0x65, - 0x00, 0x05, 0x04, 0x00, 0x83, 0x6F, 0x76, 0x65, 0x00, 0x0C, 0x08, 0x00, 0x4B, 0xB6, 0x08, 0x0F, - 0xBD, 0x08, 0x15, 0xC5, 0x08, 0x00, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x08, 0x05, 0x00, - 0x82, 0x69, 0x65, 0x66, 0x00, 0x05, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x4C, 0xD3, 0x08, 0x11, - 0xDD, 0x08, 0x00, 0x11, 0x12, 0x0A, 0x2C, 0x00, 0x82, 0x69, 0x6E, 0x67, 0x00, 0x4C, 0xE4, 0x08, - 0x15, 0x3A, 0x09, 0x00, 0x48, 0xF4, 0x08, 0x0B, 0x0B, 0x09, 0x0F, 0x18, 0x09, 0x15, 0x24, 0x09, - 0x1C, 0x2F, 0x09, 0x00, 0x48, 0xFB, 0x08, 0x0B, 0x02, 0x09, 0x00, 0x05, 0x00, 0x83, 0x69, 0x6E, - 0x67, 0x00, 0x06, 0x04, 0x06, 0x00, 0x83, 0x69, 0x6E, 0x67, 0x00, 0x17, 0x06, 0x04, 0x10, 0x00, - 0x85, 0x74, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, - 0x69, 0x6E, 0x67, 0x00, 0x18, 0x06, 0x08, 0x15, 0x00, 0x82, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x17, - 0x1C, 0x11, 0x04, 0x00, 0x83, 0x68, 0x69, 0x6E, 0x67, 0x00, 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, - 0x69, 0x6E, 0x67, 0x00, 0x46, 0x57, 0x09, 0x08, 0x8E, 0x09, 0x0A, 0x9A, 0x09, 0x0C, 0xA4, 0x09, - 0x16, 0xAD, 0x09, 0x17, 0xBF, 0x09, 0x00, 0x4B, 0x64, 0x09, 0x0C, 0x6D, 0x09, 0x0F, 0x77, 0x09, - 0x15, 0x7F, 0x09, 0x00, 0x0C, 0x1A, 0x00, 0x83, 0x68, 0x69, 0x63, 0x68, 0x00, 0x17, 0x1A, 0x16, - 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0B, 0x1A, 0x00, 0x82, 0x69, 0x63, 0x68, 0x00, 0x04, - 0x08, 0x16, 0x04, 0x08, 0x15, 0x00, 0x86, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x00, 0x17, 0x07, - 0x11, 0x04, 0x2C, 0x00, 0x82, 0x20, 0x74, 0x68, 0x65, 0x00, 0x11, 0x08, 0x15, 0x17, 0x16, 0x00, - 0x80, 0x74, 0x68, 0x00, 0x06, 0x0B, 0x1A, 0x00, 0x82, 0x69, 0x63, 0x68, 0x00, 0x0C, 0x0F, 0x13, - 0x10, 0x12, 0x06, 0x04, 0x00, 0x86, 0x63, 0x6F, 0x6D, 0x70, 0x6C, 0x69, 0x73, 0x68, 0x00, 0x4A, - 0xC9, 0x09, 0x0C, 0xE1, 0x09, 0x15, 0xEC, 0x09, 0x00, 0x48, 0xD0, 0x09, 0x0C, 0xDA, 0x09, 0x00, - 0x15, 0x17, 0x16, 0x00, 0x82, 0x6E, 0x67, 0x74, 0x68, 0x00, 0x08, 0x0B, 0x00, 0x81, 0x68, 0x74, - 0x00, 0x1A, 0x07, 0x11, 0x04, 0x05, 0x00, 0x81, 0x64, 0x74, 0x68, 0x00, 0x18, 0x17, 0x2C, 0x00, - 0x83, 0x72, 0x75, 0x74, 0x68, 0x00, 0x15, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x81, 0x69, 0x72, 0x00, - 0x11, 0x00, 0x4C, 0x09, 0x0A, 0x18, 0x14, 0x0A, 0x00, 0x17, 0x0B, 0x2C, 0x00, 0x84, 0x74, 0x68, - 0x69, 0x6E, 0x6B, 0x00, 0x0C, 0x0B, 0x17, 0x00, 0x82, 0x6E, 0x6B, 0x00, 0x44, 0x32, 0x0A, 0x07, - 0x86, 0x0A, 0x08, 0xB1, 0x0A, 0x09, 0x11, 0x0B, 0x0F, 0x1A, 0x0B, 0x17, 0x37, 0x0B, 0x18, 0x40, - 0x0B, 0x00, 0x4C, 0x3C, 0x0A, 0x17, 0x47, 0x0A, 0x18, 0x60, 0x0A, 0x00, 0x06, 0x13, 0x1C, 0x17, - 0x00, 0x83, 0x69, 0x63, 0x61, 0x6C, 0x00, 0x4C, 0x4E, 0x0A, 0x18, 0x56, 0x0A, 0x00, 0x11, 0x0C, - 0x00, 0x81, 0x69, 0x61, 0x6C, 0x00, 0x15, 0x0C, 0x19, 0x00, 0x83, 0x74, 0x75, 0x61, 0x6C, 0x00, - 0x51, 0x6A, 0x0A, 0x15, 0x73, 0x0A, 0x17, 0x7C, 0x0A, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x6E, 0x75, - 0x61, 0x6C, 0x00, 0x18, 0x17, 0x04, 0x11, 0x00, 0x82, 0x61, 0x6C, 0x00, 0x0C, 0x19, 0x00, 0x83, - 0x72, 0x74, 0x75, 0x61, 0x6C, 0x00, 0x18, 0x00, 0x52, 0x8F, 0x0A, 0x1A, 0xA7, 0x0A, 0x00, 0x46, - 0x99, 0x0A, 0x0B, 0x9D, 0x0A, 0x1A, 0xA3, 0x0A, 0x00, 0x81, 0x6C, 0x64, 0x00, 0x16, 0x00, 0x81, - 0x6C, 0x64, 0x00, 0x81, 0x6C, 0x64, 0x00, 0x12, 0x2C, 0x00, 0x84, 0x77, 0x6F, 0x75, 0x6C, 0x64, - 0x00, 0x4A, 0xC1, 0x0A, 0x0F, 0xC9, 0x0A, 0x13, 0xF7, 0x0A, 0x17, 0xFF, 0x0A, 0x18, 0x07, 0x0B, - 0x00, 0x11, 0x0C, 0x16, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x44, 0xD0, 0x0A, 0x0F, 0xEA, 0x0A, 0x00, - 0x15, 0x00, 0x44, 0xD9, 0x0A, 0x15, 0xE0, 0x0A, 0x00, 0x13, 0x00, 0x81, 0x6C, 0x65, 0x6C, 0x00, - 0x04, 0x13, 0x00, 0x84, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x00, 0x04, 0x15, 0x15, 0x04, 0x13, 0x00, - 0x85, 0x61, 0x6C, 0x6C, 0x65, 0x6C, 0x00, 0x12, 0x08, 0x13, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x17, - 0x0C, 0x0F, 0x00, 0x81, 0x6C, 0x65, 0x00, 0x07, 0x08, 0x0B, 0x06, 0x16, 0x00, 0x81, 0x6C, 0x65, - 0x00, 0x08, 0x16, 0x1C, 0x10, 0x00, 0x81, 0x6C, 0x66, 0x00, 0x0C, 0x09, 0x00, 0x4F, 0x24, 0x0B, - 0x18, 0x2E, 0x0B, 0x00, 0x0F, 0x18, 0x09, 0x00, 0x84, 0x66, 0x69, 0x6C, 0x6C, 0x00, 0x09, 0x00, - 0x83, 0x6C, 0x66, 0x69, 0x6C, 0x6C, 0x00, 0x18, 0x16, 0x08, 0x15, 0x00, 0x81, 0x6C, 0x74, 0x00, - 0x09, 0x17, 0x04, 0x08, 0x15, 0x0A, 0x00, 0x85, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6C, 0x00, 0x44, - 0x59, 0x0B, 0x0F, 0x6A, 0x0B, 0x15, 0x75, 0x0B, 0x00, 0x15, 0x0A, 0x12, 0x17, 0x06, 0x08, 0x13, - 0x16, 0x00, 0x84, 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x00, 0x08, 0x05, 0x12, 0x15, 0x13, 0x00, - 0x82, 0x6C, 0x65, 0x6D, 0x00, 0x12, 0x09, 0x12, 0x06, 0x00, 0x83, 0x6E, 0x66, 0x6F, 0x72, 0x6D, - 0x00, 0x44, 0xA6, 0x0B, 0x07, 0xCE, 0x0B, 0x08, 0xD7, 0x0B, 0x0A, 0x3A, 0x0C, 0x0C, 0x8D, 0x0C, - 0x0E, 0x99, 0x0C, 0x12, 0xC0, 0x0C, 0x13, 0x6C, 0x0D, 0x15, 0x78, 0x0D, 0x16, 0x83, 0x0D, 0x18, - 0x8D, 0x0D, 0x1A, 0xA4, 0x0D, 0x00, 0x0C, 0x00, 0x4A, 0xAF, 0x0B, 0x17, 0xB7, 0x0B, 0x00, 0x04, - 0x2C, 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x51, 0xBE, 0x0B, 0x15, 0xC6, 0x0B, 0x00, 0x12, 0x06, - 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x08, 0x06, 0x00, 0x82, 0x61, 0x69, 0x6E, 0x00, 0x18, 0x12, - 0x09, 0x2C, 0x00, 0x81, 0x6E, 0x64, 0x00, 0x47, 0xE7, 0x0B, 0x08, 0xF1, 0x0B, 0x0A, 0x1B, 0x0C, - 0x13, 0x27, 0x0C, 0x16, 0x30, 0x0C, 0x00, 0x0F, 0x0C, 0x0B, 0x06, 0x00, 0x81, 0x72, 0x65, 0x6E, - 0x00, 0x57, 0xF8, 0x0B, 0x1A, 0x11, 0x0C, 0x00, 0x48, 0xFF, 0x0B, 0x1A, 0x07, 0x0C, 0x00, 0x05, - 0x00, 0x82, 0x77, 0x65, 0x65, 0x6E, 0x00, 0x08, 0x05, 0x00, 0x84, 0x74, 0x77, 0x65, 0x65, 0x6E, - 0x00, 0x08, 0x05, 0x00, 0x83, 0x74, 0x77, 0x65, 0x65, 0x6E, 0x00, 0x12, 0x07, 0x1C, 0x0B, 0x00, - 0x83, 0x72, 0x6F, 0x67, 0x65, 0x6E, 0x00, 0x04, 0x0B, 0x2C, 0x00, 0x81, 0x70, 0x65, 0x6E, 0x00, - 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, 0x48, 0x41, 0x0C, 0x0C, 0x4C, 0x0C, - 0x00, 0x0C, 0x15, 0x12, 0x09, 0x00, 0x83, 0x65, 0x69, 0x67, 0x6E, 0x00, 0x4B, 0x5F, 0x0C, 0x0F, - 0x65, 0x0C, 0x11, 0x6D, 0x0C, 0x12, 0x76, 0x0C, 0x15, 0x7D, 0x0C, 0x16, 0x84, 0x0C, 0x00, 0x17, - 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0F, 0x04, 0x00, 0x83, 0x69, 0x67, 0x6E, 0x00, 0x15, 0x04, 0x08, - 0x0F, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0A, 0x2C, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x17, 0x16, 0x00, - 0x81, 0x6E, 0x67, 0x00, 0x04, 0x2C, 0x00, 0x82, 0x73, 0x69, 0x67, 0x6E, 0x00, 0x17, 0x04, 0x15, - 0x08, 0x06, 0x00, 0x83, 0x74, 0x61, 0x69, 0x6E, 0x00, 0x4B, 0xA0, 0x0C, 0x0C, 0xA9, 0x0C, 0x00, - 0x0C, 0x17, 0x00, 0x83, 0x68, 0x69, 0x6E, 0x6B, 0x00, 0x4B, 0xB0, 0x0C, 0x17, 0xB6, 0x0C, 0x00, - 0x17, 0x00, 0x81, 0x6E, 0x6B, 0x00, 0x0B, 0x2C, 0x00, 0x84, 0x74, 0x68, 0x69, 0x6E, 0x6B, 0x00, - 0x4C, 0xCA, 0x0C, 0x16, 0x56, 0x0D, 0x17, 0x60, 0x0D, 0x00, 0x46, 0xD4, 0x0C, 0x16, 0xE1, 0x0C, - 0x17, 0xFB, 0x0C, 0x00, 0x0C, 0x16, 0x08, 0x07, 0x00, 0x85, 0x63, 0x69, 0x73, 0x69, 0x6F, 0x6E, - 0x00, 0x44, 0xE8, 0x0C, 0x16, 0xF1, 0x0C, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, 0x6E, - 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x44, 0x0E, 0x0D, 0x07, 0x1B, - 0x0D, 0x0C, 0x25, 0x0D, 0x0F, 0x34, 0x0D, 0x11, 0x40, 0x0D, 0x16, 0x4C, 0x0D, 0x00, 0x15, 0x08, - 0x05, 0x04, 0x00, 0x84, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x07, 0x04, 0x00, 0x83, 0x69, - 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, - 0x69, 0x6F, 0x6E, 0x00, 0x04, 0x08, 0x15, 0x00, 0x85, 0x6C, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00, - 0x06, 0x18, 0x09, 0x00, 0x85, 0x6E, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, - 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x0C, 0x19, 0x0C, 0x07, 0x00, 0x81, 0x69, 0x6F, 0x6E, 0x00, - 0x0C, 0x06, 0x04, 0x15, 0x09, 0x00, 0x83, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x13, 0x0B, 0x04, 0x00, - 0x84, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, 0x00, 0x83, 0x74, 0x75, - 0x72, 0x6E, 0x00, 0x0A, 0x0C, 0x0B, 0x17, 0x00, 0x82, 0x6E, 0x67, 0x73, 0x00, 0x55, 0x94, 0x0D, - 0x17, 0x9D, 0x0D, 0x00, 0x17, 0x08, 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, - 0x80, 0x72, 0x6E, 0x00, 0x12, 0x0E, 0x11, 0x18, 0x00, 0x82, 0x6E, 0x6F, 0x77, 0x6E, 0x00, 0x47, - 0xB9, 0x0D, 0x11, 0xC4, 0x0D, 0x1A, 0xCD, 0x0D, 0x00, 0x08, 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, - 0x75, 0x64, 0x6F, 0x00, 0x1A, 0x0E, 0x2C, 0x00, 0x82, 0x6E, 0x6F, 0x77, 0x00, 0x4F, 0xD4, 0x0D, - 0x11, 0xDC, 0x0D, 0x00, 0x0F, 0x12, 0x09, 0x00, 0x81, 0x6F, 0x77, 0x00, 0x0E, 0x2C, 0x00, 0x81, - 0x6F, 0x77, 0x00, 0x56, 0xEA, 0x0D, 0x18, 0xF4, 0x0D, 0x00, 0x04, 0x0B, 0x15, 0x08, 0x13, 0x00, - 0x81, 0x70, 0x73, 0x00, 0x12, 0x12, 0x0F, 0x00, 0x81, 0x6B, 0x75, 0x70, 0x00, 0x44, 0x1C, 0x0E, - 0x08, 0x5D, 0x0E, 0x0B, 0x67, 0x0F, 0x0F, 0x71, 0x0F, 0x12, 0x7F, 0x0F, 0x13, 0x90, 0x0F, 0x16, - 0x9B, 0x0F, 0x17, 0xA4, 0x0F, 0x18, 0xB0, 0x0F, 0x1C, 0xB9, 0x0F, 0x00, 0x4C, 0x26, 0x0E, 0x0F, - 0x30, 0x0E, 0x18, 0x52, 0x0E, 0x00, 0x0F, 0x0C, 0x10, 0x0C, 0x16, 0x00, 0x82, 0x61, 0x72, 0x00, - 0x4C, 0x37, 0x0E, 0x18, 0x42, 0x0E, 0x00, 0x10, 0x10, 0x0C, 0x16, 0x00, 0x84, 0x69, 0x6C, 0x61, - 0x72, 0x00, 0x06, 0x0C, 0x17, 0x04, 0x13, 0x00, 0x86, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6C, 0x61, - 0x72, 0x00, 0x0F, 0x0A, 0x08, 0x15, 0x00, 0x83, 0x75, 0x6C, 0x61, 0x72, 0x00, 0x44, 0x7C, 0x0E, - 0x07, 0x84, 0x0E, 0x0B, 0x91, 0x0E, 0x0C, 0xCB, 0x0E, 0x0F, 0xE5, 0x0E, 0x10, 0xEF, 0x0E, 0x11, - 0xF9, 0x0E, 0x12, 0x25, 0x0F, 0x17, 0x2D, 0x0F, 0x19, 0x4C, 0x0F, 0x00, 0x0F, 0x06, 0x00, 0x82, - 0x65, 0x61, 0x72, 0x00, 0x11, 0x04, 0x0F, 0x04, 0x06, 0x00, 0x84, 0x65, 0x6E, 0x64, 0x61, 0x72, - 0x00, 0x4A, 0x98, 0x0E, 0x17, 0xA3, 0x0E, 0x00, 0x0C, 0x08, 0x0B, 0x00, 0x85, 0x69, 0x67, 0x68, - 0x65, 0x72, 0x00, 0x48, 0xAD, 0x0E, 0x0F, 0xB9, 0x0E, 0x18, 0xC2, 0x0E, 0x00, 0x0B, 0x0A, 0x12, - 0x17, 0x00, 0x85, 0x65, 0x74, 0x68, 0x65, 0x72, 0x00, 0x12, 0x2C, 0x00, 0x84, 0x74, 0x68, 0x65, - 0x72, 0x00, 0x09, 0x00, 0x83, 0x72, 0x74, 0x68, 0x65, 0x72, 0x00, 0x4B, 0xD2, 0x0E, 0x0F, 0xDA, - 0x0E, 0x00, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x13, 0x10, 0x12, 0x06, 0x00, 0x83, - 0x69, 0x6C, 0x65, 0x72, 0x00, 0x17, 0x0C, 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x10, - 0x04, 0x15, 0x0A, 0x2C, 0x00, 0x81, 0x61, 0x72, 0x00, 0x4C, 0x00, 0x0F, 0x17, 0x0C, 0x0F, 0x00, - 0x0A, 0x0A, 0x08, 0x05, 0x00, 0x84, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x00, 0x4C, 0x13, 0x0F, 0x16, - 0x1C, 0x0F, 0x00, 0x12, 0x13, 0x00, 0x83, 0x6E, 0x74, 0x65, 0x72, 0x00, 0x0C, 0x0F, 0x00, 0x82, - 0x65, 0x6E, 0x65, 0x72, 0x00, 0x09, 0x08, 0x05, 0x00, 0x81, 0x72, 0x65, 0x00, 0x4B, 0x34, 0x0F, - 0x18, 0x3E, 0x0F, 0x00, 0x12, 0x11, 0x04, 0x00, 0x83, 0x74, 0x68, 0x65, 0x72, 0x00, 0x13, 0x12, - 0x10, 0x06, 0x00, 0x86, 0x6F, 0x6D, 0x70, 0x75, 0x74, 0x65, 0x72, 0x00, 0x48, 0x53, 0x0F, 0x1A, - 0x5E, 0x0F, 0x00, 0x08, 0x15, 0x08, 0x0B, 0x1A, 0x00, 0x83, 0x76, 0x65, 0x72, 0x00, 0x12, 0x0B, - 0x00, 0x82, 0x65, 0x76, 0x65, 0x72, 0x00, 0x08, 0x17, 0x12, 0x2C, 0x00, 0x82, 0x68, 0x65, 0x72, - 0x00, 0x04, 0x18, 0x06, 0x0C, 0x17, 0x15, 0x04, 0x13, 0x00, 0x82, 0x6C, 0x61, 0x72, 0x00, 0x17, - 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, 0x74, 0x6F, 0x72, 0x00, - 0x17, 0x0F, 0x0F, 0x18, 0x11, 0x00, 0x82, 0x70, 0x74, 0x72, 0x00, 0x04, 0x08, 0x1C, 0x2C, 0x00, - 0x81, 0x72, 0x73, 0x00, 0x12, 0x04, 0x15, 0x08, 0x13, 0x12, 0x00, 0x82, 0x74, 0x6F, 0x72, 0x00, - 0x06, 0x12, 0x2C, 0x00, 0x81, 0x63, 0x75, 0x72, 0x00, 0x08, 0x19, 0x08, 0x2C, 0x00, 0x81, 0x72, - 0x79, 0x00, 0x44, 0xDB, 0x0F, 0x08, 0x03, 0x10, 0x0A, 0x93, 0x10, 0x13, 0x9E, 0x10, 0x15, 0xAA, - 0x10, 0x16, 0xB5, 0x10, 0x17, 0x4D, 0x11, 0x18, 0x55, 0x11, 0x00, 0x4B, 0xE5, 0x0F, 0x13, 0xF0, - 0x0F, 0x1C, 0xFA, 0x0F, 0x00, 0x13, 0x15, 0x08, 0x13, 0x00, 0x83, 0x68, 0x61, 0x70, 0x73, 0x00, - 0x0B, 0x15, 0x08, 0x13, 0x00, 0x82, 0x61, 0x70, 0x73, 0x00, 0x1A, 0x0F, 0x04, 0x00, 0x82, 0x61, - 0x79, 0x73, 0x00, 0x44, 0x13, 0x10, 0x06, 0x2A, 0x10, 0x0C, 0x35, 0x10, 0x0F, 0x81, 0x10, 0x16, - 0x88, 0x10, 0x00, 0x47, 0x1A, 0x10, 0x0E, 0x22, 0x10, 0x00, 0x0C, 0x2C, 0x00, 0x82, 0x65, 0x61, - 0x73, 0x00, 0x17, 0x00, 0x83, 0x61, 0x6B, 0x65, 0x73, 0x00, 0x08, 0x07, 0x11, 0x0C, 0x00, 0x83, - 0x69, 0x63, 0x65, 0x73, 0x00, 0x46, 0x3F, 0x10, 0x15, 0x66, 0x10, 0x17, 0x75, 0x10, 0x00, 0x48, - 0x46, 0x10, 0x0C, 0x50, 0x10, 0x00, 0x07, 0x11, 0x0C, 0x00, 0x84, 0x69, 0x63, 0x65, 0x73, 0x00, - 0x47, 0x57, 0x10, 0x17, 0x5E, 0x10, 0x00, 0x11, 0x0C, 0x00, 0x82, 0x65, 0x73, 0x00, 0x15, 0x08, - 0x19, 0x00, 0x82, 0x65, 0x73, 0x00, 0x12, 0x16, 0x08, 0x06, 0x06, 0x04, 0x00, 0x84, 0x73, 0x6F, - 0x72, 0x69, 0x65, 0x73, 0x00, 0x0F, 0x0C, 0x05, 0x04, 0x00, 0x83, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x00, 0x04, 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x12, 0x0B, 0x06, 0x2C, 0x00, 0x82, 0x6F, 0x73, - 0x65, 0x73, 0x00, 0x0C, 0x11, 0x0B, 0x17, 0x00, 0x83, 0x69, 0x6E, 0x67, 0x73, 0x00, 0x04, 0x08, - 0x0B, 0x15, 0x08, 0x13, 0x00, 0x83, 0x61, 0x70, 0x73, 0x00, 0x08, 0x04, 0x1C, 0x2C, 0x00, 0x83, - 0x65, 0x61, 0x72, 0x73, 0x00, 0x44, 0xBF, 0x10, 0x08, 0xCB, 0x10, 0x12, 0x42, 0x11, 0x00, 0x15, - 0x04, 0x05, 0x10, 0x08, 0x00, 0x82, 0x72, 0x61, 0x73, 0x73, 0x00, 0x46, 0xD8, 0x10, 0x11, 0xF0, - 0x10, 0x15, 0x0D, 0x11, 0x16, 0x2A, 0x11, 0x00, 0x46, 0xDF, 0x10, 0x18, 0xE8, 0x10, 0x00, 0x12, - 0x15, 0x13, 0x00, 0x83, 0x65, 0x73, 0x73, 0x00, 0x16, 0x00, 0x82, 0x63, 0x65, 0x73, 0x73, 0x00, - 0x4C, 0xF7, 0x10, 0x16, 0x03, 0x11, 0x00, 0x16, 0x16, 0x18, 0x05, 0x00, 0x85, 0x69, 0x6E, 0x65, - 0x73, 0x73, 0x00, 0x18, 0x05, 0x00, 0x83, 0x69, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x13, 0x00, 0x55, - 0x16, 0x11, 0x18, 0x21, 0x11, 0x00, 0x18, 0x16, 0x00, 0x85, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, - 0x00, 0x16, 0x00, 0x83, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x46, 0x31, 0x11, 0x12, 0x3A, 0x11, - 0x00, 0x06, 0x18, 0x16, 0x00, 0x83, 0x65, 0x73, 0x73, 0x00, 0x13, 0x00, 0x82, 0x73, 0x65, 0x73, - 0x73, 0x00, 0x15, 0x06, 0x06, 0x04, 0x00, 0x84, 0x72, 0x6F, 0x73, 0x73, 0x00, 0x15, 0x0C, 0x09, - 0x00, 0x81, 0x73, 0x74, 0x00, 0x52, 0x5C, 0x11, 0x16, 0x6A, 0x11, 0x00, 0x0F, 0x12, 0x10, 0x12, - 0x11, 0x04, 0x00, 0x84, 0x61, 0x6C, 0x6F, 0x75, 0x73, 0x00, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, - 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, 0x75, 0x73, 0x00, 0x44, 0x9E, 0x11, 0x08, 0xBC, 0x11, 0x0A, - 0xD9, 0x11, 0x0B, 0xE3, 0x11, 0x0C, 0x19, 0x12, 0x0F, 0x24, 0x12, 0x10, 0x2F, 0x12, 0x11, 0x3B, - 0x12, 0x12, 0x97, 0x13, 0x13, 0xBD, 0x13, 0x16, 0xD9, 0x13, 0x18, 0x6B, 0x14, 0x00, 0x55, 0xA5, - 0x11, 0x1A, 0xB0, 0x11, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, 0x83, 0x61, 0x72, 0x61, 0x74, 0x00, - 0x0B, 0x08, 0x10, 0x12, 0x16, 0x00, 0x83, 0x77, 0x68, 0x61, 0x74, 0x00, 0x44, 0xC3, 0x11, 0x11, - 0xCC, 0x11, 0x00, 0x15, 0x0A, 0x2C, 0x00, 0x82, 0x65, 0x61, 0x74, 0x00, 0x10, 0x11, 0x15, 0x08, - 0x19, 0x12, 0x0A, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, - 0x68, 0x74, 0x00, 0x47, 0xED, 0x11, 0x0A, 0xF4, 0x11, 0x0C, 0x0E, 0x12, 0x00, 0x0C, 0x1A, 0x00, - 0x81, 0x74, 0x68, 0x00, 0x51, 0xFB, 0x11, 0x18, 0x02, 0x12, 0x00, 0x08, 0x0F, 0x00, 0x81, 0x74, - 0x68, 0x00, 0x12, 0x15, 0x0B, 0x17, 0x00, 0x85, 0x6F, 0x75, 0x67, 0x68, 0x74, 0x00, 0x0A, 0x11, - 0x12, 0x17, 0x00, 0x83, 0x69, 0x67, 0x68, 0x74, 0x00, 0x17, 0x18, 0x12, 0x05, 0x04, 0x00, 0x81, - 0x20, 0x69, 0x74, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, 0x00, 0x04, - 0x17, 0x15, 0x12, 0x13, 0x10, 0x0C, 0x00, 0x81, 0x6E, 0x74, 0x00, 0x44, 0x48, 0x12, 0x08, 0x80, - 0x12, 0x15, 0x84, 0x13, 0x16, 0x8F, 0x13, 0x00, 0x4C, 0x55, 0x12, 0x11, 0x60, 0x12, 0x15, 0x6B, - 0x12, 0x17, 0x75, 0x12, 0x00, 0x13, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, - 0x0C, 0x10, 0x12, 0x15, 0x13, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x13, 0x13, 0x04, 0x00, - 0x82, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x13, 0x10, 0x12, 0x06, 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, - 0x4C, 0x90, 0x12, 0x10, 0xB1, 0x12, 0x15, 0x15, 0x13, 0x19, 0x6F, 0x13, 0x1D, 0x79, 0x13, 0x00, - 0x46, 0x97, 0x12, 0x13, 0xA4, 0x12, 0x00, 0x08, 0x09, 0x09, 0x08, 0x00, 0x85, 0x69, 0x63, 0x69, - 0x65, 0x6E, 0x74, 0x00, 0x08, 0x06, 0x08, 0x15, 0x00, 0x85, 0x69, 0x70, 0x69, 0x65, 0x6E, 0x74, - 0x00, 0x48, 0xBE, 0x12, 0x11, 0xCA, 0x12, 0x15, 0xEB, 0x12, 0x17, 0x0A, 0x13, 0x00, 0x19, 0x12, - 0x0A, 0x00, 0x83, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x48, 0xD1, 0x12, 0x15, 0xDD, 0x12, - 0x00, 0x19, 0x12, 0x0A, 0x00, 0x84, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x12, 0x19, 0x12, - 0x0A, 0x00, 0x86, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x48, 0xF2, 0x12, 0x12, 0xFD, - 0x12, 0x00, 0x19, 0x12, 0x0A, 0x00, 0x83, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x19, 0x12, 0x0A, - 0x00, 0x85, 0x65, 0x72, 0x6E, 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x17, 0x16, 0x00, 0x83, 0x65, - 0x6D, 0x65, 0x6E, 0x74, 0x00, 0x44, 0x22, 0x13, 0x08, 0x2D, 0x13, 0x09, 0x39, 0x13, 0x15, 0x44, - 0x13, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, - 0x00, 0x84, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, 0x00, 0x83, 0x65, 0x72, - 0x65, 0x6E, 0x74, 0x00, 0x44, 0x4B, 0x13, 0x08, 0x63, 0x13, 0x00, 0x13, 0x00, 0x44, 0x54, 0x13, - 0x13, 0x5C, 0x13, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, 0x00, 0x83, 0x65, - 0x6E, 0x74, 0x00, 0x09, 0x0C, 0x07, 0x00, 0x85, 0x66, 0x65, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x08, - 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, 0x74, 0x00, 0x0C, 0x11, 0x0A, 0x12, 0x06, 0x00, 0x82, - 0x61, 0x6E, 0x74, 0x00, 0x08, 0x09, 0x09, 0x0C, 0x07, 0x00, 0x81, 0x65, 0x6E, 0x74, 0x00, 0x12, - 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x51, 0xA1, 0x13, 0x15, 0xAB, 0x13, 0x16, 0xB4, 0x13, - 0x00, 0x07, 0x0C, 0x07, 0x00, 0x82, 0x20, 0x6E, 0x6F, 0x74, 0x00, 0x13, 0x08, 0x15, 0x00, 0x82, - 0x6F, 0x72, 0x74, 0x00, 0x10, 0x0F, 0x04, 0x00, 0x82, 0x6F, 0x73, 0x74, 0x00, 0x48, 0xC4, 0x13, - 0x1C, 0xCF, 0x13, 0x00, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x70, 0x74, 0x00, 0x06, - 0x11, 0x08, 0x00, 0x82, 0x72, 0x79, 0x70, 0x74, 0x00, 0x48, 0xEC, 0x13, 0x0A, 0x15, 0x14, 0x0C, - 0x1E, 0x14, 0x10, 0x3B, 0x14, 0x11, 0x45, 0x14, 0x18, 0x60, 0x14, 0x00, 0x4A, 0xF3, 0x13, 0x15, - 0x0A, 0x14, 0x00, 0x4C, 0xFA, 0x13, 0x18, 0x02, 0x14, 0x00, 0x0B, 0x00, 0x82, 0x68, 0x65, 0x73, - 0x74, 0x00, 0x16, 0x00, 0x82, 0x67, 0x65, 0x73, 0x74, 0x00, 0x17, 0x11, 0x0C, 0x00, 0x83, 0x65, - 0x72, 0x65, 0x73, 0x74, 0x00, 0x15, 0x04, 0x0F, 0x00, 0x81, 0x65, 0x73, 0x74, 0x00, 0x49, 0x25, - 0x14, 0x11, 0x31, 0x14, 0x00, 0x08, 0x11, 0x04, 0x10, 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x00, 0x04, 0x0A, 0x04, 0x00, 0x83, 0x69, 0x6E, 0x73, 0x74, 0x00, 0x12, 0x0F, 0x04, 0x00, 0x83, - 0x6D, 0x6F, 0x73, 0x74, 0x00, 0x44, 0x4C, 0x14, 0x11, 0x57, 0x14, 0x00, 0x0C, 0x0A, 0x04, 0x00, - 0x84, 0x61, 0x69, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x04, 0x0A, 0x04, 0x00, 0x82, 0x73, 0x74, 0x00, - 0x0D, 0x04, 0x2C, 0x00, 0x83, 0x64, 0x6A, 0x75, 0x73, 0x74, 0x00, 0x46, 0x78, 0x14, 0x12, 0x90, - 0x14, 0x13, 0xA8, 0x14, 0x17, 0xBF, 0x14, 0x00, 0x48, 0x7F, 0x14, 0x15, 0x89, 0x14, 0x00, 0x06, - 0x1B, 0x08, 0x00, 0x84, 0x65, 0x63, 0x75, 0x74, 0x00, 0x0C, 0x06, 0x00, 0x80, 0x69, 0x74, 0x00, - 0x44, 0x97, 0x14, 0x05, 0xA0, 0x14, 0x00, 0x05, 0x00, 0x84, 0x61, 0x62, 0x6F, 0x75, 0x74, 0x00, - 0x05, 0x04, 0x00, 0x83, 0x6F, 0x75, 0x74, 0x00, 0x57, 0xAF, 0x14, 0x18, 0xB7, 0x14, 0x00, 0x11, - 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, - 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, 0x17, 0x12, 0x05, 0x04, 0x00, 0x81, 0x75, - 0x74, 0x00, 0x48, 0xD9, 0x14, 0x0C, 0xFD, 0x14, 0x00, 0x44, 0xE0, 0x14, 0x0C, 0xE7, 0x14, 0x00, - 0x0B, 0x2C, 0x00, 0x81, 0x76, 0x65, 0x00, 0x46, 0xEE, 0x14, 0x08, 0xF6, 0x14, 0x00, 0x08, 0x15, - 0x00, 0x82, 0x65, 0x69, 0x76, 0x00, 0x06, 0x08, 0x15, 0x00, 0x81, 0x76, 0x00, 0x08, 0x0B, 0x06, - 0x04, 0x2C, 0x00, 0x82, 0x69, 0x65, 0x76, 0x00, 0x4C, 0x0F, 0x15, 0x11, 0x19, 0x15, 0x00, 0x08, - 0x19, 0x08, 0x15, 0x00, 0x82, 0x69, 0x65, 0x77, 0x00, 0x12, 0x0E, 0x2C, 0x00, 0x82, 0x6E, 0x6F, - 0x77, 0x00, 0x46, 0x3B, 0x15, 0x08, 0x76, 0x15, 0x0B, 0x80, 0x15, 0x0F, 0x92, 0x15, 0x11, 0x57, - 0x16, 0x15, 0x72, 0x16, 0x16, 0x0C, 0x17, 0x17, 0x27, 0x17, 0x00, 0x44, 0x48, 0x15, 0x08, 0x54, - 0x15, 0x0C, 0x5F, 0x15, 0x13, 0x6A, 0x15, 0x00, 0x15, 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x82, - 0x69, 0x73, 0x79, 0x00, 0x18, 0x14, 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x15, - 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x81, 0x73, 0x79, 0x00, 0x18, 0x15, 0x0E, 0x11, 0x04, 0x05, - 0x00, 0x81, 0x74, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, 0x74, 0x79, 0x00, - 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, - 0x79, 0x00, 0x44, 0xA5, 0x15, 0x0B, 0xE8, 0x15, 0x0E, 0xF2, 0x15, 0x0F, 0xFA, 0x15, 0x12, 0x42, - 0x16, 0x15, 0x4C, 0x16, 0x00, 0x45, 0xB8, 0x15, 0x08, 0xC1, 0x15, 0x0F, 0xC7, 0x15, 0x11, 0xD0, - 0x15, 0x15, 0xD7, 0x15, 0x18, 0xE0, 0x15, 0x00, 0x12, 0x15, 0x13, 0x00, 0x81, 0x62, 0x6C, 0x79, - 0x00, 0x15, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x08, 0x15, 0x00, 0x83, 0x61, 0x6C, 0x6C, 0x79, 0x00, - 0x0C, 0x09, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x08, 0x11, 0x08, 0x0A, 0x00, 0x80, 0x6C, 0x79, 0x00, - 0x17, 0x06, 0x04, 0x00, 0x80, 0x6C, 0x79, 0x00, 0x0A, 0x0C, 0x0F, 0x16, 0x00, 0x81, 0x74, 0x6C, - 0x79, 0x00, 0x0C, 0x0F, 0x00, 0x81, 0x65, 0x6C, 0x79, 0x00, 0x44, 0x04, 0x16, 0x05, 0x2F, 0x16, - 0x08, 0x38, 0x16, 0x00, 0x56, 0x0B, 0x16, 0x17, 0x23, 0x16, 0x00, 0x18, 0x00, 0x6C, 0x14, 0x16, - 0x16, 0x1B, 0x16, 0x00, 0x83, 0x75, 0x61, 0x6C, 0x6C, 0x79, 0x00, 0x18, 0x00, 0x84, 0x61, 0x6C, - 0x6C, 0x79, 0x00, 0x18, 0x06, 0x04, 0x00, 0x85, 0x74, 0x75, 0x61, 0x6C, 0x6C, 0x79, 0x00, 0x04, - 0x05, 0x12, 0x15, 0x13, 0x00, 0x81, 0x79, 0x00, 0x04, 0x15, 0x00, 0x84, 0x65, 0x61, 0x6C, 0x6C, - 0x79, 0x00, 0x10, 0x12, 0x11, 0x04, 0x00, 0x82, 0x61, 0x6C, 0x79, 0x00, 0x04, 0x10, 0x0C, 0x15, - 0x13, 0x00, 0x81, 0x69, 0x6C, 0x79, 0x00, 0x48, 0x5E, 0x16, 0x13, 0x67, 0x16, 0x00, 0x12, 0x10, - 0x2C, 0x00, 0x82, 0x6E, 0x65, 0x79, 0x00, 0x04, 0x10, 0x12, 0x06, 0x00, 0x83, 0x70, 0x61, 0x6E, - 0x79, 0x00, 0x44, 0x7F, 0x16, 0x08, 0xE7, 0x16, 0x12, 0xF0, 0x16, 0x17, 0xFD, 0x16, 0x00, 0x45, - 0x8F, 0x16, 0x0C, 0x98, 0x16, 0x0F, 0xA5, 0x16, 0x10, 0xC1, 0x16, 0x16, 0xCA, 0x16, 0x00, 0x0C, - 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00, 0x0F, 0x0F, 0x0C, 0x1B, 0x18, 0x04, 0x00, 0x84, - 0x69, 0x61, 0x72, 0x79, 0x00, 0x4C, 0xAC, 0x16, 0x0F, 0xB6, 0x16, 0x00, 0x1B, 0x18, 0x04, 0x00, - 0x82, 0x69, 0x61, 0x72, 0x79, 0x00, 0x0C, 0x1B, 0x18, 0x04, 0x00, 0x83, 0x69, 0x61, 0x72, 0x79, - 0x00, 0x18, 0x16, 0x00, 0x82, 0x6D, 0x61, 0x72, 0x79, 0x00, 0x08, 0x06, 0x00, 0x46, 0xD4, 0x16, - 0x08, 0xDF, 0x16, 0x00, 0x08, 0x11, 0x00, 0x85, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x00, 0x11, - 0x00, 0x82, 0x73, 0x61, 0x72, 0x79, 0x00, 0x13, 0x12, 0x15, 0x13, 0x00, 0x80, 0x74, 0x79, 0x00, - 0x0A, 0x04, 0x17, 0x04, 0x06, 0x00, 0x84, 0x65, 0x67, 0x6F, 0x72, 0x79, 0x00, 0x11, 0x18, 0x06, - 0x12, 0x2C, 0x00, 0x86, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, 0x79, 0x00, 0x04, 0x00, 0x55, 0x15, - 0x17, 0x1A, 0x20, 0x17, 0x00, 0x06, 0x12, 0x13, 0x1C, 0x0B, 0x00, 0x82, 0x69, 0x73, 0x79, 0x00, - 0x0F, 0x04, 0x00, 0x81, 0x79, 0x73, 0x00, 0x49, 0x31, 0x17, 0x0F, 0x39, 0x17, 0x15, 0x42, 0x17, - 0x00, 0x04, 0x16, 0x00, 0x81, 0x65, 0x74, 0x79, 0x00, 0x0C, 0x05, 0x04, 0x00, 0x81, 0x69, 0x74, - 0x79, 0x00, 0x13, 0x08, 0x12, 0x15, 0x13, 0x00, 0x84, 0x70, 0x65, 0x72, 0x74, 0x79, 0x00 -}; - + 0x6C, 0x2B, 0x00, 0x06, 0x47, 0x00, 0x07, 0x51, 0x00, 0x08, 0xC7, 0x00, 0x09, 0xF0, 0x01, 0x0A, + 0xFA, 0x01, 0x0B, 0x1A, 0x02, 0x11, 0x35, 0x02, 0x12, 0xBE, 0x02, 0x13, 0xCA, 0x02, 0x15, 0xD4, + 0x02, 0x16, 0x14, 0x03, 0x17, 0x43, 0x03, 0x1C, 0x20, 0x04, 0x00, 0x48, 0x32, 0x00, 0x16, 0x3C, + 0x00, 0x00, 0x0B, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x84, 0x00, 0x08, 0x16, 0x12, 0x12, + 0x0F, 0x00, 0x84, 0x73, 0x65, 0x73, 0x00, 0x0B, 0x17, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, + 0x00, 0x44, 0x5E, 0x00, 0x08, 0x6A, 0x00, 0x0F, 0xAE, 0x00, 0x15, 0xBB, 0x00, 0x00, 0x0C, 0x0F, + 0x19, 0x11, 0x0C, 0x00, 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x4A, 0x77, 0x00, 0x0C, 0x81, 0x00, + 0x15, 0x8C, 0x00, 0x18, 0xA5, 0x00, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, + 0x00, 0x19, 0x15, 0x08, 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x48, 0x93, 0x00, 0x18, + 0x9C, 0x00, 0x00, 0x09, 0x08, 0x15, 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, 0x00, + 0x81, 0x72, 0x65, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, 0x81, 0x64, 0x65, 0x00, 0x12, 0x16, + 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x04, 0x1A, 0x12, 0x09, 0x00, + 0x83, 0x72, 0x77, 0x61, 0x72, 0x64, 0x00, 0x44, 0xE9, 0x00, 0x06, 0xF6, 0x00, 0x07, 0x04, 0x01, + 0x08, 0x10, 0x01, 0x0A, 0x34, 0x01, 0x0F, 0x51, 0x01, 0x15, 0x5A, 0x01, 0x16, 0x75, 0x01, 0x17, + 0x90, 0x01, 0x18, 0xD7, 0x01, 0x19, 0xE4, 0x01, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, + 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, 0x13, 0x04, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, + 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x12, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, + 0x17, 0x00, 0x44, 0x19, 0x01, 0x11, 0x24, 0x01, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x18, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x44, 0x3B, 0x01, 0x07, 0x45, 0x01, 0x00, 0x18, 0x0A, 0x2C, 0x00, 0x83, + 0x61, 0x75, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x0C, 0x19, 0x0C, 0x15, 0x13, 0x00, 0x82, 0x67, 0x65, + 0x00, 0x16, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x4C, 0x61, 0x01, 0x18, 0x6D, 0x01, + 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x00, 0x17, 0x2C, 0x00, + 0x82, 0x72, 0x75, 0x65, 0x00, 0x04, 0x00, 0x4F, 0x7E, 0x01, 0x18, 0x86, 0x01, 0x00, 0x09, 0x00, + 0x83, 0x61, 0x6C, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, + 0x04, 0x00, 0x47, 0x9C, 0x01, 0x13, 0xC1, 0x01, 0x15, 0xCB, 0x01, 0x00, 0x12, 0x10, 0x00, 0x50, + 0xA6, 0x01, 0x12, 0xB5, 0x01, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, + 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, + 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, + 0x84, 0x61, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0A, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, + 0x67, 0x75, 0x65, 0x00, 0x08, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x76, 0x65, 0x00, + 0x0C, 0x08, 0x0B, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x11, 0x00, 0x4C, 0x03, 0x02, 0x15, + 0x10, 0x02, 0x00, 0x0F, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, 0x69, 0x6E, 0x67, 0x00, + 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x46, 0x21, 0x02, 0x17, 0x2C, 0x02, + 0x00, 0x0C, 0x17, 0x1A, 0x16, 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0A, 0x0C, 0x08, 0x0B, + 0x00, 0x81, 0x68, 0x74, 0x00, 0x48, 0x45, 0x02, 0x0A, 0x50, 0x02, 0x12, 0x59, 0x02, 0x15, 0x9C, + 0x02, 0x18, 0xA7, 0x02, 0x00, 0x16, 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, + 0x0C, 0x15, 0x17, 0x16, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0C, 0x00, 0x56, 0x62, 0x02, 0x17, 0x7C, + 0x02, 0x00, 0x44, 0x69, 0x02, 0x16, 0x72, 0x02, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, + 0x6E, 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x4C, 0x83, 0x02, 0x16, + 0x92, 0x02, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, 0x69, 0x6F, + 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, + 0x00, 0x83, 0x74, 0x75, 0x72, 0x6E, 0x00, 0x55, 0xAE, 0x02, 0x17, 0xB7, 0x02, 0x00, 0x17, 0x08, + 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, 0x80, 0x72, 0x6E, 0x00, 0x07, 0x08, + 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, 0x75, 0x64, 0x6F, 0x00, 0x18, 0x12, 0x12, 0x0F, 0x00, 0x81, + 0x6B, 0x75, 0x70, 0x00, 0x48, 0xDB, 0x02, 0x12, 0x03, 0x03, 0x00, 0x4C, 0xE5, 0x02, 0x0F, 0xEE, + 0x02, 0x11, 0xF8, 0x02, 0x00, 0x0B, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x17, 0x0C, + 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x17, 0x16, 0x0C, 0x0F, 0x00, 0x82, 0x65, 0x6E, + 0x65, 0x72, 0x00, 0x17, 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, + 0x74, 0x6F, 0x72, 0x00, 0x48, 0x1E, 0x03, 0x11, 0x26, 0x03, 0x18, 0x33, 0x03, 0x00, 0x0F, 0x04, + 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x04, 0x0C, 0x17, 0x11, 0x12, 0x06, 0x00, 0x83, 0x61, 0x69, + 0x6E, 0x73, 0x00, 0x16, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, + 0x75, 0x73, 0x00, 0x74, 0x59, 0x03, 0x0A, 0x66, 0x03, 0x0B, 0x70, 0x03, 0x0F, 0x86, 0x03, 0x11, + 0x91, 0x03, 0x16, 0xEA, 0x03, 0x18, 0xF8, 0x03, 0x00, 0x11, 0x08, 0x16, 0x12, 0x07, 0x00, 0x84, + 0x65, 0x73, 0x6E, 0x27, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, 0x68, 0x74, 0x00, + 0x47, 0x77, 0x03, 0x0A, 0x7E, 0x03, 0x00, 0x0C, 0x1A, 0x00, 0x81, 0x74, 0x68, 0x00, 0x11, 0x08, + 0x0F, 0x00, 0x81, 0x74, 0x68, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, + 0x00, 0x44, 0x9B, 0x03, 0x08, 0xA6, 0x03, 0x16, 0xE2, 0x03, 0x00, 0x15, 0x04, 0x13, 0x13, 0x04, + 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x55, 0xAD, 0x03, 0x19, 0xD8, 0x03, 0x00, 0x44, 0xB4, 0x03, + 0x15, 0xBF, 0x03, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, + 0x13, 0x00, 0x44, 0xC9, 0x03, 0x13, 0xD1, 0x03, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, + 0x00, 0x04, 0x00, 0x83, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, + 0x74, 0x00, 0x12, 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x09, 0x08, 0x11, 0x04, 0x10, + 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, 0x00, 0x53, 0xFF, 0x03, 0x17, 0x16, 0x04, 0x00, 0x57, + 0x06, 0x04, 0x18, 0x0E, 0x04, 0x00, 0x11, 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, + 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, + 0x46, 0x2D, 0x04, 0x08, 0x39, 0x04, 0x0B, 0x43, 0x04, 0x15, 0x55, 0x04, 0x00, 0x08, 0x18, 0x14, + 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, + 0x74, 0x79, 0x00, 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, + 0x72, 0x63, 0x68, 0x79, 0x00, 0x04, 0x05, 0x0C, 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00 +}; \ No newline at end of file From 7bf0fccf0dd1a9fb01785ff5bf047c1a124bde74 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 11:43:48 -0400 Subject: [PATCH 112/160] re-enabled autocorrect using smaller dictionary --- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk index f83207e0afb1..b54f6bf491b3 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk @@ -1,7 +1,7 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes -AUTOCORRECT_ENABLE = no +AUTOCORRECT_ENABLE = yes SRC += keymap_user_config.c From 249bcf6e60828370bbe6bf23384a6049be4c90ed Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 13:57:05 -0400 Subject: [PATCH 113/160] changed default colors for the Q1SE --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h index 372432cea993..bdb174b0eed5 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h @@ -26,7 +26,7 @@ #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) -#define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) +#define RGB_MATRIX_DEFAULT_HUE 37 // HSV gold hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers @@ -36,7 +36,7 @@ #define CAPS_LOCK_INDICATOR_COLOR RGB_RED // Dynamic Fn Layer RGB indicator options -#define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange +#define FN1_LAYER_COLOR RGB_TEAL // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word From 54ca533f596b59e2acdc0e7cc025a622825768a4 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 13:58:28 -0400 Subject: [PATCH 114/160] updated readme --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 76a09970a4f1..0bf90acbabf6 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -34,7 +34,7 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) - #define RGB_MATRIX_DEFAULT_HUE 170 // HSV blue hue (Mac Base layer) + #define RGB_MATRIX_DEFAULT_HUE 37 // HSV gold hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers @@ -50,7 +50,7 @@ Caps Lock RGB indicator option: Dynamic Fn Layer RGB indicator options: ``` - #define FN1_LAYER_COLOR 0xFE, 0x23, 0x00 // RGB orange + #define FN1_LAYER_COLOR RGB_TEAL ``` Caps Word options: From a0486536b1929d3dac6f6c81571f27d29ad01b60 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 15:36:32 -0400 Subject: [PATCH 115/160] updated readme --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 0bf90acbabf6..2d5c5c42d973 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -15,7 +15,7 @@ - Caps Lock RGB indicator. Will light Caps Lock key with options to also light Tab key (useful for some keycap sets), and/or light all alpha keys. -- Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. +- Dynamic Fn layer RGB indicator. When Fn key is held down, any keys defined on the Fn layer in this firmware or in VIA will be highlighted. ##### Notes: @@ -72,7 +72,6 @@ Caps Word options: ## This keymap makes the following layout changes over the factory firmware -- Removes redundant lighting and NKRO keycodes from Fn1 layer (they remain on Fn2 layer) - Fn+Left Shift toggles Autocorrect on/off - Fn+Backspace enters DFU mode (but does not reset eeprom) - Fn+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) From c1f5ff76b1d02407e7b09b9a499631506b12c3d8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:36:00 -0400 Subject: [PATCH 116/160] added config.h option to have autocorrect off at startup --- .../q1/ansi_encoder/keymaps/mkillewald/config.h | 10 +++++++--- .../q1/ansi_encoder/keymaps/mkillewald/keymap.c | 5 +++++ .../q1/ansi_encoder/keymaps/mkillewald/readme.md | 14 +++++++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h index bdb174b0eed5..d2b7b75dffe3 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h @@ -32,20 +32,24 @@ #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers +// Autocorrect is on at start up. If you want Autocorrect to be off at startup, +// un-comment the following line +//#define AUTOCORRECT_OFF_AT_STARTUP + // Caps Lock RGB indicator color #define CAPS_LOCK_INDICATOR_COLOR RGB_RED // Dynamic Fn Layer RGB indicator options #define FN1_LAYER_COLOR RGB_TEAL +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_RED + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD -// Caps Word RGB indicator color -#define CAPS_WORD_INDICATOR_COLOR RGB_RED - // Caps Word will light left Shift, left Control and left Option (or left Windows // key) when acitvated. Remove this line if you want Caps Word to only light left // Shift when enabled. diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 0e30fc9701ee..5328a4ce68cf 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -102,6 +102,11 @@ void matrix_init_user(void) { void keyboard_post_init_user(void) { user_config_read_eeprom(); + +#ifdef AUTOCORRECT_OFF_AT_STARTUP + // toggle autocorrect off at startup + if (autocorrect_is_enabled()) { autocorrect_toggle(); } +#endif } void housekeeping_task_user(void) { diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 2d5c5c42d973..4d2c46277ecd 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -41,6 +41,14 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers ``` +Autocorrect option: + +``` + // Autocorrect is on at start up. If you want Autocorrect to be off at startup, + // un-comment the following line + //#define AUTOCORRECT_OFF_AT_STARTUP +``` + Caps Lock RGB indicator option: ``` @@ -56,14 +64,14 @@ Dynamic Fn Layer RGB indicator options: Caps Word options: ``` + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_RED + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD - // Caps Word RGB indicator color - #define CAPS_WORD_INDICATOR_COLOR RGB_RED - // Caps Word will light left Shift, left Control and left Option (or left Windows // key) when acitvated. Remove this line if you want Caps Word to only light left // Shift when enabled. From 797f1d0ff9d088e7322a5142c895ab35542e1765 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:40:28 -0400 Subject: [PATCH 117/160] removed include print.h --- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 5328a4ce68cf..973bffd63769 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -22,8 +22,6 @@ # include "rgb_matrix_user.h" #endif -#include "print.h" - // clang-format off enum my_bootloader_state { From f854c3d8e299b0fc1ddc7b881da1dff5571fea5f Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 11 Apr 2023 22:41:09 -0400 Subject: [PATCH 118/160] removed unnecessary file --- .../keymaps/mkillewald/keymap_q2.c | 344 ------------------ 1 file changed, 344 deletions(-) delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c deleted file mode 100644 index 966a79f0182c..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_q2.c +++ /dev/null @@ -1,344 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 "keychron_common.h" -#include "keymap_user.h" -#include "keymap_user_config.h" -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix_user.h" -#endif - -// clang-format off - -enum my_bootloader_state { - BOOTLOADER_INACTIVE, - BOOTLOADER_PRESSED, - BOOTLOADER_WAIT, - BOOTLOADER_DO -} bootloader_state; - -enum my_keycodes { - KC_LIGHT_TAB_TOGGLE = QK_USER_0, - KC_LIGHT_ALPHAS_TOGGLE, - KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE, - KC_LOCK_BLANK_MAC -}; - -#define KC_LTTOG KC_LIGHT_TAB_TOGGLE -#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE -#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE -#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_LBMAC KC_LOCK_BLANK_MAC - -static bool win_mode; -static bool win_mode_was_activated; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [MAC_BASE] = LAYOUT_ansi_67( - QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), - - [WIN_BASE] = LAYOUT_ansi_67( - QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), - - // Mac Fn1 - [_FN1] = LAYOUT_ansi_67( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, G(KC_0), - _______, KC_LBMAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_LEFT), - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G(KC_RGHT), - _______, _______, _______, _______, _______, _______, _______, _______, LCAG(KC_W), LCAG(KC_D), _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - // Win Fn1 - [_FN2] = LAYOUT_ansi_67( - KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, C(KC_0), - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - // Combined Mac Win Fn2 - [_FN3] = LAYOUT_ansi_67( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, RGB_TOG, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, KC_HOME, - AC_TOGG, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) -}; - -// clang-format on - -#if defined(ENCODER_MAP_ENABLE) -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { - [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [_FN1] = { ENCODER_CCW_CW(G(KC_MINS), G(KC_EQL)) }, - [_FN2] = { ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)) }, - [_FN3] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, -}; -#endif - -void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init_user(); -#endif -} - -void keyboard_post_init_user(void) { - user_config_read_eeprom(); -} - -void housekeeping_task_user(void) { - switch(bootloader_state) { - case BOOTLOADER_DO: - // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. - reset_keyboard(); - break; - case BOOTLOADER_WAIT: - // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my - // Q2 needed this extra wait frame. - bootloader_state = BOOTLOADER_DO; - break; - case BOOTLOADER_PRESSED: - // User pressed bootloader keycode and RGB was disabled earlier in this - // frame. However RGB changes wont take place immediately, so we set a - // flag here which will be caught at end of the next frame. - bootloader_state = BOOTLOADER_WAIT; - break; - default: - break; - } - - housekeeping_task_keychron(); -} - -bool dip_switch_update_user(uint8_t index, bool active) { - win_mode = (index == 0 && active ? true : false); - return true; -} - -bool is_win_mode(void) { return win_mode; } - -layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case MAC_BASE: - if (!is_win_mode() && win_mode_was_activated) { - // switch was moved to mac mode - win_mode_was_activated = false; - - // check enable/disable - if (user_config_get_enable_mac_base()) { -// rgb_matrix_enable_noeeprom(); - - // load mac base settings - rgb_matrix_reload_from_eeprom(); - - rgb_matrix_enable_noeeprom(); - } else { - rgb_matrix_disable_noeeprom(); - } - } - break; - case WIN_BASE: - if (is_win_mode() && !win_mode_was_activated) { - // switch was moved to win mode - win_mode_was_activated = true; - - // check enable/disable - if (user_config_get_enable_win_base()) { - rgb_matrix_enable_noeeprom(); - - // load win base settings - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - } else { - rgb_matrix_disable_noeeprom(); - } - } - break; - default: // for any other layers, or the default layer - break; - } - return state; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (process_record_keychron(keycode, record)) { - switch (keycode) { - case QK_BOOT: - // We want to turn off LEDs before calling bootloader, so here - // we call rgb_matrix_disable_noeeprom() and set a flag because - // the LEDs won't be updated until the next frame. - if (record->event.pressed) { - rgb_matrix_disable_noeeprom(); - bootloader_state = BOOTLOADER_PRESSED; - } - return false; // Skip all further processing of this key - case RGB_TOG: - if (record->event.pressed) { - rgb_matrix_toggle_noeeprom(); - if (win_mode) { - user_config_toggle_enable_win_base(); - } else { - user_config_toggle_enable_mac_base(); - } - } - return false; // Skip all further processing of this key - case RGB_MOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_RMOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_reverse_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case KC_LIGHT_TAB_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_tab(); - } - return false; // Skip all further processing of this key - case KC_LIGHT_ALPHAS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_alphas(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_transparent_keys_off(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_COLOR_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_color_enable(); - } - return false; // Skip all further processing of this key - case KC_LOCK_BLANK_MAC: - if (record->event.pressed) { - send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } - } - return true; -} From f62cfb65390e345e11de5d08530c9a5eb40046e1 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 01:01:48 -0400 Subject: [PATCH 119/160] renamed config.h option for clarity --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/config.h | 4 ++-- .../q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c | 4 ++-- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h index d2b7b75dffe3..383878d45aaf 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h @@ -23,8 +23,8 @@ #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable -#define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable -#define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 37 // HSV gold hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c index 31591422bc6f..3e1fbcd8a561 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c @@ -39,8 +39,8 @@ void eeconfig_init_user(void) { user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; - user_config.enable_mac_base = DEFAULT_ENABLE_MAC_BASE; - user_config.enable_win_base = DEFAULT_ENABLE_WIN_BASE; + user_config.enable_mac_base = DEFAULT_RGB_ENABLE_MAC_BASE; + user_config.enable_win_base = DEFAULT_RGB_ENABLE_WIN_BASE; user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 4d2c46277ecd..1a36fd49e3b0 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -31,8 +31,8 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable - #define DEFAULT_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable - #define DEFAULT_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) #define RGB_MATRIX_DEFAULT_HUE 37 // HSV gold hue (Mac Base layer) #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers From 919c6c3f91d0c17a729f3e3880ead1110a7e7f58 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 10:54:17 -0400 Subject: [PATCH 120/160] updated readme --- .../q1/ansi_encoder/keymaps/mkillewald/readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 1a36fd49e3b0..cc39824e2b30 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -100,11 +100,11 @@ Caps Word options: [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) All custom keycodes can be moved to different keys in VIA by using the following: -- CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle -- CUSTOM(65) = KC_LATOG (default: Fn2+X) Caps Lock Light Alpha Toggle -- CUSTOM(66) = KC_TKTOG (default: Fn2+C) Fn layer Trasnparent Key Off Toggle -- CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle -- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac +- CUSTOM(64) = KC_LTTOG (default: Fn+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn+C) Fn layer Trasnparent Key Off Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn+Esc) Lock and Blank Mac ## Known Issues From 5bb4619c8f08e60e4ae7dd6f2b496466e874ce7e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 10:56:29 -0400 Subject: [PATCH 121/160] updated readme --- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index cc39824e2b30..5ccce0d0dfb7 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -89,7 +89,7 @@ Caps Word options: - Fn+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) - toggle turning off RGB for keys with no definition - Fn+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) - - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR - Mac mode only - Fn+Esc (KC_LBMAC) will lock and sleep display From 86573b74b348514af35c6f5c9a072cc33292c0f1 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 11:12:08 -0400 Subject: [PATCH 122/160] updated readme --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 5ccce0d0dfb7..7611580071d5 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -93,8 +93,8 @@ Caps Word options: - Mac mode only - Fn+Esc (KC_LBMAC) will lock and sleep display - - Fn1+< sets my secondary display to 0° rotation - - Fn1+> sets my secondary display to 90° rotation + - Fn+< sets my secondary display to 0° rotation + - Fn+> sets my secondary display to 90° rotation Note: display rotation requires additional software and changes made, see this link for more information: [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) From 1a4b4642da84236f4a86e7403526c6f7dc29bc9c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 12 Apr 2023 11:31:49 -0400 Subject: [PATCH 123/160] updated readme --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 7611580071d5..23ccf7e8c14a 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -108,8 +108,8 @@ All custom keycodes can be moved to different keys in VIA by using the following ## Known Issues -1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working -2. Keychron LED test Fn1+Home+Right is not working +1. Keychron factory reset (clear eeprom) Fn+J+Z is not working +2. Keychron LED test Fn+Home+Right is not working It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. From 2d54f17f16374ca35c5255b3a054172b6c0f49ae Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 25 Apr 2023 17:01:04 -0400 Subject: [PATCH 124/160] code reorg utilizing userspace folder --- .../ansi_encoder/keymaps/mkillewald/config.h | 2 - .../ansi_encoder/keymaps/mkillewald/keymap.c | 272 +++--------------- .../keymaps/mkillewald/keymap_user_config.c | 179 ------------ .../keymaps/mkillewald/keymap_user_config.h | 52 ---- .../mkillewald/{keymap_user.h => layers.h} | 2 +- .../keymaps/mkillewald/rgb_matrix_user.c | 99 ------- .../keymaps/mkillewald/rgb_matrix_user.h | 24 -- .../ansi_encoder/keymaps/mkillewald/rules.mk | 6 - 8 files changed, 34 insertions(+), 602 deletions(-) delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h rename keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/{keymap_user.h => layers.h} (99%) delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h index 383878d45aaf..0ba342b780f4 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/config.h @@ -16,8 +16,6 @@ #pragma once -#define EECONFIG_USER_DATA_SIZE 20 // size of eeprom data, do not change. - // default options applied when eeprom is cleared #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 973bffd63769..b3fff77f2cf1 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -16,37 +16,13 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" -#include "keymap_user.h" -#include "keymap_user_config.h" -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix_user.h" -#endif +#include "mkillewald.h" +#include "eeprom_user_config.h" +#include "rgb_matrix_user.h" +#include "layers.h" // clang-format off -enum my_bootloader_state { - BOOTLOADER_INACTIVE, - BOOTLOADER_PRESSED, - BOOTLOADER_WAIT, - BOOTLOADER_DO -} bootloader_state; - -enum my_keycodes { - KC_LIGHT_TAB_TOGGLE = QK_USER_0, - KC_LIGHT_ALPHAS_TOGGLE, - KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE, - KC_LOCK_BLANK_MAC -}; - -#define KC_LTTOG KC_LIGHT_TAB_TOGGLE -#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE -#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE -#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_LBMAC KC_LOCK_BLANK_MAC - -static bool win_mode; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_ansi_82( KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_MUTE, @@ -93,233 +69,51 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { #endif void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init_user(); -#endif + matrix_init_mkillewald(); } void keyboard_post_init_user(void) { - user_config_read_eeprom(); - -#ifdef AUTOCORRECT_OFF_AT_STARTUP - // toggle autocorrect off at startup - if (autocorrect_is_enabled()) { autocorrect_toggle(); } -#endif + keyboard_post_init_mkillewald(); } void housekeeping_task_user(void) { - switch(bootloader_state) { - case BOOTLOADER_DO: - // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. - reset_keyboard(); - break; - case BOOTLOADER_WAIT: - // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my - // Q2 needed this extra wait frame. - bootloader_state = BOOTLOADER_DO; - break; - case BOOTLOADER_PRESSED: - // User pressed bootloader keycode and RGB was disabled earlier in this - // frame. However RGB changes wont take place immediately, so we set a - // flag here which will be caught at end of the next frame. - bootloader_state = BOOTLOADER_WAIT; - break; - default: - break; - } - housekeeping_task_keychron(); + housekeeping_task_mkillewald(); } -bool dip_switch_update_user(uint8_t index, bool active) { - win_mode = (index == 0 && active ? true : false); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_mkillewald(keycode, record)) { return false; } return true; } -layer_state_t default_layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { case MAC_BASE: - // load mac base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_reload_from_eeprom(); - - // check disable - if (!user_config_get_enable_mac_base()) { - rgb_matrix_disable_noeeprom(); - } - break; case WIN_BASE: - // load win base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - - // check disable - if (!user_config_get_enable_win_base()) { - rgb_matrix_disable_noeeprom(); +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif +#ifdef CAPS_WORD_INDICATOR_COLOR + if (is_caps_word_on()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); } +#endif break; - default: + case MAC_FN: + case WIN_FN: +#ifdef FN1_LAYER_COLOR + if (user_config_get_fn_layer_color_enable()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); + } +#endif + if (user_config_get_fn_layer_transparent_keys_off()) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); + } break; } - return state; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (process_record_keychron(keycode, record)) { - switch (keycode) { - case QK_BOOT: - // We want to turn off LEDs before calling bootloader, so here - // we call rgb_matrix_disable_noeeprom() and set a flag because - // the LEDs won't be updated until the next frame. - if (record->event.pressed) { - rgb_matrix_disable_noeeprom(); - bootloader_state = BOOTLOADER_PRESSED; - } - return false; // Skip all further processing of this key - case RGB_TOG: - if (record->event.pressed) { - rgb_matrix_toggle_noeeprom(); - if (win_mode) { - user_config_toggle_enable_win_base(); - } else { - user_config_toggle_enable_mac_base(); - } - } - return false; // Skip all further processing of this key - case RGB_MOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_RMOD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_step_reverse_noeeprom(); - user_config_set_mode_win_base(rgb_matrix_get_mode()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_HUD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_hue_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_sat_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_VAD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_val_noeeprom(); - user_config_set_hsv_win_base(rgb_matrix_get_hsv()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPI: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_increase_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case RGB_SPD: - if (win_mode) { - if (record->event.pressed) { - rgb_matrix_decrease_speed_noeeprom(); - user_config_set_spd_win_base(rgb_matrix_get_speed()); - } - return false; // Skip all further processing of this key - } else { - return true; // Allow further processing of this key - } - case KC_LIGHT_TAB_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_tab(); - } - return false; // Skip all further processing of this key - case KC_LIGHT_ALPHAS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_caps_lock_light_alphas(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_transparent_keys_off(); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_COLOR_TOGGLE: - if (record->event.pressed) { - user_config_toggle_fn_layer_color_enable(); - } - return false; // Skip all further processing of this key - case KC_LOCK_BLANK_MAC: - if (record->event.pressed) { - send_string(SS_LCTL(SS_LGUI("q")) SS_DELAY(225) SS_TAP(X_ESC)); - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } - } - return true; + return false; } diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c deleted file mode 100644 index 3e1fbcd8a561..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 "keymap_user_config.h" - -typedef struct { - uint8_t caps_lock_light_tab; - uint8_t caps_lock_light_alphas; - uint8_t fn_layer_transparent_keys_off; - uint8_t fn_layer_color_enable; - uint8_t enable_mac_base; - uint8_t enable_win_base; - uint8_t mode_win_base; - uint8_t spd_win_base; - HSV hsv_win_base; - HSV hsv_mac_fn1; - HSV hsv_win_fn1; - HSV hsv_fn2; -} user_config_t; - -user_config_t user_config; - -void eeconfig_init_user(void) { - user_config.caps_lock_light_tab = DEFAULT_CAPS_LOCK_LIGHT_TAB; - user_config.caps_lock_light_alphas = DEFAULT_CAPS_LOCK_LIGHT_ALPHA; - user_config.fn_layer_transparent_keys_off = DEFAULT_FN_LAYER_TRANSPARENT_OFF; - user_config.fn_layer_color_enable = DEFAULT_FN_LAYER_SHOW_COLOR; - user_config.enable_mac_base = DEFAULT_RGB_ENABLE_MAC_BASE; - user_config.enable_win_base = DEFAULT_RGB_ENABLE_WIN_BASE; - user_config.mode_win_base = RGB_MATRIX_DEFAULT_MODE; - user_config.spd_win_base = RGB_MATRIX_DEFAULT_SPD; - user_config.hsv_win_base.h = DEFAULT_HUE_WIN_BASE; - user_config.hsv_win_base.s = RGB_MATRIX_DEFAULT_SAT; - user_config.hsv_win_base.v = RGB_MATRIX_DEFAULT_VAL; - user_config_write_eeprom(); -} - -void user_config_read_eeprom(void) { - eeconfig_read_user_datablock(&user_config); -} - -void user_config_write_eeprom(void) { - eeconfig_update_user_datablock(&user_config); -} - -// getters - -uint8_t user_config_get_caps_lock_light_tab(void) { - return user_config.caps_lock_light_tab; -} - -uint8_t user_config_get_caps_lock_light_alphas(void) { - return user_config.caps_lock_light_alphas; -} - -uint8_t user_config_get_fn_layer_transparent_keys_off(void) { - return user_config.fn_layer_transparent_keys_off; -} - -uint8_t user_config_get_fn_layer_color_enable(void) { - return user_config.fn_layer_color_enable; -} - -uint8_t user_config_get_enable_mac_base(void) { - return user_config.enable_mac_base; -} - -uint8_t user_config_get_enable_win_base(void) { - return user_config.enable_win_base; -} - -uint8_t user_config_get_mode_win_base(void) { - return user_config.mode_win_base; -} - -uint8_t user_config_get_spd_win_base(void) { - return user_config.spd_win_base; -} - -HSV user_config_get_hsv_win_base(void) { - return user_config.hsv_win_base; -} - -HSV user_config_get_hsv_mac_fn1(void) { - return user_config.hsv_mac_fn1; -} - -HSV user_config_get_hsv_win_fn1(void) { - return user_config.hsv_win_fn1; -} - -HSV user_config_get_hsv_fn2(void) { - return user_config.hsv_fn2; -} - -// setters - -void user_config_toggle_caps_lock_light_tab(void) { - user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit - user_config_write_eeprom(); -} - -void user_config_toggle_caps_lock_light_alphas(void) { - user_config.caps_lock_light_alphas ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_fn_layer_transparent_keys_off(void) { - user_config.fn_layer_transparent_keys_off ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_fn_layer_color_enable(void) { - user_config.fn_layer_color_enable ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_enable_mac_base(void) { - user_config.enable_mac_base ^= 1; - user_config_write_eeprom(); -} - -void user_config_toggle_enable_win_base(void) { - user_config.enable_win_base ^= 1; - user_config_write_eeprom(); -} - -void user_config_set_mode_win_base(uint8_t mode) { - user_config.mode_win_base = mode; - user_config_write_eeprom(); -} - -void user_config_set_spd_win_base(uint8_t spd) { - user_config.spd_win_base = spd; - user_config_write_eeprom(); -} - -void user_config_set_hsv_win_base(HSV hsv) { - user_config.hsv_win_base = hsv; - user_config_write_eeprom(); -} - -void user_config_set_hsv_mac_fn1(HSV hsv) { - user_config.hsv_mac_fn1 = hsv; - user_config_write_eeprom(); -} - -void user_config_set_hsv_win_fn1(HSV hsv) { - user_config.hsv_win_fn1 = hsv; - user_config_write_eeprom(); -} - -void user_config_set_hsv_fn2(HSV hsv) { - user_config.hsv_fn2 = hsv; - user_config_write_eeprom(); -} - - - - - - - - - diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h deleted file mode 100644 index 34d7560e48c7..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user_config.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 - -void user_config_read_eeprom(void); -void user_config_write_eeprom(void); - -// getters - -uint8_t user_config_get_caps_lock_light_tab(void); -uint8_t user_config_get_caps_lock_light_alphas(void); -uint8_t user_config_get_fn_layer_transparent_keys_off(void); -uint8_t user_config_get_fn_layer_color_enable(void); -uint8_t user_config_get_enable_mac_base(void); -uint8_t user_config_get_enable_win_base(void); -uint8_t user_config_get_mode_win_base(void); -uint8_t user_config_get_spd_win_base(void); -HSV user_config_get_hsv_win_base(void); -HSV user_config_get_hsv_mac_fn1(void); -HSV user_config_get_hsv_win_fn1(void); -HSV user_config_get_hsv_fn2(void); - -// setters - -void user_config_toggle_caps_lock_light_tab(void); -void user_config_toggle_caps_lock_light_alphas(void); -void user_config_toggle_fn_layer_transparent_keys_off(void); -void user_config_toggle_fn_layer_color_enable(void); -void user_config_toggle_enable_mac_base(void); -void user_config_toggle_enable_win_base(void); -void user_config_set_mode_win_base(uint8_t mode); -void user_config_set_spd_win_base(uint8_t spd); -void user_config_set_hsv_win_base(HSV hsv); -void user_config_set_hsv_mac_fn1(HSV hsv); -void user_config_set_hsv_win_fn1(HSV hsv); -void user_config_set_hsv_fn2(HSV hsv); - - diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h similarity index 99% rename from keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h rename to keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h index 35d2483aa677..1bb7421d6e41 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap_user.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h @@ -21,4 +21,4 @@ enum layers{ MAC_FN, WIN_BASE, WIN_FN -}; +}; \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c deleted file mode 100644 index 85fa58ed89da..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.c +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 "keychron_common.h" -#include "rgb_matrix_user.h" -#include "keymap_user.h" -#include "keymap_user_config.h" - -keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; - -void rgb_matrix_init_user(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - uint8_t led_index = g_led_config.matrix_co[row][col]; - if (led_index != NO_LED) { - led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; - } - } - } -} - -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif -#ifdef CAPS_WORD_INDICATOR_COLOR - if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); - } -#endif - break; - case MAC_FN: - case WIN_FN: -#ifdef FN1_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} - -void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { - for (uint8_t i = led_min; i < led_max; i++) { - uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); - if ((*is_keycode)(keycode)) { - rgb_matrix_set_color(i, red, green, blue); - } - } -} - -bool is_caps_lock_indicator(uint16_t keycode) { - bool indicator = keycode == KC_CAPS; - - if (user_config_get_caps_lock_light_tab()) { - indicator = keycode == KC_TAB || keycode == KC_CAPS; - } - - if (user_config_get_caps_lock_light_alphas()) { - return (KC_A <= keycode && keycode <= KC_Z) || indicator; - } else { - return indicator; - } -} - -bool is_caps_word_indicator(uint16_t keycode) { - bool indicator = keycode == KC_LSFT; -#ifdef CAPS_WORD_LIGHT_LOWER_LEFT_CORNER - indicator = keycode == KC_LSFT || keycode == KC_LCTL || keycode == KC_LOPTN; -#endif - return indicator; -} - -bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } -bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h deleted file mode 100644 index c6d5e65548d6..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rgb_matrix_user.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) - * - * 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 - -void rgb_matrix_init_user(void); -void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); -bool is_caps_lock_indicator(uint16_t keycode); -bool is_caps_word_indicator(uint16_t keycode); -bool is_transparent(uint16_t keycode); -bool is_not_transparent(uint16_t keycode); diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk index b54f6bf491b3..4a5837600bce 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk @@ -3,11 +3,5 @@ ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes -SRC += keymap_user_config.c - -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - SRC += rgb_matrix_user.c -endif - VPATH += keyboards/keychron/common SRC += keychron_common.c From 5e45ab819265a9a53d0235100ed43251be426d4c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 00:19:43 -0400 Subject: [PATCH 125/160] moved rgb_matrix_indicators_advanced_user to userspace folder --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 38 ------------------- .../ansi_encoder/keymaps/mkillewald/layers.h | 6 ++- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index b3fff77f2cf1..b73dc4956a4f 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -68,14 +68,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { }; #endif -void matrix_init_user(void) { - matrix_init_mkillewald(); -} - -void keyboard_post_init_user(void) { - keyboard_post_init_mkillewald(); -} - void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_mkillewald(); @@ -87,33 +79,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif -#ifdef CAPS_WORD_INDICATOR_COLOR - if (is_caps_word_on()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_word_indicator, CAPS_WORD_INDICATOR_COLOR); - } -#endif - break; - case MAC_FN: - case WIN_FN: -#ifdef FN1_LAYER_COLOR - if (user_config_get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN1_LAYER_COLOR); - } -#endif - if (user_config_get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h index 1bb7421d6e41..e8c6222cac4d 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h @@ -21,4 +21,8 @@ enum layers{ MAC_FN, WIN_BASE, WIN_FN -}; \ No newline at end of file +}; + +#define MAC_FN1 MAC_FN +#define WIN_FN1 WIN_FN +#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key \ No newline at end of file From 87ae595287afb728742273bb91ef05d4454e30f7 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 26 Apr 2023 20:04:53 -0400 Subject: [PATCH 126/160] moved VIA_ENABLE into userspace folder --- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk index 4a5837600bce..a4066ebf79e1 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/rules.mk @@ -1,4 +1,3 @@ -VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes From 08e1dafae4f967b9f20ba90be03db36c844c2244 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 2 May 2023 18:31:21 -0400 Subject: [PATCH 127/160] updated readme.md and added photo --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 7d209f223fe0..105443ab9fcb 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -1,6 +1,9 @@ ## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.1 -### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. +Keychron Q1 ANSI + +### Highly Recommended: +When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. @@ -142,4 +145,4 @@ v1.0.0 September 30, 2021 - Initial release built upon keymap by Grayson Carr (gtg465x) - defined Mission Control (F3) and Launchpad (F4) keycodes for macOs - RGB backlight turns off when computer sleeps -- added Caps Lock indicator lighting both the Caps Lock and Tab LEDs for better effect on non-backlit keycaps \ No newline at end of file +- added Caps Lock indicator lighting both the Caps Lock and Tab LEDs for better effect on non-backlit keycaps From cffc3755188760a50afa214ae125cbb5a25fafca Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 2 May 2023 18:35:35 -0400 Subject: [PATCH 128/160] updated readme.md and added photo --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 3f628c7975ca..03f6a71345c0 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,10 @@ ## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.1 -### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. +Keychron Q2 ANSI encoder + +### Highly Recommended: +When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. + ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. From d7c29b0cd41b23eb3afc59b8a5c3c1b31504c51e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 2 May 2023 18:49:20 -0400 Subject: [PATCH 129/160] updated readme.md and added photo --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 23ccf7e8c14a..6851673ea389 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,9 @@ -## Keychron Q1 RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.1 +## Keychron Q1 Special Edition RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.1 -### Highly Recommended: You should clear your eeprom before or after flashing this firmware. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing your eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear your eeprom even if you take it out of DFU mode at this point without flashing. +Keychron Q1SE ANSI encoder + +### Highly Recommended: +When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. From fd1c6146f874df159eef82226de167d554033bb8 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 8 May 2023 14:30:32 -0400 Subject: [PATCH 130/160] added keychron factory reset and LED test --- .../q1/ansi/keymaps/mkillewald/keymap.c | 6 +- .../q1/ansi/keymaps/mkillewald/layers.h | 6 +- .../ansi_encoder/keymaps/mkillewald/keymap.c | 4 +- .../ansi_encoder/keymaps/mkillewald/layers.h | 6 +- .../ansi_encoder/keymaps/mkillewald/keymap.c | 3 + .../ansi_encoder/keymaps/mkillewald/layers.h | 8 +- users/mkillewald/myfork_keychron_ft.c | 273 ++++++++++++++++++ users/mkillewald/myfork_keychron_ft.h | 57 ++++ users/mkillewald/rgb_matrix_user.c | 2 + users/mkillewald/rules.mk | 1 + 10 files changed, 360 insertions(+), 6 deletions(-) create mode 100644 users/mkillewald/myfork_keychron_ft.c create mode 100644 users/mkillewald/myfork_keychron_ft.h diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 48865327f3f4..13fcec876602 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "myfork_keychron_ft.h" #include "mkillewald.h" #include "eeprom_user_config.h" #include "rgb_matrix_user.h" @@ -63,12 +64,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); + housekeeping_task_keychron_ft(); housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_keychron_ft(keycode, record)) { return false; } if (!process_record_mkillewald(keycode, record)) { return false; } return true; -} - +} \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h index e8c6222cac4d..8ae62607b0aa 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h @@ -25,4 +25,8 @@ enum layers{ #define MAC_FN1 MAC_FN #define WIN_FN1 WIN_FN -#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key \ No newline at end of file +#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key + +/* Factory test keys */ +#define FN_KEY1 MO(MAC_FN) +#define FN_KEY2 MO(WIN_FN) \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index b73dc4956a4f..85bc21da51a5 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "myfork_keychron_ft.h" #include "mkillewald.h" #include "eeprom_user_config.h" #include "rgb_matrix_user.h" @@ -70,12 +71,13 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); + housekeeping_task_keychron_ft(); housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_keychron_ft(keycode, record)) { return false; } if (!process_record_mkillewald(keycode, record)) { return false; } return true; } - diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h index e8c6222cac4d..8ae62607b0aa 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h @@ -25,4 +25,8 @@ enum layers{ #define MAC_FN1 MAC_FN #define WIN_FN1 WIN_FN -#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key \ No newline at end of file +#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key + +/* Factory test keys */ +#define FN_KEY1 MO(MAC_FN) +#define FN_KEY2 MO(WIN_FN) \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 807d4839a0f9..578c3f97b826 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "myfork_keychron_ft.h" #include "mkillewald.h" #include "eeprom_user_config.h" #include "rgb_matrix_user.h" @@ -77,11 +78,13 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); + housekeeping_task_keychron_ft(); housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_keychron_ft(keycode, record)) { return false; } if (!process_record_mkillewald(keycode, record)) { return false; } return true; } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h index 6437275a966b..7cae968fa0e1 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h @@ -14,6 +14,7 @@ * along with this program. If not, see . */ +#pragma once enum layers{ MAC_BASE, // Mac Base (layer 0) @@ -25,4 +26,9 @@ enum layers{ #define MAC_FN1 _FN1 #define WIN_FN1 _FN2 -#define MAC_WIN_FN2 _FN3 \ No newline at end of file +#define MAC_WIN_FN2 _FN3 + +/* Factory test keys */ +#define FN_KEY1 MO(_FN1) +#define FN_KEY2 MO(_FN2) +#define FN_KEY3 MO(_FN3) \ No newline at end of file diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c new file mode 100644 index 000000000000..1be0bfe39b16 --- /dev/null +++ b/users/mkillewald/myfork_keychron_ft.c @@ -0,0 +1,273 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * forked from keychron_ft_common.c (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "myfork_keychron_ft.h" +#include "mkillewald.h" +#include "layers.h" + +#ifndef BL_TEST_KEY1 +# define BL_TEST_KEY1 KC_RIGHT +#endif + +#ifndef BL_TEST_KEY2 +# define BL_TEST_KEY2 KC_HOME +#endif + +// clang-format off +enum { + FACTORY_TEST_CMD_BACKLIGHT = 0x01, + FACTORY_TEST_CMD_JUMP_TO_BL, + FACTORY_TEST_CMD_EEPROM_CLEAR +}; +// clang-format on + +uint16_t key_press_status = 0; +uint32_t timer_3s_buffer = 0; +uint32_t timer_300ms_buffer = 0; +uint8_t factory_reset_count = 0; +extern matrix_row_t matrix[MATRIX_ROWS]; + +#ifdef SPLIT_KEYBOARD +# ifdef RGB_MATRIX_ENABLE +uint8_t led_state = 0; +uint8_t light_test_state = 0; +HSV hsv; +# endif +#endif + +__attribute__((weak)) +bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { +#if defined(FN_KEY1) || defined(FN_KEY2) || defined(FN_KEY3) +# ifdef FN_KEY1 + case FN_KEY1: /* fall through */ +# endif +# ifdef FN_KEY2 + case FN_KEY2: +# endif +# ifdef FN_KEY3 + case FN_KEY3: +# endif + if (record->event.pressed) { + key_press_status |= KEY_PRESS_STEP_0; + } else { + key_press_status &= ~KEY_PRESS_STEP_0; + timer_3s_buffer = 0; + } + return true; +#endif + case KC_J: + if (record->event.pressed) { + key_press_status |= KEY_PRESS_STEP_1; + if (key_press_status == KEY_PRESS_FACTORY_RESET) { + timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + } + } else { + key_press_status &= ~KEY_PRESS_STEP_1; + timer_3s_buffer = 0; + } + return true; + case KC_Z: + case KC_LTTOG: + if (record->event.pressed) { + key_press_status |= KEY_PRESS_STEP_2; + if (key_press_status == KEY_PRESS_FACTORY_RESET) { + timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + } + } else { + key_press_status &= ~KEY_PRESS_STEP_2; + timer_3s_buffer = 0; + } + return true; + case BL_TEST_KEY1: // KC_RIGHT + if (record->event.pressed) { + key_press_status |= KEY_PRESS_STEP_3; + if (led_test_mode) { + if (++led_test_mode >= LED_TEST_MODE_MAX) { + led_test_mode = LED_TEST_MODE_WHITE; + } + } else if (key_press_status == KEY_PRESS_LED_TEST) { + timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + } + } else { + key_press_status &= ~KEY_PRESS_STEP_3; + timer_3s_buffer = 0; + } + return true; + case BL_TEST_KEY2: // KC_HOME + if (record->event.pressed) { + key_press_status |= KEY_PRESS_STEP_4; + if (led_test_mode) { + led_test_mode = LED_TEST_MODE_OFF; + } else if (key_press_status == KEY_PRESS_LED_TEST) { + timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + } + } else { + key_press_status &= ~KEY_PRESS_STEP_4; + timer_3s_buffer = 0; + } + return true; + default: + return true; + } +} + +static void factory_reset(void) { + timer_300ms_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + factory_reset_count++; + layer_state_t default_layer = default_layer_state; + eeconfig_init(); + default_layer_set(default_layer); + led_test_mode = LED_TEST_MODE_OFF; +#ifdef LED_MATRIX_ENABLE + if (!led_matrix_is_enabled()) { + led_matrix_enable(); + } + led_matrix_init(); +#endif +#ifdef RGB_MATRIX_ENABLE + if (!rgb_matrix_is_enabled()) { + rgb_matrix_enable(); + } + rgb_matrix_init(); +# ifdef SPLIT_KEYBOARD + led_state = rgb_matrix_get_mode(); + hsv = rgb_matrix_get_hsv(); + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); +# endif +#endif +} + +static void timer_3s_task(void) { + if (sync_timer_elapsed32(timer_3s_buffer) > 3000) { + timer_3s_buffer = 0; + if (key_press_status == KEY_PRESS_FACTORY_RESET) { + factory_reset(); + } else if (key_press_status == KEY_PRESS_LED_TEST) { +#ifdef SPLIT_KEYBOARD + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); +#endif + led_test_mode = LED_TEST_MODE_WHITE; +#ifdef LED_MATRIX_ENABLE + if (!led_matrix_is_enabled()) { + led_matrix_enable(); + } +#endif +#ifdef RGB_MATRIX_ENABLE + if (!rgb_matrix_is_enabled()) { + rgb_matrix_enable(); + } +#endif + } + key_press_status = 0; + } +} + +static void timer_300ms_task(void) { + if (sync_timer_elapsed32(timer_300ms_buffer) > 300) { + if (factory_reset_count++ > 6) { + timer_300ms_buffer = 0; + factory_reset_count = 0; +#ifdef SPLIT_KEYBOARD + rgb_matrix_mode_noeeprom(led_state); + rgb_matrix_sethsv_noeeprom(hsv.h, hsv.s, hsv.v); +#endif + } else { + timer_300ms_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + } + } +} + +#ifdef LED_MATRIX_ENABLE +bool led_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max) { + if (factory_reset_count) { + for (uint8_t i = led_min; i <= led_max; i++) { + led_matrix_set_value(i, factory_reset_count % 2 ? 0 : UINT8_MAX); + } + } + return true; +} +#endif + +#ifdef RGB_MATRIX_ENABLE +bool rgb_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max) { + if (factory_reset_count) { + if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { + if (factory_reset_count % 2) { + rgb_matrix_sethsv_noeeprom(HSV_RED); + } else { + rgb_matrix_sethsv_noeeprom(HSV_OFF); + } + } else { + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, factory_reset_count % 2 ? 0 : RGB_RED); + } + } + } else if (led_test_mode) { + switch (led_test_mode) { + case LED_TEST_MODE_WHITE: + if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { + rgb_matrix_sethsv_noeeprom(HSV_WHITE); + } else { + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_WHITE); + } + } + break; + case LED_TEST_MODE_RED: + if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { + rgb_matrix_sethsv_noeeprom(HSV_RED); + } else { + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_RED); + } + } + break; + case LED_TEST_MODE_GREEN: + if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { + rgb_matrix_sethsv_noeeprom(HSV_GREEN); + } else { + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_GREEN); + } + } + break; + case LED_TEST_MODE_BLUE: + if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { + rgb_matrix_sethsv_noeeprom(HSV_BLUE); + } else { + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_BLUE); + } + } + break; + default: + break; + } + } + return true; +} +#endif + +void housekeeping_task_keychron_ft(void) { + if (timer_3s_buffer) { + timer_3s_task(); + } + if (timer_300ms_buffer) { + timer_300ms_task(); + } +} diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h new file mode 100644 index 000000000000..9994dcd56c94 --- /dev/null +++ b/users/mkillewald/myfork_keychron_ft.h @@ -0,0 +1,57 @@ +/* Copyright 2022 @ Keychron (https://github.com/mkillewald) + * forked from keychron_ft_common.h (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "quantum.h" + +#define KEY_PRESS_STEP_0 (0x1 << 0) +#define KEY_PRESS_STEP_1 (0x1 << 1) +#define KEY_PRESS_STEP_2 (0x1 << 2) +#define KEY_PRESS_STEP_3 (0x1 << 3) +#define KEY_PRESS_STEP_4 (0x1 << 4) +#define KEY_PRESS_FACTORY_RESET (KEY_PRESS_STEP_0 | KEY_PRESS_STEP_1 | KEY_PRESS_STEP_2) +#define KEY_PRESS_LED_TEST (KEY_PRESS_STEP_0 | KEY_PRESS_STEP_3 | KEY_PRESS_STEP_4) +// clang-format off +enum { + LED_TEST_MODE_OFF, + LED_TEST_MODE_WHITE, + LED_TEST_MODE_RED, + LED_TEST_MODE_GREEN, + LED_TEST_MODE_BLUE, + LED_TEST_MODE_MAX +} led_test_mode; +// clang-format on + +extern uint16_t key_press_status; +extern uint32_t timer_3s_buffer; +#ifdef SPLIT_KEYBOARD +# ifdef RGB_MATRIX_ENABLE +extern uint8_t led_state; +extern uint8_t light_test_state; +extern HSV hsv; +# endif +#endif + +void housekeeping_task_keychron_ft(void); +bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record); + +#ifdef LED_MATRIX_ENABLE +bool led_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max); +#endif + +#ifdef RGB_MATRIX_ENABLE +bool rgb_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max); +#endif \ No newline at end of file diff --git a/users/mkillewald/rgb_matrix_user.c b/users/mkillewald/rgb_matrix_user.c index 2b5c257e94c9..969dcb7bbe5e 100644 --- a/users/mkillewald/rgb_matrix_user.c +++ b/users/mkillewald/rgb_matrix_user.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "myfork_keychron_ft.h" #include "rgb_matrix_user.h" #include "eeprom_user_config.h" #include "layers.h" @@ -62,6 +63,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { set_fn2_layer_color(led_min, led_max, current_layer); break; } + rgb_matrix_indicators_advanced_keychron_ft(led_min, led_max); return rgb_matrix_indicators_advanced_keymap(led_min, led_max); } diff --git a/users/mkillewald/rules.mk b/users/mkillewald/rules.mk index 2d2b486d62a4..7667847e6864 100644 --- a/users/mkillewald/rules.mk +++ b/users/mkillewald/rules.mk @@ -3,6 +3,7 @@ VIA_ENABLE = yes SRC += mkillewald.c SRC += eeprom_user_config.c +SRC += myfork_keychron_ft.c ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) SRC += rgb_matrix_user.c From 7a1673cb72920079889f44222be1e6639161eae5 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 09:54:18 -0400 Subject: [PATCH 131/160] moved factory test key assignments to layers.h --- .../q1/ansi/keymaps/mkillewald/keymap.c | 2 - .../q1/ansi/keymaps/mkillewald/layers.h | 13 ++++++- .../ansi_encoder/keymaps/mkillewald/keymap.c | 2 - .../ansi_encoder/keymaps/mkillewald/layers.h | 13 ++++++- .../ansi_encoder/keymaps/mkillewald/keymap.c | 2 - .../ansi_encoder/keymaps/mkillewald/layers.h | 13 +++++-- users/mkillewald/myfork_keychron_ft.c | 39 ++++++++++--------- 7 files changed, 53 insertions(+), 31 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 13fcec876602..28f36142e2c5 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -18,8 +18,6 @@ #include "keychron_common.h" #include "myfork_keychron_ft.h" #include "mkillewald.h" -#include "eeprom_user_config.h" -#include "rgb_matrix_user.h" #include "layers.h" // clang-format off diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h index 8ae62607b0aa..e8733b342526 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h @@ -16,6 +16,8 @@ #pragma once +#include "mkillewald.h" + enum layers{ MAC_BASE, MAC_FN, @@ -28,5 +30,12 @@ enum layers{ #define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key /* Factory test keys */ -#define FN_KEY1 MO(MAC_FN) -#define FN_KEY2 MO(WIN_FN) \ No newline at end of file +#define FN_KEY1 MO(MAC_FN) // Fn Mac Base +#define FN_KEY2 MO(WIN_FN) // Fn Win Base + +#define RESET_KEY1 KC_J +#define RESET_KEY2 KC_Z +#define RESET_KEY2_ALT KC_LTTOG + +#define BL_TEST_KEY1 KC_RIGHT +#define BL_TEST_KEY2 KC_HOME \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 85bc21da51a5..2d8b3b14b0ff 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -18,8 +18,6 @@ #include "keychron_common.h" #include "myfork_keychron_ft.h" #include "mkillewald.h" -#include "eeprom_user_config.h" -#include "rgb_matrix_user.h" #include "layers.h" // clang-format off diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h index 8ae62607b0aa..e8733b342526 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/layers.h @@ -16,6 +16,8 @@ #pragma once +#include "mkillewald.h" + enum layers{ MAC_BASE, MAC_FN, @@ -28,5 +30,12 @@ enum layers{ #define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key /* Factory test keys */ -#define FN_KEY1 MO(MAC_FN) -#define FN_KEY2 MO(WIN_FN) \ No newline at end of file +#define FN_KEY1 MO(MAC_FN) // Fn Mac Base +#define FN_KEY2 MO(WIN_FN) // Fn Win Base + +#define RESET_KEY1 KC_J +#define RESET_KEY2 KC_Z +#define RESET_KEY2_ALT KC_LTTOG + +#define BL_TEST_KEY1 KC_RIGHT +#define BL_TEST_KEY2 KC_HOME \ No newline at end of file diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 578c3f97b826..2a92fff47a53 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -18,8 +18,6 @@ #include "keychron_common.h" #include "myfork_keychron_ft.h" #include "mkillewald.h" -#include "eeprom_user_config.h" -#include "rgb_matrix_user.h" #include "layers.h" // clang-format off diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h index 7cae968fa0e1..6658d02a8bf7 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/layers.h @@ -29,6 +29,13 @@ enum layers{ #define MAC_WIN_FN2 _FN3 /* Factory test keys */ -#define FN_KEY1 MO(_FN1) -#define FN_KEY2 MO(_FN2) -#define FN_KEY3 MO(_FN3) \ No newline at end of file +#define FN_KEY1 MO(_FN1) // Fn1 Mac Base +#define FN_KEY2 MO(_FN2) // Fn1 Win Base + +#define RESET_KEY1 KC_J +#define RESET_KEY2 KC_Z + +#define BL_TEST_KEY1 KC_RIGHT +#define BL_TEST_KEY2 KC_PGDN +#define BL_TEST_KEY2_ALT1 G(KC_RIGHT) +#define BL_TEST_KEY2_ALT2 KC_END diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 1be0bfe39b16..2185ff6347a4 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -16,17 +16,8 @@ */ #include "myfork_keychron_ft.h" -#include "mkillewald.h" #include "layers.h" -#ifndef BL_TEST_KEY1 -# define BL_TEST_KEY1 KC_RIGHT -#endif - -#ifndef BL_TEST_KEY2 -# define BL_TEST_KEY2 KC_HOME -#endif - // clang-format off enum { FACTORY_TEST_CMD_BACKLIGHT = 0x01, @@ -52,15 +43,12 @@ HSV hsv; __attribute__((weak)) bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { switch (keycode) { -#if defined(FN_KEY1) || defined(FN_KEY2) || defined(FN_KEY3) +#if defined(FN_KEY1) || defined(FN_KEY2) # ifdef FN_KEY1 case FN_KEY1: /* fall through */ # endif # ifdef FN_KEY2 case FN_KEY2: -# endif -# ifdef FN_KEY3 - case FN_KEY3: # endif if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_0; @@ -70,7 +58,11 @@ bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { } return true; #endif - case KC_J: +#if defined(RESET_KEY1) && defined(RESET_KEY2) + case RESET_KEY1: +# if defined(RESET_KEY1_ALT) + case RESET_KEY1_ALT: +# endif if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_1; if (key_press_status == KEY_PRESS_FACTORY_RESET) { @@ -81,8 +73,10 @@ bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { timer_3s_buffer = 0; } return true; - case KC_Z: - case KC_LTTOG: + case RESET_KEY2: +# if defined(RESET_KEY2_ALT) + case RESET_KEY2_ALT: +# endif if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_2; if (key_press_status == KEY_PRESS_FACTORY_RESET) { @@ -93,7 +87,9 @@ bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { timer_3s_buffer = 0; } return true; - case BL_TEST_KEY1: // KC_RIGHT +#endif +#if defined(BL_TEST_KEY1) && defined(BL_TEST_KEY2) + case BL_TEST_KEY1: if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_3; if (led_test_mode) { @@ -108,7 +104,13 @@ bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { timer_3s_buffer = 0; } return true; - case BL_TEST_KEY2: // KC_HOME + case BL_TEST_KEY2: +# if defined(BL_TEST_KEY2_ALT1) + case BL_TEST_KEY2_ALT1: +# endif +# if defined(BL_TEST_KEY2_ALT2) + case BL_TEST_KEY2_ALT2: +# endif if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_4; if (led_test_mode) { @@ -121,6 +123,7 @@ bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { timer_3s_buffer = 0; } return true; +#endif default: return true; } From 43c8ca36274e1f1b01fb9a8d78addab78ef405f7 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 12:09:20 -0400 Subject: [PATCH 132/160] now properly loads win mode rgb settings after factory reset --- users/mkillewald/mkillewald.c | 52 ++++++++++++++++----------- users/mkillewald/mkillewald.h | 3 ++ users/mkillewald/myfork_keychron_ft.c | 4 +++ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/users/mkillewald/mkillewald.c b/users/mkillewald/mkillewald.c index 8c3e99a2a026..e1d8a544834a 100644 --- a/users/mkillewald/mkillewald.c +++ b/users/mkillewald/mkillewald.c @@ -19,7 +19,7 @@ #include "rgb_matrix_user.h" #include "layers.h" -static bool win_mode; +static uint8_t win_mode; __attribute__ ((weak)) bool dip_switch_update_keymap(uint8_t index, bool active) { @@ -31,6 +31,8 @@ bool dip_switch_update_user(uint8_t index, bool active) { return dip_switch_update_keymap(index, active); } +uint8_t is_win_mode(void) { return win_mode; } + __attribute__ ((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; @@ -39,28 +41,10 @@ layer_state_t default_layer_state_set_keymap(layer_state_t state) { layer_state_t default_layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case MAC_BASE: - // load mac base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_reload_from_eeprom(); - - // check disable - if (!user_config_get_enable_mac_base()) { - rgb_matrix_disable_noeeprom(); - } + set_mac_base_rgb(); break; case WIN_BASE: - // load win base settings - rgb_matrix_enable_noeeprom(); - rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); - rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); - rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, - user_config_get_hsv_win_base().s, - user_config_get_hsv_win_base().v); - - // check disable - if (!user_config_get_enable_win_base()) { - rgb_matrix_disable_noeeprom(); - } + set_win_base_rgb(); break; default: break; @@ -68,6 +52,32 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return default_layer_state_set_keymap(state); } +void set_mac_base_rgb(void) { + // load mac base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_reload_from_eeprom(); + + // check disable + if (!user_config_get_enable_mac_base()) { + rgb_matrix_disable_noeeprom(); + } +} + +void set_win_base_rgb(void) { + // load win base settings + rgb_matrix_enable_noeeprom(); + rgb_matrix_mode_noeeprom(user_config_get_mode_win_base()); + rgb_matrix_set_speed_noeeprom(user_config_get_spd_win_base()); + rgb_matrix_sethsv_noeeprom(user_config_get_hsv_win_base().h, + user_config_get_hsv_win_base().s, + user_config_get_hsv_win_base().v); + + // check disable + if (!user_config_get_enable_win_base()) { + rgb_matrix_disable_noeeprom(); + } +} + __attribute__ ((weak)) void matrix_init_keymap(void) { return; diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h index d912001c5c57..d57add2527e9 100644 --- a/users/mkillewald/mkillewald.h +++ b/users/mkillewald/mkillewald.h @@ -40,6 +40,9 @@ enum my_keycodes { #define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE #define KC_LBMAC KC_LOCK_BLANK_MAC +uint8_t is_win_mode(void); +void set_mac_base_rgb(void); +void set_win_base_rgb(void); void housekeeping_task_mkillewald(void); bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record); diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 2185ff6347a4..5d6d24bde3ca 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -16,6 +16,7 @@ */ #include "myfork_keychron_ft.h" +#include "mkillewald.h" #include "layers.h" // clang-format off @@ -160,6 +161,9 @@ static void timer_3s_task(void) { timer_3s_buffer = 0; if (key_press_status == KEY_PRESS_FACTORY_RESET) { factory_reset(); +#ifdef RGB_ENABLE + if (is_win_mode()) { set_win_base_rgb(); } +#endif } else if (key_press_status == KEY_PRESS_LED_TEST) { #ifdef SPLIT_KEYBOARD rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); From 63dea96f1501a60218c122be9fa5d00b5ef93345 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 12:15:56 -0400 Subject: [PATCH 133/160] LED test no longer overwrites user's RGB settings on exit --- users/mkillewald/myfork_keychron_ft.c | 32 +++++++-------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 5d6d24bde3ca..0b485e36d7e8 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -227,39 +227,23 @@ bool rgb_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max } else if (led_test_mode) { switch (led_test_mode) { case LED_TEST_MODE_WHITE: - if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { - rgb_matrix_sethsv_noeeprom(HSV_WHITE); - } else { - for (uint8_t i = led_min; i <= led_max; i++) { - rgb_matrix_set_color(i, RGB_WHITE); - } + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_WHITE); } break; case LED_TEST_MODE_RED: - if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { - rgb_matrix_sethsv_noeeprom(HSV_RED); - } else { - for (uint8_t i = led_min; i <= led_max; i++) { - rgb_matrix_set_color(i, RGB_RED); - } + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_RED); } break; case LED_TEST_MODE_GREEN: - if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { - rgb_matrix_sethsv_noeeprom(HSV_GREEN); - } else { - for (uint8_t i = led_min; i <= led_max; i++) { - rgb_matrix_set_color(i, RGB_GREEN); - } + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_GREEN); } break; case LED_TEST_MODE_BLUE: - if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { - rgb_matrix_sethsv_noeeprom(HSV_BLUE); - } else { - for (uint8_t i = led_min; i <= led_max; i++) { - rgb_matrix_set_color(i, RGB_BLUE); - } + for (uint8_t i = led_min; i <= led_max; i++) { + rgb_matrix_set_color(i, RGB_BLUE); } break; default: From 12162ad17437a18d320b9c30fac4310321850ad1 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 13:53:19 -0400 Subject: [PATCH 134/160] fixed ifdef with typo --- users/mkillewald/myfork_keychron_ft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 0b485e36d7e8..74fd3dc8c367 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -161,7 +161,7 @@ static void timer_3s_task(void) { timer_3s_buffer = 0; if (key_press_status == KEY_PRESS_FACTORY_RESET) { factory_reset(); -#ifdef RGB_ENABLE +#ifdef RGB_MATRIX_ENABLE if (is_win_mode()) { set_win_base_rgb(); } #endif } else if (key_press_status == KEY_PRESS_LED_TEST) { From 5ab71c4a35760433945c7ae5822091c3a063742b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 13:55:14 -0400 Subject: [PATCH 135/160] if LED test enabled RGB to run, it now properly disables RGB when exiting --- users/mkillewald/myfork_keychron_ft.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 74fd3dc8c367..70a4b7813f8d 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -116,6 +116,13 @@ bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { key_press_status |= KEY_PRESS_STEP_4; if (led_test_mode) { led_test_mode = LED_TEST_MODE_OFF; +# if defined(RGB_MATRIX_ENABLE) + if (is_win_mode()) { + set_win_base_rgb(); + } else { + set_mac_base_rgb(); + } +# endif } else if (key_press_status == KEY_PRESS_LED_TEST) { timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); } @@ -171,12 +178,12 @@ static void timer_3s_task(void) { led_test_mode = LED_TEST_MODE_WHITE; #ifdef LED_MATRIX_ENABLE if (!led_matrix_is_enabled()) { - led_matrix_enable(); + led_matrix_enable_noeeprom(); } #endif #ifdef RGB_MATRIX_ENABLE if (!rgb_matrix_is_enabled()) { - rgb_matrix_enable(); + rgb_matrix_enable_noeeprom(); } #endif } From 45002e69d7e53ab2bdc2fc6bc452116eda0bb517 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 14:09:43 -0400 Subject: [PATCH 136/160] added _myfork to keychron_ft function names --- .../q1/ansi/keymaps/mkillewald/keymap.c | 4 ++-- .../ansi_encoder/keymaps/mkillewald/keymap.c | 4 ++-- .../ansi_encoder/keymaps/mkillewald/keymap.c | 4 ++-- users/mkillewald/myfork_keychron_ft.c | 24 +++++++++---------- users/mkillewald/myfork_keychron_ft.h | 8 +++---- users/mkillewald/rgb_matrix_user.c | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 28f36142e2c5..e2fce55cc914 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -62,13 +62,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_keychron_ft(); + housekeeping_task_myfork_keychron_ft(); housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_keychron_ft(keycode, record)) { return false; } + if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } if (!process_record_mkillewald(keycode, record)) { return false; } return true; } \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 2d8b3b14b0ff..6565373a24e3 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -69,13 +69,13 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_keychron_ft(); + housekeeping_task_myfork_keychron_ft(); housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_keychron_ft(keycode, record)) { return false; } + if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } if (!process_record_mkillewald(keycode, record)) { return false; } return true; } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 2a92fff47a53..1b74978fe61d 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -76,13 +76,13 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_keychron_ft(); + housekeeping_task_myfork_keychron_ft(); housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_keychron_ft(keycode, record)) { return false; } + if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } if (!process_record_mkillewald(keycode, record)) { return false; } return true; } diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 70a4b7813f8d..a6b8cbbe7efa 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -42,7 +42,7 @@ HSV hsv; #endif __attribute__((weak)) -bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record) { +bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { switch (keycode) { #if defined(FN_KEY1) || defined(FN_KEY2) # ifdef FN_KEY1 @@ -206,8 +206,17 @@ static void timer_300ms_task(void) { } } +void housekeeping_task_myfork_keychron_ft(void) { + if (timer_3s_buffer) { + timer_3s_task(); + } + if (timer_300ms_buffer) { + timer_300ms_task(); + } +} + #ifdef LED_MATRIX_ENABLE -bool led_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max) { +bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max) { if (factory_reset_count) { for (uint8_t i = led_min; i <= led_max; i++) { led_matrix_set_value(i, factory_reset_count % 2 ? 0 : UINT8_MAX); @@ -218,7 +227,7 @@ bool led_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max #endif #ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max) { if (factory_reset_count) { if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { if (factory_reset_count % 2) { @@ -260,12 +269,3 @@ bool rgb_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max return true; } #endif - -void housekeeping_task_keychron_ft(void) { - if (timer_3s_buffer) { - timer_3s_task(); - } - if (timer_300ms_buffer) { - timer_300ms_task(); - } -} diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h index 9994dcd56c94..bdda7c2d4398 100644 --- a/users/mkillewald/myfork_keychron_ft.h +++ b/users/mkillewald/myfork_keychron_ft.h @@ -45,13 +45,13 @@ extern HSV hsv; # endif #endif -void housekeeping_task_keychron_ft(void); -bool process_record_keychron_ft(uint16_t keycode, keyrecord_t *record); +bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record); +void housekeeping_task_myfork_keychron_ft(void); #ifdef LED_MATRIX_ENABLE -bool led_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max); +bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max); #endif #ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_advanced_keychron_ft(uint8_t led_min, uint8_t led_max); +bool rgb_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max); #endif \ No newline at end of file diff --git a/users/mkillewald/rgb_matrix_user.c b/users/mkillewald/rgb_matrix_user.c index 969dcb7bbe5e..63350e062047 100644 --- a/users/mkillewald/rgb_matrix_user.c +++ b/users/mkillewald/rgb_matrix_user.c @@ -63,7 +63,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { set_fn2_layer_color(led_min, led_max, current_layer); break; } - rgb_matrix_indicators_advanced_keychron_ft(led_min, led_max); + rgb_matrix_indicators_advanced_myfork_keychron_ft(led_min, led_max); return rgb_matrix_indicators_advanced_keymap(led_min, led_max); } From f034fb1ff544391da1f00ffd0a3fa12aafcf5461 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 15:41:16 -0400 Subject: [PATCH 137/160] updated readme --- .../q1/ansi/keymaps/mkillewald/readme.md | 25 ++++++---- .../ansi_encoder/keymaps/mkillewald/readme.md | 25 ++++++---- .../ansi_encoder/keymaps/mkillewald/readme.md | 48 ++++++++++--------- 3 files changed, 56 insertions(+), 42 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 105443ab9fcb..cfc410651e8e 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -1,4 +1,4 @@ -## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.1 +## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.2 Keychron Q1 ANSI @@ -8,7 +8,16 @@ When you flash this firmware for the first time, you should clear the eeprom bef ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. +- Retains Keychron factory reset: + - Hold Fn+J+Z for 4 seconds. The RGB LEDs will flash red to indicate that the reset has occurred. + - This will clear the eeprom which returns RGB settings back to defaults and erases any changes made with VIA. + +- Retains Keychron LED test: + - Hold Fn+Right+Home for 4 seconds. The RGB LEDs will all turn white. + - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. + - Press Home to exit + +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Uses getreuer's autocorrect dictionary. @@ -69,7 +78,7 @@ Caps Word options: ``` // Caps Word RGB indicator color #define CAPS_WORD_INDICATOR_COLOR RGB_WHITE - + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. @@ -109,18 +118,14 @@ All custom keycodes can be moved to different keys in VIA by using the following - CUSTOM(67) = KC_FCTOG (default: Fn+V) Fn layer Color Toggle - CUSTOM(68) = KC_LBMAC (default Mac Only: Fn+Esc) Lock and Blank Mac -## Known Issues - -1. Keychron factory reset (clear eeprom) Fn+J+Z is not working -2. Keychron LED test Fn+Home+Right is not working - -It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. - #### USE AT YOUR OWN RISK ## Changelog: +v2.0.2 May 9, 2023 +- added Keychron factory reset and LED test + v2.0.1 April 11, 2023 - enabled separate RGB toggle for each base layer (Mac / Win) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 6851673ea389..7db18c9371cb 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,4 +1,4 @@ -## Keychron Q1 Special Edition RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.1 +## Keychron Q1 Special Edition RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.2 Keychron Q1SE ANSI encoder @@ -8,7 +8,16 @@ When you flash this firmware for the first time, you should clear the eeprom bef ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. +- Retains Keychron factory reset: + - Hold Fn+J+Z for 4 seconds. The RGB LEDs will flash red to indicate that the reset has occurred. + - This will clear the eeprom which returns RGB settings back to defaults and erases any changes made with VIA. + +- Retains Keychron LED test: + - Hold Fn+Right+Home for 4 seconds. The RGB LEDs will all turn white. + - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. + - Press Home to exit + +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Uses getreuer's autocorrect dictionary. @@ -69,7 +78,7 @@ Caps Word options: ``` // Caps Word RGB indicator color #define CAPS_WORD_INDICATOR_COLOR RGB_RED - + // Caps Word is activated by double-tapping left Shift. Replace this with // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word // by single-tapping both left and right Shift togeter. @@ -109,18 +118,14 @@ All custom keycodes can be moved to different keys in VIA by using the following - CUSTOM(67) = KC_FCTOG (default: Fn+V) Fn layer Color Toggle - CUSTOM(68) = KC_LBMAC (default Mac Only: Fn+Esc) Lock and Blank Mac -## Known Issues - -1. Keychron factory reset (clear eeprom) Fn+J+Z is not working -2. Keychron LED test Fn+Home+Right is not working - -It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. - #### USE AT YOUR OWN RISK ## Changelog: +v2.0.2 May 9, 2023 +- added Keychron factory reset and LED test + v2.0.1 April 11, 2023 - enabled separate RGB toggle for each base layer (Mac / Win) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 03f6a71345c0..899ddeb9f70c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,18 +1,26 @@ -## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.1 +## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.2 Keychron Q2 ANSI encoder ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. - ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. -- SEVERED! Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for the Mac and Win base layers using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) +- Retains Keychron factory reset: + - Hold Fn1+J+Z for 4 seconds. The RGB LEDs will flash red to indicate that the reset has occurred. + - This will clear the eeprom which returns RGB settings back to defaults and erases any changes made with VIA. + +- Retains Keychron LED test: + - Hold Fn1+Right+PgUp for 4 seconds. The RGB LEDs will all turn white. + - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. + - Press PgUp to exit + +- SEVERED! Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - - Uses getreuer's 400 entry autocorrect dictionary. + - Uses getreuer's 400 entry autocorrect dictionary. [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) - Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) @@ -21,7 +29,7 @@ When you flash this firmware for the first time, you should clear the eeprom bef - Dynamic Fn layer RGB indicator. When either Fn1 or Fn2 is held down, any keys defined on the Fn layers in this firmware or in VIA will be highlighted. -##### Notes: +##### Notes: ###### Toggling RGB mode off will disable RGB and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. ###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. @@ -43,7 +51,7 @@ Default options (these defaults will be applied whenever the eeprom is cleared): #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers -``` +``` Autocorrect option: @@ -72,9 +80,9 @@ Caps Word options: // Caps Word RGB indicator color #define CAPS_WORD_INDICATOR_COLOR RGB_RED - // Caps Word is activated by double-tapping left Shift. Replace this with - // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word - // by single-tapping both left and right Shift togeter. + // Caps Word is activated by double-tapping left Shift. Replace this with + // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word + // by single-tapping both left and right Shift togeter. #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD // Caps Word will light left Shift, left Control and left Option (or left Windows @@ -89,13 +97,13 @@ Caps Word options: - Fn2+Left Shift toggles Autocorrect on/off - Fn2+Backspace enters DFU mode (but does not reset eeprom) - Fn2+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) - - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. + - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. - Fn2+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) - - toggle lighting all the alpha keys when Caps Lock is enabled. + - toggle lighting all the alpha keys when Caps Lock is enabled. - Fn2+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) - - toggle turning off RGB for keys with no definition + - toggle turning off RGB for keys with no definition - Fn2+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) - - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR or FN2_LAYER_COLOR - Uses Grave Escape on key to the left of the 1 key: - Base Layer: key functions as ESC, shift+key gives ~ @@ -116,8 +124,8 @@ Caps Word options: - Fn1+Q (KC_LBMAC) will lock and sleep display - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation - - Note: display rotation requires additional software and changes made, see this link for more information: + + Note: display rotation requires additional software and changes made, see this link for more information: [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) All custom keycodes can be moved to different keys in VIA by using the following: @@ -127,18 +135,14 @@ All custom keycodes can be moved to different keys in VIA by using the following - CUSTOM(67) = KC_FCTOG (default: Fn2+V) Fn layer Color Toggle - CUSTOM(68) = KC_LBMAC (default Mac Only: Fn1+Q) Lock and Blank Mac -## Known Issues - -1. Keychron factory reset (clear eeprom) Fn1+J+Z is not working -2. Keychron LED test Fn1+Home+Right is not working - -It seems Keychron has not pushed the relavant code to the main QMK repo yet. I see the code is in Keychron's fork, and I may manually add that code here at some point. - #### USE AT YOUR OWN RISK ## Changelog: +v2.0.2 May 9, 2023 +- added Keychron factory reset and LED test + v2.0.1 April 11, 2023 - enabled separate RGB toggle for each base layer (Mac / Win) From d71756ad565fc670c900e9e2970c0e2b746f8291 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 15:46:09 -0400 Subject: [PATCH 138/160] corrected LED test key combos --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 899ddeb9f70c..6a6c5a7ff1f4 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -13,9 +13,9 @@ When you flash this firmware for the first time, you should clear the eeprom bef - This will clear the eeprom which returns RGB settings back to defaults and erases any changes made with VIA. - Retains Keychron LED test: - - Hold Fn1+Right+PgUp for 4 seconds. The RGB LEDs will all turn white. + - Hold Fn1+Right+PgDn for 4 seconds. The RGB LEDs will all turn white. - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. - - Press PgUp to exit + - Press PgDn to exit - SEVERED! Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. (Hi kids, whats for dinner?) From 7e52d7adb7c09428c56f67c47da90fd2051609cb Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 20:04:37 -0400 Subject: [PATCH 139/160] updated readme --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index cfc410651e8e..4611f04ad3a5 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -3,7 +3,7 @@ Keychron Q1 ANSI ### Highly Recommended: -When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. +When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 7db18c9371cb..adbabd3d1b02 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -3,7 +3,7 @@ Keychron Q1SE ANSI encoder ### Highly Recommended: -When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. +When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 6a6c5a7ff1f4..f873554ea69c 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -3,7 +3,7 @@ Keychron Q2 ANSI encoder ### Highly Recommended: -When you flash this firmware for the first time, you should clear the eeprom before or after flashing so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. +When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn1+J+Z) to clear the eeprom after flashing. ## Features: - Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. From 3c558a278145151a065b9a7adc4f1292c7053dbb Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 9 May 2023 22:26:24 -0400 Subject: [PATCH 140/160] removed extra word --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 4611f04ad3a5..ecea277baad9 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -17,7 +17,7 @@ When you flash this firmware for the first time, you should clear the eeprom so - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. - Press Home to exit -- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for using the standard RGB keyboard shortcuts. +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Uses getreuer's autocorrect dictionary. diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index adbabd3d1b02..9bfe39ec2730 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -17,7 +17,7 @@ When you flash this firmware for the first time, you should clear the eeprom so - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. - Press Home to exit -- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed for using the standard RGB keyboard shortcuts. +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - Uses getreuer's autocorrect dictionary. From d95bf60551c8efb8b6b31f34fc03277c2242c142 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Wed, 10 May 2023 12:13:00 -0400 Subject: [PATCH 141/160] renamed mkillewald_iso keymap folder to mkillewald and version matched with ansi keymap --- .../iso/keymaps/mkillewald/autocorrect_data.h | 176 ++++++++++++++++++ .../mkillewald/autocorrection_dict.txt | 85 +++++++++ .../q1/iso/keymaps/mkillewald/config.h | 54 ++++++ .../q1/iso/keymaps/mkillewald/keymap.c | 74 ++++++++ .../keymap_user.h => mkillewald/layers.h} | 24 ++- .../q1/iso/keymaps/mkillewald/readme.md | 147 +++++++++++++++ .../q1/iso/keymaps/mkillewald/rules.mk | 5 + .../q1/iso/keymaps/mkillewald_iso/config.h | 23 --- .../q1/iso/keymaps/mkillewald_iso/keymap.c | 153 --------------- .../q1/iso/keymaps/mkillewald_iso/readme.md | 54 ------ .../keymaps/mkillewald_iso/rgb_matrix_user.c | 84 --------- .../keymaps/mkillewald_iso/rgb_matrix_user.h | 26 --- .../q1/iso/keymaps/mkillewald_iso/rules.mk | 6 - 13 files changed, 557 insertions(+), 354 deletions(-) create mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrect_data.h create mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrection_dict.txt create mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald/config.h create mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c rename keyboards/keychron/q1/iso/keymaps/{mkillewald_iso/keymap_user.h => mkillewald/layers.h} (57%) create mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md create mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald/rules.mk delete mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald_iso/config.h delete mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap.c delete mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald_iso/readme.md delete mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.c delete mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.h delete mode 100644 keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rules.mk diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrect_data.h new file mode 100644 index 000000000000..a092cc777346 --- /dev/null +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrect_data.h @@ -0,0 +1,176 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once + +// Autocorrection dictionary (71 entries): +// :guage -> gauge +// :the:the: -> the +// :thier -> their +// :ture -> true +// accomodate -> accommodate +// acommodate -> accommodate +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// aquire -> acquire +// becuase -> because +// cauhgt -> caught +// cheif -> chief +// choosen -> chosen +// cieling -> ceiling +// collegue -> colleague +// concensus -> consensus +// contians -> contains +// cosnt -> const +// dervied -> derived +// dosen't -> doesn't +// fales -> false +// fasle -> false +// fitler -> filter +// flase -> false +// foward -> forward +// frequecy -> frequency +// gaurantee -> guarantee +// guaratee -> guarantee +// heigth -> height +// heirarchy -> hierarchy +// inclued -> include +// interator -> iterator +// intput -> input +// invliad -> invalid +// lenght -> length +// liasion -> liaison +// libary -> library +// listner -> listener +// looses: -> loses +// looup -> lookup +// manefist -> manifest +// namesapce -> namespace +// namespcae -> namespace +// occassion -> occasion +// occured -> occurred +// ouptut -> output +// ouput -> output +// overide -> override +// postion -> position +// priviledge -> privilege +// psuedo -> pseudo +// recieve -> receive +// refered -> referred +// relevent -> relevant +// repitition -> repetition +// reuslt -> result +// retrun -> return +// retun -> return +// reutrn -> return +// saftey -> safety +// seperate -> separate +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// thresold -> threshold +// udpate -> update +// widht -> width + +#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" +#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" +#define DICTIONARY_SIZE 1120 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { + 0x6C, 0x2B, 0x00, 0x06, 0x47, 0x00, 0x07, 0x51, 0x00, 0x08, 0xC7, 0x00, 0x09, 0xF0, 0x01, 0x0A, + 0xFA, 0x01, 0x0B, 0x1A, 0x02, 0x11, 0x35, 0x02, 0x12, 0xBE, 0x02, 0x13, 0xCA, 0x02, 0x15, 0xD4, + 0x02, 0x16, 0x14, 0x03, 0x17, 0x43, 0x03, 0x1C, 0x20, 0x04, 0x00, 0x48, 0x32, 0x00, 0x16, 0x3C, + 0x00, 0x00, 0x0B, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x84, 0x00, 0x08, 0x16, 0x12, 0x12, + 0x0F, 0x00, 0x84, 0x73, 0x65, 0x73, 0x00, 0x0B, 0x17, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, + 0x00, 0x44, 0x5E, 0x00, 0x08, 0x6A, 0x00, 0x0F, 0xAE, 0x00, 0x15, 0xBB, 0x00, 0x00, 0x0C, 0x0F, + 0x19, 0x11, 0x0C, 0x00, 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x4A, 0x77, 0x00, 0x0C, 0x81, 0x00, + 0x15, 0x8C, 0x00, 0x18, 0xA5, 0x00, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, + 0x00, 0x19, 0x15, 0x08, 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x48, 0x93, 0x00, 0x18, + 0x9C, 0x00, 0x00, 0x09, 0x08, 0x15, 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, 0x00, + 0x81, 0x72, 0x65, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, 0x81, 0x64, 0x65, 0x00, 0x12, 0x16, + 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x04, 0x1A, 0x12, 0x09, 0x00, + 0x83, 0x72, 0x77, 0x61, 0x72, 0x64, 0x00, 0x44, 0xE9, 0x00, 0x06, 0xF6, 0x00, 0x07, 0x04, 0x01, + 0x08, 0x10, 0x01, 0x0A, 0x34, 0x01, 0x0F, 0x51, 0x01, 0x15, 0x5A, 0x01, 0x16, 0x75, 0x01, 0x17, + 0x90, 0x01, 0x18, 0xD7, 0x01, 0x19, 0xE4, 0x01, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, + 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, 0x13, 0x04, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, + 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x12, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, + 0x17, 0x00, 0x44, 0x19, 0x01, 0x11, 0x24, 0x01, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x18, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x44, 0x3B, 0x01, 0x07, 0x45, 0x01, 0x00, 0x18, 0x0A, 0x2C, 0x00, 0x83, + 0x61, 0x75, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x0C, 0x19, 0x0C, 0x15, 0x13, 0x00, 0x82, 0x67, 0x65, + 0x00, 0x16, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x4C, 0x61, 0x01, 0x18, 0x6D, 0x01, + 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x00, 0x17, 0x2C, 0x00, + 0x82, 0x72, 0x75, 0x65, 0x00, 0x04, 0x00, 0x4F, 0x7E, 0x01, 0x18, 0x86, 0x01, 0x00, 0x09, 0x00, + 0x83, 0x61, 0x6C, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, + 0x04, 0x00, 0x47, 0x9C, 0x01, 0x13, 0xC1, 0x01, 0x15, 0xCB, 0x01, 0x00, 0x12, 0x10, 0x00, 0x50, + 0xA6, 0x01, 0x12, 0xB5, 0x01, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, + 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, + 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, + 0x84, 0x61, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0A, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, + 0x67, 0x75, 0x65, 0x00, 0x08, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x76, 0x65, 0x00, + 0x0C, 0x08, 0x0B, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x11, 0x00, 0x4C, 0x03, 0x02, 0x15, + 0x10, 0x02, 0x00, 0x0F, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, 0x69, 0x6E, 0x67, 0x00, + 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x46, 0x21, 0x02, 0x17, 0x2C, 0x02, + 0x00, 0x0C, 0x17, 0x1A, 0x16, 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0A, 0x0C, 0x08, 0x0B, + 0x00, 0x81, 0x68, 0x74, 0x00, 0x48, 0x45, 0x02, 0x0A, 0x50, 0x02, 0x12, 0x59, 0x02, 0x15, 0x9C, + 0x02, 0x18, 0xA7, 0x02, 0x00, 0x16, 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, + 0x0C, 0x15, 0x17, 0x16, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0C, 0x00, 0x56, 0x62, 0x02, 0x17, 0x7C, + 0x02, 0x00, 0x44, 0x69, 0x02, 0x16, 0x72, 0x02, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, + 0x6E, 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x4C, 0x83, 0x02, 0x16, + 0x92, 0x02, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, 0x69, 0x6F, + 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, + 0x00, 0x83, 0x74, 0x75, 0x72, 0x6E, 0x00, 0x55, 0xAE, 0x02, 0x17, 0xB7, 0x02, 0x00, 0x17, 0x08, + 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, 0x80, 0x72, 0x6E, 0x00, 0x07, 0x08, + 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, 0x75, 0x64, 0x6F, 0x00, 0x18, 0x12, 0x12, 0x0F, 0x00, 0x81, + 0x6B, 0x75, 0x70, 0x00, 0x48, 0xDB, 0x02, 0x12, 0x03, 0x03, 0x00, 0x4C, 0xE5, 0x02, 0x0F, 0xEE, + 0x02, 0x11, 0xF8, 0x02, 0x00, 0x0B, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x17, 0x0C, + 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x17, 0x16, 0x0C, 0x0F, 0x00, 0x82, 0x65, 0x6E, + 0x65, 0x72, 0x00, 0x17, 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, + 0x74, 0x6F, 0x72, 0x00, 0x48, 0x1E, 0x03, 0x11, 0x26, 0x03, 0x18, 0x33, 0x03, 0x00, 0x0F, 0x04, + 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x04, 0x0C, 0x17, 0x11, 0x12, 0x06, 0x00, 0x83, 0x61, 0x69, + 0x6E, 0x73, 0x00, 0x16, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, + 0x75, 0x73, 0x00, 0x74, 0x59, 0x03, 0x0A, 0x66, 0x03, 0x0B, 0x70, 0x03, 0x0F, 0x86, 0x03, 0x11, + 0x91, 0x03, 0x16, 0xEA, 0x03, 0x18, 0xF8, 0x03, 0x00, 0x11, 0x08, 0x16, 0x12, 0x07, 0x00, 0x84, + 0x65, 0x73, 0x6E, 0x27, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, 0x68, 0x74, 0x00, + 0x47, 0x77, 0x03, 0x0A, 0x7E, 0x03, 0x00, 0x0C, 0x1A, 0x00, 0x81, 0x74, 0x68, 0x00, 0x11, 0x08, + 0x0F, 0x00, 0x81, 0x74, 0x68, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, + 0x00, 0x44, 0x9B, 0x03, 0x08, 0xA6, 0x03, 0x16, 0xE2, 0x03, 0x00, 0x15, 0x04, 0x13, 0x13, 0x04, + 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x55, 0xAD, 0x03, 0x19, 0xD8, 0x03, 0x00, 0x44, 0xB4, 0x03, + 0x15, 0xBF, 0x03, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, + 0x13, 0x00, 0x44, 0xC9, 0x03, 0x13, 0xD1, 0x03, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, + 0x00, 0x04, 0x00, 0x83, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, + 0x74, 0x00, 0x12, 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x09, 0x08, 0x11, 0x04, 0x10, + 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, 0x00, 0x53, 0xFF, 0x03, 0x17, 0x16, 0x04, 0x00, 0x57, + 0x06, 0x04, 0x18, 0x0E, 0x04, 0x00, 0x11, 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, + 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, + 0x46, 0x2D, 0x04, 0x08, 0x39, 0x04, 0x0B, 0x43, 0x04, 0x15, 0x55, 0x04, 0x00, 0x08, 0x18, 0x14, + 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, + 0x74, 0x79, 0x00, 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, + 0x72, 0x63, 0x68, 0x79, 0x00, 0x04, 0x05, 0x0C, 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00 +}; \ No newline at end of file diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrection_dict.txt b/keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrection_dict.txt new file mode 100644 index 000000000000..8280fcf703b9 --- /dev/null +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/autocorrection_dict.txt @@ -0,0 +1,85 @@ +# Copyright 2021-2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +:guage -> gauge +:the the: -> the +:thier -> their +:ture -> true +accomodate -> accommodate +acommodate -> accommodate +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +aquire -> acquire +becuase -> because +cauhgt -> caught +cheif -> chief +choosen -> chosen +cieling -> ceiling +collegue -> colleague +concensus -> consensus +contians -> contains +cosnt -> const +dervied -> derived +dosen't -> doesn't +fales -> false +fasle -> false +fitler -> filter +flase -> false +foward -> forward +frequecy -> frequency +gaurantee -> guarantee +guaratee -> guarantee +heigth -> height +heirarchy -> hierarchy +inclued -> include +interator -> iterator +intput -> input +invliad -> invalid +lenght -> length +liasion -> liaison +libary -> library +listner -> listener +looses: -> loses +looup -> lookup +manefist -> manifest +namesapce -> namespace +namespcae -> namespace +occassion -> occasion +occured -> occurred +ouptut -> output +ouput -> output +overide -> override +postion -> position +priviledge -> privilege +psuedo -> pseudo +recieve -> receive +refered -> referred +relevent -> relevant +repitition -> repetition +reuslt -> result +retrun -> return +retun -> return +reutrn -> return +saftey -> safety +seperate -> separate +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +thresold -> threshold +udpate -> update +widht -> width \ No newline at end of file diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/config.h b/keyboards/keychron/q1/iso/keymaps/mkillewald/config.h new file mode 100644 index 000000000000..722e8d81dcb2 --- /dev/null +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/config.h @@ -0,0 +1,54 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 + +// default options applied when eeprom is cleared +#define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable +#define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable +#define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable +#define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) +#define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) +#define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers +#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers + +// Autocorrect is off at start up. If you want Autocorrect to be on at startup, +// remove or comment out the following line +#define AUTOCORRECT_OFF_AT_STARTUP + +// Caps Lock RGB indicator color +#define CAPS_LOCK_INDICATOR_COLOR RGB_RED + +// Dynamic Fn Layer RGB indicator options +#define FN1_LAYER_COLOR RGB_YELLOW + +// Caps Word RGB indicator color +#define CAPS_WORD_INDICATOR_COLOR RGB_RED + +// Caps Word is activated by double-tapping left Shift. Replace this with +// #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word +// by single-tapping both left and right Shift togeter. +#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + +// Caps Word will light left Shift, left Control and left Option (or left Windows +// key) when acitvated. Remove this line if you want Caps Word to only light left +// Shift when enabled. +#define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER \ No newline at end of file diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c new file mode 100644 index 000000000000..39b96bb16397 --- /dev/null +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) + * + * 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 "keychron_common.h" +#include "myfork_keychron_ft.h" +#include "mkillewald.h" +#include "layers.h" + +// clang-format off + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[MAC_BASE] = LAYOUT_iso_83( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[MAC_FN] = LAYOUT_iso_83( + KC_LBMAC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + AC_TOGG, _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, LCAG(KC_W), LCAG(KC_D), _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +[WIN_BASE] = LAYOUT_iso_83( + KC_ESC, 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_DEL, KC_INS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[WIN_FN] = LAYOUT_iso_83( + _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + AC_TOGG, _______, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + +}; + +// clang-format on + +void housekeeping_task_user(void) { + housekeeping_task_keychron(); + housekeeping_task_myfork_keychron_ft(); + housekeeping_task_mkillewald(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { return false; } + if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } + if (!process_record_mkillewald(keycode, record)) { return false; } + return true; +} diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap_user.h b/keyboards/keychron/q1/iso/keymaps/mkillewald/layers.h similarity index 57% rename from keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap_user.h rename to keyboards/keychron/q1/iso/keymaps/mkillewald/layers.h index 87b1baf47f23..e8733b342526 100644 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap_user.h +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/layers.h @@ -1,4 +1,4 @@ -/* Copyright 2021 @ Mike Killewald +/* Copyright 2023 @ Mike Killewald (https://github.com/mkillewald) * * 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 @@ -16,18 +16,26 @@ #pragma once -// clang-format off +#include "mkillewald.h" -enum layers { +enum layers{ MAC_BASE, MAC_FN, WIN_BASE, WIN_FN }; -// clang-format on +#define MAC_FN1 MAC_FN +#define WIN_FN1 WIN_FN +#define MAC_WIN_FN2 255 // not used, keymap does not have fn2 key -bool get_caps_lock_light_tab(void); -bool get_caps_lock_light_alphas(void); -bool get_fn_layer_transparent_keys_off(void); -bool get_fn_layer_color_enable(void); \ No newline at end of file +/* Factory test keys */ +#define FN_KEY1 MO(MAC_FN) // Fn Mac Base +#define FN_KEY2 MO(WIN_FN) // Fn Win Base + +#define RESET_KEY1 KC_J +#define RESET_KEY2 KC_Z +#define RESET_KEY2_ALT KC_LTTOG + +#define BL_TEST_KEY1 KC_RIGHT +#define BL_TEST_KEY2 KC_HOME \ No newline at end of file diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md new file mode 100644 index 000000000000..5029cb2c8f94 --- /dev/null +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md @@ -0,0 +1,147 @@ +## Keychron Q1 RGB ISO ATMEGA32U4 (no knob) Keymap v2.0.2 + +### Highly Recommended: +When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. + +## Features: +- Retains Keychron factory keycodes for Mission Control, Launchpad, Siri, Cortana, Task View, File Explorer, and others. + +- Retains Keychron factory reset: + - Hold Fn+J+Z for 4 seconds. The RGB LEDs will flash red to indicate that the reset has occurred. + - This will clear the eeprom which returns RGB settings back to defaults and erases any changes made with VIA. + +- Retains Keychron LED test: + - Hold Fn+Right+Home for 4 seconds. The RGB LEDs will all turn white. + - Press Right to cycle RGB colors (white, red, green and blue) to check operation of each LED. + - Press Home to exit + +- Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. + +- Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) + - Uses getreuer's autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) + +- Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) + +- Caps Lock RGB indicator. Will light Caps Lock key with options to also light Tab key (useful for some keycap sets), and/or light all alpha keys. + +- Dynamic Fn layer RGB indicator. When Fn key is held down, any keys defined on the Fn layer in this firmware or in VIA will be highlighted. + +##### Notes: + +###### Toggling RGB mode off will disable RGB and indicators separately for each base layer (Mac or Win). RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. +###### Changing RGB settings with VIA lighting tab is unsupported at this time and may have undesired effects. Keymap changes with VIA is supported. + +## Config.h options + +Default options (these defaults will be applied whenever the eeprom is cleared): + +``` + #define DEFAULT_CAPS_LOCK_LIGHT_TAB 0 // 1 = enable, 0 = disable + #define DEFAULT_CAPS_LOCK_LIGHT_ALPHA 1 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_TRANSPARENT_OFF 0 // 1 = enable, 0 = disable + #define DEFAULT_FN_LAYER_SHOW_COLOR 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_MAC_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_RGB_ENABLE_WIN_BASE 1 // 1 = enable, 0 = disable + #define DEFAULT_HUE_WIN_BASE 80 // HSV green hue (Win Base layer) + #define RGB_MATRIX_DEFAULT_HUE 0 // HSV red hue (Mac Base layer) + #define RGB_MATRIX_DEFAULT_SAT 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_VAL 255 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_SPD 127 // Both Win/Mac Base layers + #define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_BREATHING // Both Win/Mac Base layers +``` + +Autocorrect option: + +``` + // Autocorrect is off at start up. If you want Autocorrect to be on at startup, + // remove or comment out the following line + #define AUTOCORRECT_OFF_AT_STARTUP +``` + +Caps Lock RGB indicator option: + +``` + #define CAPS_LOCK_INDICATOR_COLOR RGB_RED +``` + +Dynamic Fn Layer RGB indicator options: + +``` + #define FN1_LAYER_COLOR RGB_YELLOW +``` + +Caps Word options: + +``` + // Caps Word RGB indicator color + #define CAPS_WORD_INDICATOR_COLOR RGB_RED + + // Caps Word is activated by double-tapping left Shift. Replace this with + // #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD if you want to activate Caps Word + // by single-tapping both left and right Shift togeter. + #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD + + // Caps Word will light left Shift, left Control and left Option (or left Windows + // key) when acitvated. Remove this line if you want Caps Word to only light left + // Shift when enabled. + #define CAPS_WORD_LIGHT_LOWER_LEFT_CORNER +``` + +## This keymap makes the following layout changes over the factory firmware + +- Fn+Left Shift toggles Autocorrect on/off +- Fn+Backspace enters DFU mode (but does not reset eeprom) +- Fn+Z (KC_LTTOG) Caps Lock Light Tab Toggle (default: off) + - toggle lighting the Tab key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. +- Fn+X (KC_LATOG) Caps Lock Light Alpha Toggle (default: on) + - toggle lighting all the alpha keys when Caps Lock is enabled. +- Fn+C (KC_TKTOG) Fn layer Trasnparent Key Off Toggle (default: RGB on) + - toggle turning off RGB for keys with no definition +- Fn+V (KC_FCTOG) Fn layer Color Toggle (default: static color on) + - toggle lighting the defined Fn layer keys with the static color set with FN1_LAYER_COLOR + +- Mac mode only + - Fn+Esc (KC_LBMAC) will lock and sleep display + - Fn+< sets my secondary display to 0° rotation + - Fn+> sets my secondary display to 90° rotation + + Note: display rotation requires additional software and changes made, see this link for more information: + [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + +All custom keycodes can be moved to different keys in VIA by using the following: +- CUSTOM(64) = KC_LTTOG (default: Fn+Z) Caps Lock Light Tab Toggle +- CUSTOM(65) = KC_LATOG (default: Fn+X) Caps Lock Light Alpha Toggle +- CUSTOM(66) = KC_TKTOG (default: Fn+C) Fn layer Trasnparent Key Off Toggle +- CUSTOM(67) = KC_FCTOG (default: Fn+V) Fn layer Color Toggle +- CUSTOM(68) = KC_LBMAC (default Mac Only: Fn+Esc) Lock and Blank Mac + + +#### USE AT YOUR OWN RISK + +## Changelog: + +v2.0.2 May 9, 2023 +- brought over all updated features from my Q1 ANSI keymap, and jumped version number to 2.0.2 to match. + - added Keychron factory reset and LED test + - enabled separate RGB toggle for each base layer (Mac / Win) + +v1.0.4 October 9, 2021 +- Caps Lock and Fn layer toggles are now stored in eeprom so settings will remain when Q1 is unplugged + +v1.0.3 October 8, 2021 +- now using keycode toggles instead of preprocessor directives to set the various Caps Lock and Fn Layer RGB lighting options. This allows for setting the options from user space without having to recompile. + +v1.0.2 October 7, 2021 +- adapted Grayson Carr's (gtg465x) Caps Lock alphas and dynamic Fn layer RGB routines +- added CAPS_LOCK_INDICATOR_LIGHT_TAB config option to enable/disable lighting Tab with Caps Lock indicator +- added FN_LAYER_COLOR config option to set FN layer static color + +v1.0.1 October 7, 2021 +- Mission Control and Launchpad custom keycodes are now defined using the VIA user keycodes range so thay can be labeled properly in VIA (adopted change from gtg465x) + +v1.0.0 September 30, 2021 +- Initial release built upon keymap by Grayson Carr (gtg465x) +- defined Mission Control (F3) and Launchpad (F4) keycodes for macOs +- RGB backlight turns off when computer sleeps +- added Caps Lock indicator lighting both the Caps Lock and Tab LEDs for better effect on non-backlit keycaps diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/rules.mk b/keyboards/keychron/q1/iso/keymaps/mkillewald/rules.mk new file mode 100644 index 000000000000..f4b915d446ad --- /dev/null +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/rules.mk @@ -0,0 +1,5 @@ +CAPS_WORD_ENABLE = yes +AUTOCORRECT_ENABLE = yes + +VPATH += keyboards/keychron/common +SRC += keychron_common.c \ No newline at end of file diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/config.h b/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/config.h deleted file mode 100644 index bc9fe405c35c..000000000000 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2021 @ Mike Killewald - * - * 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 RGB_MATRIX_ENABLE -# define RGB_DISABLE_WHEN_USB_SUSPENDED -# define CAPS_LOCK_INDICATOR_COLOR RGB_RED -# define FN_LAYER_COLOR RGB_ORANGE -#endif \ No newline at end of file diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap.c b/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap.c deleted file mode 100644 index f86a84e468dd..000000000000 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/keymap.c +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright 2021 @ Mike Killewald - * - * 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 "keymap_user.h" -#ifdef RGB_MATRIX_ENABLE -# include "rgb_matrix_user.h" -#endif - -// clang-format off - -typedef union { - uint32_t raw; - struct { - bool caps_lock_light_tab :1; - bool caps_lock_light_alphas :1; - bool fn_layer_transparent_keys_off :1; - bool fn_layer_color_enable :1; - }; -} user_config_t; - -user_config_t user_config; - -enum custom_keycodes { - KC_LIGHT_TAB_TOGGLE = QK_KB_2, // TECH DEBT: Starts at QK_KB_2 to maintain ordering with VIA definitions. See #19884. Revert to QK_KB_0 when VIA catches up with QMK. - KC_LIGHT_ALPHAS_TOGGLE, - KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE, - KC_FN_LAYER_COLOR_TOGGLE -}; - -#define KC_LTTOG KC_LIGHT_TAB_TOGGLE -#define KC_LATOG KC_LIGHT_ALPHAS_TOGGLE -#define KC_TKTOG KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE -#define KC_FCTOG KC_FN_LAYER_COLOR_TOGGLE -#define KC_TASK LGUI(KC_TAB) -#define KC_FLXP LGUI(KC_E) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[MAC_BASE] = LAYOUT_iso_83( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[MAC_FN] = LAYOUT_iso_83( - KC_TRNS, 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, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - -[WIN_BASE] = LAYOUT_iso_83( - KC_ESC, 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_DEL, KC_INS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[WIN_FN] = LAYOUT_iso_83( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LTTOG, KC_LATOG, KC_TKTOG, KC_FCTOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - -}; - -// clang-format on - -void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_init_user(); -#endif -} - -void keyboard_post_init_user(void) { - user_config.raw = eeconfig_read_user(); -} - -void eeconfig_init_user(void) { - user_config.raw = 0; - user_config.caps_lock_light_tab = false; - user_config.caps_lock_light_alphas = false; - user_config.fn_layer_transparent_keys_off = true; - user_config.fn_layer_color_enable = false; - eeconfig_update_user(user_config.raw); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_LIGHT_TAB_TOGGLE: - if (record->event.pressed) { - user_config.caps_lock_light_tab ^= 1; // bitwise xor to toggle status bit - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - case KC_LIGHT_ALPHAS_TOGGLE: - if (record->event.pressed) { - user_config.caps_lock_light_alphas ^= 1; - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_TRANSPARENT_KEYS_TOGGLE: - if (record->event.pressed) { - user_config.fn_layer_transparent_keys_off ^= 1; - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - case KC_FN_LAYER_COLOR_TOGGLE: - if (record->event.pressed) { - user_config.fn_layer_color_enable ^= 1; - eeconfig_update_user(user_config.raw); - } - return false; // Skip all further processing of this key - default: - return true; // Process all other keycodes normally - } -} - -bool get_caps_lock_light_tab(void) { - return user_config.caps_lock_light_tab; -} - -bool get_caps_lock_light_alphas(void) { - return user_config.caps_lock_light_alphas; -} - -bool get_fn_layer_transparent_keys_off(void) { - return user_config.fn_layer_transparent_keys_off; -} - -bool get_fn_layer_color_enable(void) { - return user_config.fn_layer_color_enable; -} diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/readme.md b/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/readme.md deleted file mode 100644 index 25d835b1c021..000000000000 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -## mkillewald's Keychron Q1 keymap (ISO rev_0102) v1.0.4 - -This keymap builds on the keymap by Grayson Carr (gtg465x) but adds a couple options. - -## Features: -- On macOS, F3 opens Mission Control and F4 opens Launchpad without needing to configure shortcuts in System Preferences -- RGB lighting turns off when the computer sleeps -- Caps Lock RGB indicator - - the Caps Lock key will light when Caps Lock is enabled with the following options: - - #define CAPS_LOCK_INDICATOR_COLOR [color] in config.h to set the backlight color used for the indicator when Caps Lock is enabled (default: red) - - Fn+Z will toggle lighting the TAB key when Caps Lock is enabled. This is useful with non backlit keycaps/legends. (default: off) - - Fn+X will toggle lighting all the alpha keys when Caps Lock is enabled. (default: off) - -- Dynamic Fn layer RGB indicator - - When the Fn key is held down, any keys defined on the Fn layer in this firmware or in VIA will be highlighted with the following options: - - #define FN_LAYER_COLOR [color] in config.h to set a static color for defined keys (default: orange) - - Fn+C will toggle turning off RGB for keys with no definition (default: RGB off) - - Fn+V will toggle lighting the defined Fn layer keys with the static color set with FN_LAYER_COLOR (default: static color off) - -- All custom keycodes can be moved to different keys in VIA by using the ANY key with the following keycodes: - - USER(0) (default: F3) macOS Mission Control - - USER(1) (default: F4) macOS Launchpad - - USER(2) (default: Fn+Z) Caps Lock light Tab toggle - - USER(3) (default: Fn+X) Caps Lock light alphas toggle - - USER(4) (default: Fn+C) Fn layer non-defined keys RGB toggle - - USER(5) (default: Fn+V) Fn layer defined keys static color toggle - -RGB must be toggled on for all indicators to function. If you do not want an RGB mode active but still want the indicators, toggle RGB on and turn the brightness all the way off. The indicators will remain at full brightness. - -Please make sure to save any customizations you have made in VIA to a .json file before flashing the firmware. Sometimes it has been necessary to re-apply those changes in VIA after flashing the firmware. If that is the case, you will most likely need to manually add the USER(0) through USER(5) custom keycodes after loading your customizations from the saved .json file. Then re-save a new .json file which will have your previous customizations and the custom keycodes for future use as needed. - -#### USE AT YOUR OWN RISK - -## Changelog: - -v1.0.4 October 9, 2021 -- Caps Lock and Fn layer toggles are now stored in eeprom so settings will remain when Q1 is unplugged - -v1.0.3 October 8, 2021 -- now using keycode toggles instead of preprocessor directives to set the various Caps Lock and Fn Layer RGB lighting options. This allows for setting the options from user space without having to recompile. - -v1.0.2 October 7, 2021 -- adapted Grayson Carr's (gtg465x) Caps Lock alphas and dynamic Fn layer RGB routines -- added CAPS_LOCK_INDICATOR_LIGHT_TAB config option to enable/disable lighting Tab with Caps Lock indicator -- added FN_LAYER_COLOR config option to set FN layer static color - -v1.0.1 October 7, 2021 -- Mission Control and Launchpad custom keycodes are now defined using the VIA user keycodes range so thay can be labeled properly in VIA (adopted change from gtg465x) - -v1.0.0 September 30, 2021 -- Initial release built upon keymap by Grayson Carr (gtg465x) -- defined Mission Control (F3) and Launchpad (F4) keycodes for macOs -- RGB backlight turns off when computer sleeps -- added Caps Lock indicator lighting both the Caps Lock and Tab LEDs for better effect on non-backlit keycaps diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.c b/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.c deleted file mode 100644 index c6fa5f1f155a..000000000000 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.c +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright 2021 @ Mike Killewald - * - * 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 "rgb_matrix_user.h" -#include "keymap_user.h" - -keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; - -void rgb_matrix_init_user(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - uint8_t led_index = g_led_config.matrix_co[row][col]; - if (led_index != NO_LED) { - led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; - } - } - } -} - -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - uint8_t current_layer = get_highest_layer(layer_state); - switch (current_layer) { - case MAC_BASE: - case WIN_BASE: -#ifdef CAPS_LOCK_INDICATOR_COLOR - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); - } -#endif - break; - case MAC_FN: - case WIN_FN: -#ifdef FN_LAYER_COLOR - if (get_fn_layer_color_enable()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_not_transparent, FN_LAYER_COLOR); - } -#endif - if (get_fn_layer_transparent_keys_off()) { - rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); - } - break; - } - return false; -} - -void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { - for (uint8_t i = led_min; i < led_max; i++) { - uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); - if ((*is_keycode)(keycode)) { - rgb_matrix_set_color(i, red, green, blue); - } - } -} - -bool is_caps_lock_indicator(uint16_t keycode) { - bool indicator = keycode == KC_CAPS; - - if (get_caps_lock_light_tab()) { - indicator = keycode == KC_TAB || keycode == KC_CAPS; - } - - if (get_caps_lock_light_alphas()) { - return (KC_A <= keycode && keycode <= KC_Z) || indicator; - } else { - return indicator; - } -} - -bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } -bool is_not_transparent(uint16_t keycode) { return keycode != KC_TRNS; } diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.h b/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.h deleted file mode 100644 index 1fb79c0b2a14..000000000000 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rgb_matrix_user.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright 2021 @ Mike Killewald - * - * 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 - -void rgb_matrix_init_user(void); - -void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); - -bool is_caps_lock_indicator(uint16_t keycode); -bool is_transparent(uint16_t keycode); -bool is_not_transparent(uint16_t keycode); - diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rules.mk b/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rules.mk deleted file mode 100644 index af720e37ee7b..000000000000 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald_iso/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -VIA_ENABLE = yes -MOUSEKEY_ENABLE = no - -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) - SRC += rgb_matrix_user.c -endif \ No newline at end of file From 711b4bfa5ca80f574eb8cdc8597ddc224cc4008b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 11:46:52 -0400 Subject: [PATCH 142/160] updated image link --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index ecea277baad9..e5007c4b6d65 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.2 -Keychron Q1 ANSI +![Keychron Q1 ANSI](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q1/Q1_RGB_ANSI_ATMEGA32U4.jpg | width=1000) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. From 7073ddbd76ce2140228548317a8a3f467d1b45fe Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 11:49:44 -0400 Subject: [PATCH 143/160] fixed image link --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index e5007c4b6d65..3ad7a4936778 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.2 -![Keychron Q1 ANSI](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q1/Q1_RGB_ANSI_ATMEGA32U4.jpg | width=1000) +![Keychron Q1 ANSI](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q1/Q1_RGB_ANSI_ATMEGA32U4.jpg) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. From 0e0cfc5cdac544bdfcca3fa440c33aad27936956 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 11:52:41 -0400 Subject: [PATCH 144/160] changed display rotation link --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 3ad7a4936778..1bd0ec7e7d6f 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -109,7 +109,7 @@ Caps Word options: - Fn+> sets my secondary display to 90° rotation Note: display rotation requires additional software and changes made, see this link for more information: - [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + [https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48](https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48) All custom keycodes can be moved to different keys in VIA by using the following: - CUSTOM(64) = KC_LTTOG (default: Fn+Z) Caps Lock Light Tab Toggle From 8b78b2f5200b73252dabfe8cd777a98952121829 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 11:56:41 -0400 Subject: [PATCH 145/160] added linebreak before link --- keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index 1bd0ec7e7d6f..f400abe9ea08 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -108,7 +108,7 @@ Caps Word options: - Fn+< sets my secondary display to 0° rotation - Fn+> sets my secondary display to 90° rotation - Note: display rotation requires additional software and changes made, see this link for more information: + Note: display rotation requires additional software and changes made, see this link for more information: [https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48](https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48) All custom keycodes can be moved to different keys in VIA by using the following: From 07b7e99a0a351a816093bf1db305b566773c3f07 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 12:00:11 -0400 Subject: [PATCH 146/160] updated display rotation link --- keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md index 5029cb2c8f94..2ce07559e391 100644 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/readme.md @@ -106,8 +106,8 @@ Caps Word options: - Fn+< sets my secondary display to 0° rotation - Fn+> sets my secondary display to 90° rotation - Note: display rotation requires additional software and changes made, see this link for more information: - [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + Note: display rotation requires additional software and changes made, see this link for more information: + [https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48](https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48) All custom keycodes can be moved to different keys in VIA by using the following: - CUSTOM(64) = KC_LTTOG (default: Fn+Z) Caps Lock Light Tab Toggle From 9c1d9d2568ec0965063f770d10023744a3f452fa Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 12:04:51 -0400 Subject: [PATCH 147/160] updated image and display rotation link --- .../keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index 9bfe39ec2730..ffeaa065e183 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q1 Special Edition RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.2 -Keychron Q1SE ANSI encoder +![Keychron Q1SE ANSI encoder](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q1/Q1SE_RGB_ANSI_ATMEGA32U4_ENC11.jpg) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. @@ -108,8 +108,8 @@ Caps Word options: - Fn+< sets my secondary display to 0° rotation - Fn+> sets my secondary display to 90° rotation - Note: display rotation requires additional software and changes made, see this link for more information: - [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + Note: display rotation requires additional software and changes made, see this link for more information: + [https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48](https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48) All custom keycodes can be moved to different keys in VIA by using the following: - CUSTOM(64) = KC_LTTOG (default: Fn+Z) Caps Lock Light Tab Toggle From d5c4868736145d6b1c398612291b2411a6f1935b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 11 May 2023 12:13:36 -0400 Subject: [PATCH 148/160] updated image and display rotation link --- .../keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index f873554ea69c..0d580d2b2ade 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.2 -Keychron Q2 ANSI encoder +![Keychron Q2 ANSI encoder](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q2/Q2_SEVERED_RGB_ANSI_STM32L432_ENC11.jpg) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn1+J+Z) to clear the eeprom after flashing. @@ -125,8 +125,8 @@ Caps Word options: - Fn1+< sets my secondary display to 0° rotation - Fn1+> sets my secondary display to 90° rotation - Note: display rotation requires additional software and changes made, see this link for more information: - [https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/](https://www.reddit.com/r/Keychron/comments/1254g36/howto_macos_rotate_screen_from_keyboard_shortcut/) + Note: display rotation requires additional software and changes made, see this link for more information: + [https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48](https://gist.github.com/mkillewald/706b7ef8624d8c2bf17ce1df344cff48) All custom keycodes can be moved to different keys in VIA by using the following: - CUSTOM(64) = KC_LTTOG (default: Fn2+Z) Caps Lock Light Tab Toggle From 3fbd5ded3d4cdc1f4022885491375defb80f0793 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 12 May 2023 11:18:06 -0400 Subject: [PATCH 149/160] making changes requested by drashna --- .../q1/ansi/keymaps/mkillewald/keymap.c | 8 +- .../q1/ansi/keymaps/mkillewald/readme.md | 2 +- .../keymaps/mkillewald/autocorrect_data.h | 176 ------------------ .../mkillewald/autocorrection_dict.txt | 85 --------- .../ansi_encoder/keymaps/mkillewald/keymap.c | 8 +- .../ansi_encoder/keymaps/mkillewald/readme.md | 6 +- .../q1/iso/keymaps/mkillewald/keymap.c | 8 +- .../ansi_encoder/keymaps/mkillewald/keymap.c | 8 +- .../ansi_encoder/keymaps/mkillewald/readme.md | 2 +- .../mkillewald/autocorrect_data.h | 0 .../mkillewald/autocorrection_dict_extra.txt | 0 users/mkillewald/eeprom_user_config.c | 13 +- users/mkillewald/mkillewald.h | 7 +- 13 files changed, 30 insertions(+), 293 deletions(-) delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h delete mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt rename {keyboards/keychron/q2/ansi_encoder/keymaps => users}/mkillewald/autocorrect_data.h (100%) rename {keyboards/keychron/q2/ansi_encoder/keymaps => users}/mkillewald/autocorrection_dict_extra.txt (100%) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index e2fce55cc914..250c49476c87 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -67,8 +67,10 @@ void housekeeping_task_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } - if (!process_record_mkillewald(keycode, record)) { return false; } + if (!(process_record_keychron(keycode, record) && + process_record_myfork_keychron_ft(keycode, record) && + process_record_mkillewald(keycode, record))) { + return false; + } return true; } \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md index f400abe9ea08..99009a820e2d 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q1 RGB ANSI ATMEGA32U4 (no knob) Keymap v2.0.2 -![Keychron Q1 ANSI](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q1/Q1_RGB_ANSI_ATMEGA32U4.jpg) +![Keychron Q1 ANSI](https://i.imgur.com/DUA2dMd.jpg) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h deleted file mode 100644 index a092cc777346..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2023 QMK -// SPDX-License-Identifier: GPL-2.0-or-later - -/******************************************************************************* - 88888888888 888 d8b .d888 d8b 888 d8b - 888 888 Y8P d88P" Y8P 888 Y8P - 888 888 888 888 - 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b - 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K - 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. - 888 888 888 888 X88 888 888 888 Y8b. 888 X88 - 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' - 888 888 - 888 888 - 888 888 - .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 - d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 - 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 - Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 - "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 - 888 - Y8b d88P - "Y88P" -*******************************************************************************/ - -#pragma once - -// Autocorrection dictionary (71 entries): -// :guage -> gauge -// :the:the: -> the -// :thier -> their -// :ture -> true -// accomodate -> accommodate -// acommodate -> accommodate -// aparent -> apparent -// aparrent -> apparent -// apparant -> apparent -// apparrent -> apparent -// aquire -> acquire -// becuase -> because -// cauhgt -> caught -// cheif -> chief -// choosen -> chosen -// cieling -> ceiling -// collegue -> colleague -// concensus -> consensus -// contians -> contains -// cosnt -> const -// dervied -> derived -// dosen't -> doesn't -// fales -> false -// fasle -> false -// fitler -> filter -// flase -> false -// foward -> forward -// frequecy -> frequency -// gaurantee -> guarantee -// guaratee -> guarantee -// heigth -> height -// heirarchy -> hierarchy -// inclued -> include -// interator -> iterator -// intput -> input -// invliad -> invalid -// lenght -> length -// liasion -> liaison -// libary -> library -// listner -> listener -// looses: -> loses -// looup -> lookup -// manefist -> manifest -// namesapce -> namespace -// namespcae -> namespace -// occassion -> occasion -// occured -> occurred -// ouptut -> output -// ouput -> output -// overide -> override -// postion -> position -// priviledge -> privilege -// psuedo -> pseudo -// recieve -> receive -// refered -> referred -// relevent -> relevant -// repitition -> repetition -// reuslt -> result -// retrun -> return -// retun -> return -// reutrn -> return -// saftey -> safety -// seperate -> separate -// singed -> signed -// stirng -> string -// strign -> string -// swithc -> switch -// swtich -> switch -// thresold -> threshold -// udpate -> update -// widht -> width - -#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" -#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" -#define DICTIONARY_SIZE 1120 - -static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { - 0x6C, 0x2B, 0x00, 0x06, 0x47, 0x00, 0x07, 0x51, 0x00, 0x08, 0xC7, 0x00, 0x09, 0xF0, 0x01, 0x0A, - 0xFA, 0x01, 0x0B, 0x1A, 0x02, 0x11, 0x35, 0x02, 0x12, 0xBE, 0x02, 0x13, 0xCA, 0x02, 0x15, 0xD4, - 0x02, 0x16, 0x14, 0x03, 0x17, 0x43, 0x03, 0x1C, 0x20, 0x04, 0x00, 0x48, 0x32, 0x00, 0x16, 0x3C, - 0x00, 0x00, 0x0B, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x84, 0x00, 0x08, 0x16, 0x12, 0x12, - 0x0F, 0x00, 0x84, 0x73, 0x65, 0x73, 0x00, 0x0B, 0x17, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, - 0x00, 0x44, 0x5E, 0x00, 0x08, 0x6A, 0x00, 0x0F, 0xAE, 0x00, 0x15, 0xBB, 0x00, 0x00, 0x0C, 0x0F, - 0x19, 0x11, 0x0C, 0x00, 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x4A, 0x77, 0x00, 0x0C, 0x81, 0x00, - 0x15, 0x8C, 0x00, 0x18, 0xA5, 0x00, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, - 0x00, 0x19, 0x15, 0x08, 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x48, 0x93, 0x00, 0x18, - 0x9C, 0x00, 0x00, 0x09, 0x08, 0x15, 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, 0x00, - 0x81, 0x72, 0x65, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, 0x81, 0x64, 0x65, 0x00, 0x12, 0x16, - 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x04, 0x1A, 0x12, 0x09, 0x00, - 0x83, 0x72, 0x77, 0x61, 0x72, 0x64, 0x00, 0x44, 0xE9, 0x00, 0x06, 0xF6, 0x00, 0x07, 0x04, 0x01, - 0x08, 0x10, 0x01, 0x0A, 0x34, 0x01, 0x0F, 0x51, 0x01, 0x15, 0x5A, 0x01, 0x16, 0x75, 0x01, 0x17, - 0x90, 0x01, 0x18, 0xD7, 0x01, 0x19, 0xE4, 0x01, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, - 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, 0x13, 0x04, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, - 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x12, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, - 0x17, 0x00, 0x44, 0x19, 0x01, 0x11, 0x24, 0x01, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, - 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x18, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, - 0x74, 0x65, 0x65, 0x00, 0x44, 0x3B, 0x01, 0x07, 0x45, 0x01, 0x00, 0x18, 0x0A, 0x2C, 0x00, 0x83, - 0x61, 0x75, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x0C, 0x19, 0x0C, 0x15, 0x13, 0x00, 0x82, 0x67, 0x65, - 0x00, 0x16, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x4C, 0x61, 0x01, 0x18, 0x6D, 0x01, - 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x00, 0x17, 0x2C, 0x00, - 0x82, 0x72, 0x75, 0x65, 0x00, 0x04, 0x00, 0x4F, 0x7E, 0x01, 0x18, 0x86, 0x01, 0x00, 0x09, 0x00, - 0x83, 0x61, 0x6C, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, - 0x04, 0x00, 0x47, 0x9C, 0x01, 0x13, 0xC1, 0x01, 0x15, 0xCB, 0x01, 0x00, 0x12, 0x10, 0x00, 0x50, - 0xA6, 0x01, 0x12, 0xB5, 0x01, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, - 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, - 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, - 0x84, 0x61, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0A, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, - 0x67, 0x75, 0x65, 0x00, 0x08, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x76, 0x65, 0x00, - 0x0C, 0x08, 0x0B, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x11, 0x00, 0x4C, 0x03, 0x02, 0x15, - 0x10, 0x02, 0x00, 0x0F, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, 0x69, 0x6E, 0x67, 0x00, - 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x46, 0x21, 0x02, 0x17, 0x2C, 0x02, - 0x00, 0x0C, 0x17, 0x1A, 0x16, 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0A, 0x0C, 0x08, 0x0B, - 0x00, 0x81, 0x68, 0x74, 0x00, 0x48, 0x45, 0x02, 0x0A, 0x50, 0x02, 0x12, 0x59, 0x02, 0x15, 0x9C, - 0x02, 0x18, 0xA7, 0x02, 0x00, 0x16, 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, - 0x0C, 0x15, 0x17, 0x16, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0C, 0x00, 0x56, 0x62, 0x02, 0x17, 0x7C, - 0x02, 0x00, 0x44, 0x69, 0x02, 0x16, 0x72, 0x02, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, - 0x6E, 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x4C, 0x83, 0x02, 0x16, - 0x92, 0x02, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, 0x69, 0x6F, - 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, - 0x00, 0x83, 0x74, 0x75, 0x72, 0x6E, 0x00, 0x55, 0xAE, 0x02, 0x17, 0xB7, 0x02, 0x00, 0x17, 0x08, - 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, 0x80, 0x72, 0x6E, 0x00, 0x07, 0x08, - 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, 0x75, 0x64, 0x6F, 0x00, 0x18, 0x12, 0x12, 0x0F, 0x00, 0x81, - 0x6B, 0x75, 0x70, 0x00, 0x48, 0xDB, 0x02, 0x12, 0x03, 0x03, 0x00, 0x4C, 0xE5, 0x02, 0x0F, 0xEE, - 0x02, 0x11, 0xF8, 0x02, 0x00, 0x0B, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x17, 0x0C, - 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x17, 0x16, 0x0C, 0x0F, 0x00, 0x82, 0x65, 0x6E, - 0x65, 0x72, 0x00, 0x17, 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, - 0x74, 0x6F, 0x72, 0x00, 0x48, 0x1E, 0x03, 0x11, 0x26, 0x03, 0x18, 0x33, 0x03, 0x00, 0x0F, 0x04, - 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x04, 0x0C, 0x17, 0x11, 0x12, 0x06, 0x00, 0x83, 0x61, 0x69, - 0x6E, 0x73, 0x00, 0x16, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, - 0x75, 0x73, 0x00, 0x74, 0x59, 0x03, 0x0A, 0x66, 0x03, 0x0B, 0x70, 0x03, 0x0F, 0x86, 0x03, 0x11, - 0x91, 0x03, 0x16, 0xEA, 0x03, 0x18, 0xF8, 0x03, 0x00, 0x11, 0x08, 0x16, 0x12, 0x07, 0x00, 0x84, - 0x65, 0x73, 0x6E, 0x27, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, 0x68, 0x74, 0x00, - 0x47, 0x77, 0x03, 0x0A, 0x7E, 0x03, 0x00, 0x0C, 0x1A, 0x00, 0x81, 0x74, 0x68, 0x00, 0x11, 0x08, - 0x0F, 0x00, 0x81, 0x74, 0x68, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, - 0x00, 0x44, 0x9B, 0x03, 0x08, 0xA6, 0x03, 0x16, 0xE2, 0x03, 0x00, 0x15, 0x04, 0x13, 0x13, 0x04, - 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x55, 0xAD, 0x03, 0x19, 0xD8, 0x03, 0x00, 0x44, 0xB4, 0x03, - 0x15, 0xBF, 0x03, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, - 0x13, 0x00, 0x44, 0xC9, 0x03, 0x13, 0xD1, 0x03, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, - 0x00, 0x04, 0x00, 0x83, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, - 0x74, 0x00, 0x12, 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x09, 0x08, 0x11, 0x04, 0x10, - 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, 0x00, 0x53, 0xFF, 0x03, 0x17, 0x16, 0x04, 0x00, 0x57, - 0x06, 0x04, 0x18, 0x0E, 0x04, 0x00, 0x11, 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, - 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, - 0x46, 0x2D, 0x04, 0x08, 0x39, 0x04, 0x0B, 0x43, 0x04, 0x15, 0x55, 0x04, 0x00, 0x08, 0x18, 0x14, - 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, - 0x74, 0x79, 0x00, 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, - 0x72, 0x63, 0x68, 0x79, 0x00, 0x04, 0x05, 0x0C, 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00 -}; \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt deleted file mode 100644 index 8280fcf703b9..000000000000 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2021-2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -:guage -> gauge -:the the: -> the -:thier -> their -:ture -> true -accomodate -> accommodate -acommodate -> accommodate -aparent -> apparent -aparrent -> apparent -apparant -> apparent -apparrent -> apparent -aquire -> acquire -becuase -> because -cauhgt -> caught -cheif -> chief -choosen -> chosen -cieling -> ceiling -collegue -> colleague -concensus -> consensus -contians -> contains -cosnt -> const -dervied -> derived -dosen't -> doesn't -fales -> false -fasle -> false -fitler -> filter -flase -> false -foward -> forward -frequecy -> frequency -gaurantee -> guarantee -guaratee -> guarantee -heigth -> height -heirarchy -> hierarchy -inclued -> include -interator -> iterator -intput -> input -invliad -> invalid -lenght -> length -liasion -> liaison -libary -> library -listner -> listener -looses: -> loses -looup -> lookup -manefist -> manifest -namesapce -> namespace -namespcae -> namespace -occassion -> occasion -occured -> occurred -ouptut -> output -ouput -> output -overide -> override -postion -> position -priviledge -> privilege -psuedo -> pseudo -recieve -> receive -refered -> referred -relevent -> relevant -repitition -> repetition -reuslt -> result -retrun -> return -retun -> return -reutrn -> return -saftey -> safety -seperate -> separate -singed -> signed -stirng -> string -strign -> string -swithc -> switch -swtich -> switch -thresold -> threshold -udpate -> update -widht -> width \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 6565373a24e3..75a40724626e 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -74,8 +74,10 @@ void housekeeping_task_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } - if (!process_record_mkillewald(keycode, record)) { return false; } + if (!(process_record_keychron(keycode, record) && + process_record_myfork_keychron_ft(keycode, record) && + process_record_mkillewald(keycode, record))) { + return false; + } return true; } diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index ffeaa065e183..e0aee8d27b9c 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q1 Special Edition RGB ANSI ATMEGA32U4 ENC11 (knob) Keymap v2.0.2 -![Keychron Q1SE ANSI encoder](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q1/Q1SE_RGB_ANSI_ATMEGA32U4_ENC11.jpg) +![Keychron Q1SE ANSI encoder](https://i.imgur.com/Y0qHSzU.jpg) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn+J+Z) to clear the eeprom after flashing. @@ -20,8 +20,8 @@ When you flash this firmware for the first time, you should clear the eeprom so - Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - - Uses getreuer's autocorrect dictionary. - [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) + - Uses getreuer's 400 entry autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) - Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c index 39b96bb16397..a6de8613f1b9 100644 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c @@ -67,8 +67,10 @@ void housekeeping_task_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } - if (!process_record_mkillewald(keycode, record)) { return false; } + if (!(process_record_keychron(keycode, record) && + process_record_myfork_keychron_ft(keycode, record) && + process_record_mkillewald(keycode, record))) { + return false; + } return true; } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 1b74978fe61d..96ffeef80e31 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -81,9 +81,11 @@ void housekeeping_task_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keychron(keycode, record)) { return false; } - if (!process_record_myfork_keychron_ft(keycode, record)) { return false; } - if (!process_record_mkillewald(keycode, record)) { return false; } + if (!(process_record_keychron(keycode, record) && + process_record_myfork_keychron_ft(keycode, record) && + process_record_mkillewald(keycode, record))) { + return false; + } return true; } diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md index 0d580d2b2ade..f45653125937 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/readme.md @@ -1,6 +1,6 @@ ## Keychron Q2 SEVERED RGB ANSI STM32L432 ENC11 (knob) Keymap v2.0.2 -![Keychron Q2 ANSI encoder](https://raw.githubusercontent.com/mkillewald/glamour_shots/main/keyboards/keychron/q2/Q2_SEVERED_RGB_ANSI_STM32L432_ENC11.jpg) +![Keychron Q2 ANSI encoder](https://i.imgur.com/s9vb9F5.jpg) ### Highly Recommended: When you flash this firmware for the first time, you should clear the eeprom so that the eeprom defaults are properly set. Be aware that clearing the eeprom will erase any changes previously made in VIA. Please backup your VIA config before clearing the eeprom. If you place your keyboard in DFU mode by holding ESC and plugging in the USB cable, this should clear the eeprom even if you take it out of DFU mode at that point without flashing. Alternatively, you may use the factory reset key combo (Fn1+J+Z) to clear the eeprom after flashing. diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrect_data.h b/users/mkillewald/autocorrect_data.h similarity index 100% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrect_data.h rename to users/mkillewald/autocorrect_data.h diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt b/users/mkillewald/autocorrection_dict_extra.txt similarity index 100% rename from keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/autocorrection_dict_extra.txt rename to users/mkillewald/autocorrection_dict_extra.txt diff --git a/users/mkillewald/eeprom_user_config.c b/users/mkillewald/eeprom_user_config.c index 4091632abdda..010df6c8d2b0 100644 --- a/users/mkillewald/eeprom_user_config.c +++ b/users/mkillewald/eeprom_user_config.c @@ -32,6 +32,8 @@ typedef struct { HSV hsv_fn2; } user_config_t; +_Static_assert(sizeof(user_config_t) == EECONFIG_USER_DATA_SIZE, "User config structure larger than configured data size."); + user_config_t user_config; void eeconfig_init_user(void) { @@ -167,13 +169,4 @@ void user_config_set_hsv_win_fn1(HSV hsv) { void user_config_set_hsv_fn2(HSV hsv) { user_config.hsv_fn2 = hsv; user_config_write_eeprom(); -} - - - - - - - - - +} \ No newline at end of file diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h index d57add2527e9..16b6e5e66f2a 100644 --- a/users/mkillewald/mkillewald.h +++ b/users/mkillewald/mkillewald.h @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#ifndef USERSPACE -#define USERSPACE +#pragma once #include "quantum.h" @@ -44,6 +43,4 @@ uint8_t is_win_mode(void); void set_mac_base_rgb(void); void set_win_base_rgb(void); void housekeeping_task_mkillewald(void); -bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record); - -#endif \ No newline at end of file +bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record); \ No newline at end of file From dd9d7c294a2a20e8a8b94bb400705caeedb6bc4c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Fri, 12 May 2023 13:03:15 -0400 Subject: [PATCH 150/160] changed to smaller autocorrection dictionairy to reduce firmware size --- .../keymaps/mkillewald/autocorrect_data.h | 176 ++++++++++++++++++ .../mkillewald/autocorrection_dict.txt | 85 +++++++++ .../ansi_encoder/keymaps/mkillewald/readme.md | 4 +- 3 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h create mode 100644 keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h new file mode 100644 index 000000000000..a092cc777346 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrect_data.h @@ -0,0 +1,176 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +/******************************************************************************* + 88888888888 888 d8b .d888 d8b 888 d8b + 888 888 Y8P d88P" Y8P 888 Y8P + 888 888 888 888 + 888 88888b. 888 .d8888b 888888 888 888 .d88b. 888 .d8888b + 888 888 "88b 888 88K 888 888 888 d8P Y8b 888 88K + 888 888 888 888 "Y8888b. 888 888 888 88888888 888 "Y8888b. + 888 888 888 888 X88 888 888 888 Y8b. 888 X88 + 888 888 888 888 88888P' 888 888 888 "Y8888 888 88888P' + 888 888 + 888 888 + 888 888 + .d88b. .d88b. 88888b. .d88b. 888d888 8888b. 888888 .d88b. .d88888 + d88P"88b d8P Y8b 888 "88b d8P Y8b 888P" "88b 888 d8P Y8b d88" 888 + 888 888 88888888 888 888 88888888 888 .d888888 888 88888888 888 888 + Y88b 888 Y8b. 888 888 Y8b. 888 888 888 Y88b. Y8b. Y88b 888 + "Y88888 "Y8888 888 888 "Y8888 888 "Y888888 "Y888 "Y8888 "Y88888 + 888 + Y8b d88P + "Y88P" +*******************************************************************************/ + +#pragma once + +// Autocorrection dictionary (71 entries): +// :guage -> gauge +// :the:the: -> the +// :thier -> their +// :ture -> true +// accomodate -> accommodate +// acommodate -> accommodate +// aparent -> apparent +// aparrent -> apparent +// apparant -> apparent +// apparrent -> apparent +// aquire -> acquire +// becuase -> because +// cauhgt -> caught +// cheif -> chief +// choosen -> chosen +// cieling -> ceiling +// collegue -> colleague +// concensus -> consensus +// contians -> contains +// cosnt -> const +// dervied -> derived +// dosen't -> doesn't +// fales -> false +// fasle -> false +// fitler -> filter +// flase -> false +// foward -> forward +// frequecy -> frequency +// gaurantee -> guarantee +// guaratee -> guarantee +// heigth -> height +// heirarchy -> hierarchy +// inclued -> include +// interator -> iterator +// intput -> input +// invliad -> invalid +// lenght -> length +// liasion -> liaison +// libary -> library +// listner -> listener +// looses: -> loses +// looup -> lookup +// manefist -> manifest +// namesapce -> namespace +// namespcae -> namespace +// occassion -> occasion +// occured -> occurred +// ouptut -> output +// ouput -> output +// overide -> override +// postion -> position +// priviledge -> privilege +// psuedo -> pseudo +// recieve -> receive +// refered -> referred +// relevent -> relevant +// repitition -> repetition +// reuslt -> result +// retrun -> return +// retun -> return +// reutrn -> return +// saftey -> safety +// seperate -> separate +// singed -> signed +// stirng -> string +// strign -> string +// swithc -> switch +// swtich -> switch +// thresold -> threshold +// udpate -> update +// widht -> width + +#define AUTOCORRECT_MIN_LENGTH 5 // ":ture" +#define AUTOCORRECT_MAX_LENGTH 10 // "accomodate" +#define DICTIONARY_SIZE 1120 + +static const uint8_t autocorrect_data[DICTIONARY_SIZE] PROGMEM = { + 0x6C, 0x2B, 0x00, 0x06, 0x47, 0x00, 0x07, 0x51, 0x00, 0x08, 0xC7, 0x00, 0x09, 0xF0, 0x01, 0x0A, + 0xFA, 0x01, 0x0B, 0x1A, 0x02, 0x11, 0x35, 0x02, 0x12, 0xBE, 0x02, 0x13, 0xCA, 0x02, 0x15, 0xD4, + 0x02, 0x16, 0x14, 0x03, 0x17, 0x43, 0x03, 0x1C, 0x20, 0x04, 0x00, 0x48, 0x32, 0x00, 0x16, 0x3C, + 0x00, 0x00, 0x0B, 0x17, 0x2C, 0x08, 0x0B, 0x17, 0x2C, 0x00, 0x84, 0x00, 0x08, 0x16, 0x12, 0x12, + 0x0F, 0x00, 0x84, 0x73, 0x65, 0x73, 0x00, 0x0B, 0x17, 0x0C, 0x1A, 0x16, 0x00, 0x81, 0x63, 0x68, + 0x00, 0x44, 0x5E, 0x00, 0x08, 0x6A, 0x00, 0x0F, 0xAE, 0x00, 0x15, 0xBB, 0x00, 0x00, 0x0C, 0x0F, + 0x19, 0x11, 0x0C, 0x00, 0x83, 0x61, 0x6C, 0x69, 0x64, 0x00, 0x4A, 0x77, 0x00, 0x0C, 0x81, 0x00, + 0x15, 0x8C, 0x00, 0x18, 0xA5, 0x00, 0x00, 0x11, 0x0C, 0x16, 0x00, 0x83, 0x67, 0x6E, 0x65, 0x64, + 0x00, 0x19, 0x15, 0x08, 0x07, 0x00, 0x83, 0x69, 0x76, 0x65, 0x64, 0x00, 0x48, 0x93, 0x00, 0x18, + 0x9C, 0x00, 0x00, 0x09, 0x08, 0x15, 0x00, 0x81, 0x72, 0x65, 0x64, 0x00, 0x06, 0x06, 0x12, 0x00, + 0x81, 0x72, 0x65, 0x64, 0x00, 0x0F, 0x06, 0x11, 0x0C, 0x00, 0x81, 0x64, 0x65, 0x00, 0x12, 0x16, + 0x08, 0x15, 0x0B, 0x17, 0x00, 0x82, 0x68, 0x6F, 0x6C, 0x64, 0x00, 0x04, 0x1A, 0x12, 0x09, 0x00, + 0x83, 0x72, 0x77, 0x61, 0x72, 0x64, 0x00, 0x44, 0xE9, 0x00, 0x06, 0xF6, 0x00, 0x07, 0x04, 0x01, + 0x08, 0x10, 0x01, 0x0A, 0x34, 0x01, 0x0F, 0x51, 0x01, 0x15, 0x5A, 0x01, 0x16, 0x75, 0x01, 0x17, + 0x90, 0x01, 0x18, 0xD7, 0x01, 0x19, 0xE4, 0x01, 0x00, 0x06, 0x13, 0x16, 0x08, 0x10, 0x04, 0x11, + 0x00, 0x82, 0x61, 0x63, 0x65, 0x00, 0x13, 0x04, 0x16, 0x08, 0x10, 0x04, 0x11, 0x00, 0x83, 0x70, + 0x61, 0x63, 0x65, 0x00, 0x0C, 0x15, 0x08, 0x19, 0x12, 0x00, 0x82, 0x72, 0x69, 0x64, 0x65, 0x00, + 0x17, 0x00, 0x44, 0x19, 0x01, 0x11, 0x24, 0x01, 0x00, 0x15, 0x04, 0x18, 0x0A, 0x00, 0x82, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x04, 0x15, 0x18, 0x04, 0x0A, 0x00, 0x87, 0x75, 0x61, 0x72, 0x61, 0x6E, + 0x74, 0x65, 0x65, 0x00, 0x44, 0x3B, 0x01, 0x07, 0x45, 0x01, 0x00, 0x18, 0x0A, 0x2C, 0x00, 0x83, + 0x61, 0x75, 0x67, 0x65, 0x00, 0x08, 0x0F, 0x0C, 0x19, 0x0C, 0x15, 0x13, 0x00, 0x82, 0x67, 0x65, + 0x00, 0x16, 0x04, 0x09, 0x00, 0x82, 0x6C, 0x73, 0x65, 0x00, 0x4C, 0x61, 0x01, 0x18, 0x6D, 0x01, + 0x00, 0x18, 0x14, 0x04, 0x00, 0x84, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x00, 0x17, 0x2C, 0x00, + 0x82, 0x72, 0x75, 0x65, 0x00, 0x04, 0x00, 0x4F, 0x7E, 0x01, 0x18, 0x86, 0x01, 0x00, 0x09, 0x00, + 0x83, 0x61, 0x6C, 0x73, 0x65, 0x00, 0x06, 0x08, 0x05, 0x00, 0x83, 0x61, 0x75, 0x73, 0x65, 0x00, + 0x04, 0x00, 0x47, 0x9C, 0x01, 0x13, 0xC1, 0x01, 0x15, 0xCB, 0x01, 0x00, 0x12, 0x10, 0x00, 0x50, + 0xA6, 0x01, 0x12, 0xB5, 0x01, 0x00, 0x12, 0x06, 0x04, 0x00, 0x87, 0x63, 0x6F, 0x6D, 0x6D, 0x6F, + 0x64, 0x61, 0x74, 0x65, 0x00, 0x06, 0x06, 0x04, 0x00, 0x84, 0x6D, 0x6F, 0x64, 0x61, 0x74, 0x65, + 0x00, 0x07, 0x18, 0x00, 0x84, 0x70, 0x64, 0x61, 0x74, 0x65, 0x00, 0x08, 0x13, 0x08, 0x16, 0x00, + 0x84, 0x61, 0x72, 0x61, 0x74, 0x65, 0x00, 0x0A, 0x08, 0x0F, 0x0F, 0x12, 0x06, 0x00, 0x82, 0x61, + 0x67, 0x75, 0x65, 0x00, 0x08, 0x0C, 0x06, 0x08, 0x15, 0x00, 0x83, 0x65, 0x69, 0x76, 0x65, 0x00, + 0x0C, 0x08, 0x0B, 0x06, 0x00, 0x82, 0x69, 0x65, 0x66, 0x00, 0x11, 0x00, 0x4C, 0x03, 0x02, 0x15, + 0x10, 0x02, 0x00, 0x0F, 0x08, 0x0C, 0x06, 0x00, 0x85, 0x65, 0x69, 0x6C, 0x69, 0x6E, 0x67, 0x00, + 0x0C, 0x17, 0x16, 0x00, 0x83, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x46, 0x21, 0x02, 0x17, 0x2C, 0x02, + 0x00, 0x0C, 0x17, 0x1A, 0x16, 0x00, 0x83, 0x69, 0x74, 0x63, 0x68, 0x00, 0x0A, 0x0C, 0x08, 0x0B, + 0x00, 0x81, 0x68, 0x74, 0x00, 0x48, 0x45, 0x02, 0x0A, 0x50, 0x02, 0x12, 0x59, 0x02, 0x15, 0x9C, + 0x02, 0x18, 0xA7, 0x02, 0x00, 0x16, 0x12, 0x12, 0x0B, 0x06, 0x00, 0x83, 0x73, 0x65, 0x6E, 0x00, + 0x0C, 0x15, 0x17, 0x16, 0x00, 0x81, 0x6E, 0x67, 0x00, 0x0C, 0x00, 0x56, 0x62, 0x02, 0x17, 0x7C, + 0x02, 0x00, 0x44, 0x69, 0x02, 0x16, 0x72, 0x02, 0x00, 0x0C, 0x0F, 0x00, 0x83, 0x69, 0x73, 0x6F, + 0x6E, 0x00, 0x04, 0x06, 0x06, 0x12, 0x00, 0x83, 0x69, 0x6F, 0x6E, 0x00, 0x4C, 0x83, 0x02, 0x16, + 0x92, 0x02, 0x00, 0x17, 0x0C, 0x13, 0x08, 0x15, 0x00, 0x86, 0x65, 0x74, 0x69, 0x74, 0x69, 0x6F, + 0x6E, 0x00, 0x12, 0x13, 0x00, 0x83, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x17, 0x18, 0x08, 0x15, + 0x00, 0x83, 0x74, 0x75, 0x72, 0x6E, 0x00, 0x55, 0xAE, 0x02, 0x17, 0xB7, 0x02, 0x00, 0x17, 0x08, + 0x15, 0x00, 0x82, 0x75, 0x72, 0x6E, 0x00, 0x08, 0x15, 0x00, 0x80, 0x72, 0x6E, 0x00, 0x07, 0x08, + 0x18, 0x16, 0x13, 0x00, 0x83, 0x65, 0x75, 0x64, 0x6F, 0x00, 0x18, 0x12, 0x12, 0x0F, 0x00, 0x81, + 0x6B, 0x75, 0x70, 0x00, 0x48, 0xDB, 0x02, 0x12, 0x03, 0x03, 0x00, 0x4C, 0xE5, 0x02, 0x0F, 0xEE, + 0x02, 0x11, 0xF8, 0x02, 0x00, 0x0B, 0x17, 0x2C, 0x00, 0x82, 0x65, 0x69, 0x72, 0x00, 0x17, 0x0C, + 0x09, 0x00, 0x83, 0x6C, 0x74, 0x65, 0x72, 0x00, 0x17, 0x16, 0x0C, 0x0F, 0x00, 0x82, 0x65, 0x6E, + 0x65, 0x72, 0x00, 0x17, 0x04, 0x15, 0x08, 0x17, 0x11, 0x0C, 0x00, 0x87, 0x74, 0x65, 0x72, 0x61, + 0x74, 0x6F, 0x72, 0x00, 0x48, 0x1E, 0x03, 0x11, 0x26, 0x03, 0x18, 0x33, 0x03, 0x00, 0x0F, 0x04, + 0x09, 0x00, 0x81, 0x73, 0x65, 0x00, 0x04, 0x0C, 0x17, 0x11, 0x12, 0x06, 0x00, 0x83, 0x61, 0x69, + 0x6E, 0x73, 0x00, 0x16, 0x11, 0x08, 0x06, 0x11, 0x12, 0x06, 0x00, 0x85, 0x73, 0x65, 0x6E, 0x73, + 0x75, 0x73, 0x00, 0x74, 0x59, 0x03, 0x0A, 0x66, 0x03, 0x0B, 0x70, 0x03, 0x0F, 0x86, 0x03, 0x11, + 0x91, 0x03, 0x16, 0xEA, 0x03, 0x18, 0xF8, 0x03, 0x00, 0x11, 0x08, 0x16, 0x12, 0x07, 0x00, 0x84, + 0x65, 0x73, 0x6E, 0x27, 0x74, 0x00, 0x0B, 0x18, 0x04, 0x06, 0x00, 0x82, 0x67, 0x68, 0x74, 0x00, + 0x47, 0x77, 0x03, 0x0A, 0x7E, 0x03, 0x00, 0x0C, 0x1A, 0x00, 0x81, 0x74, 0x68, 0x00, 0x11, 0x08, + 0x0F, 0x00, 0x81, 0x74, 0x68, 0x00, 0x16, 0x18, 0x08, 0x15, 0x00, 0x83, 0x73, 0x75, 0x6C, 0x74, + 0x00, 0x44, 0x9B, 0x03, 0x08, 0xA6, 0x03, 0x16, 0xE2, 0x03, 0x00, 0x15, 0x04, 0x13, 0x13, 0x04, + 0x00, 0x82, 0x65, 0x6E, 0x74, 0x00, 0x55, 0xAD, 0x03, 0x19, 0xD8, 0x03, 0x00, 0x44, 0xB4, 0x03, + 0x15, 0xBF, 0x03, 0x00, 0x13, 0x04, 0x00, 0x84, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, 0x00, 0x04, + 0x13, 0x00, 0x44, 0xC9, 0x03, 0x13, 0xD1, 0x03, 0x00, 0x85, 0x70, 0x61, 0x72, 0x65, 0x6E, 0x74, + 0x00, 0x04, 0x00, 0x83, 0x65, 0x6E, 0x74, 0x00, 0x08, 0x0F, 0x08, 0x15, 0x00, 0x82, 0x61, 0x6E, + 0x74, 0x00, 0x12, 0x06, 0x00, 0x82, 0x6E, 0x73, 0x74, 0x00, 0x0C, 0x09, 0x08, 0x11, 0x04, 0x10, + 0x00, 0x84, 0x69, 0x66, 0x65, 0x73, 0x74, 0x00, 0x53, 0xFF, 0x03, 0x17, 0x16, 0x04, 0x00, 0x57, + 0x06, 0x04, 0x18, 0x0E, 0x04, 0x00, 0x11, 0x0C, 0x00, 0x83, 0x70, 0x75, 0x74, 0x00, 0x12, 0x00, + 0x82, 0x74, 0x70, 0x75, 0x74, 0x00, 0x13, 0x18, 0x12, 0x00, 0x83, 0x74, 0x70, 0x75, 0x74, 0x00, + 0x46, 0x2D, 0x04, 0x08, 0x39, 0x04, 0x0B, 0x43, 0x04, 0x15, 0x55, 0x04, 0x00, 0x08, 0x18, 0x14, + 0x08, 0x15, 0x09, 0x00, 0x81, 0x6E, 0x63, 0x79, 0x00, 0x17, 0x09, 0x04, 0x16, 0x00, 0x82, 0x65, + 0x74, 0x79, 0x00, 0x06, 0x15, 0x04, 0x15, 0x0C, 0x08, 0x0B, 0x00, 0x87, 0x69, 0x65, 0x72, 0x61, + 0x72, 0x63, 0x68, 0x79, 0x00, 0x04, 0x05, 0x0C, 0x0F, 0x00, 0x82, 0x72, 0x61, 0x72, 0x79, 0x00 +}; \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt new file mode 100644 index 000000000000..8280fcf703b9 --- /dev/null +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/autocorrection_dict.txt @@ -0,0 +1,85 @@ +# Copyright 2021-2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +:guage -> gauge +:the the: -> the +:thier -> their +:ture -> true +accomodate -> accommodate +acommodate -> accommodate +aparent -> apparent +aparrent -> apparent +apparant -> apparent +apparrent -> apparent +aquire -> acquire +becuase -> because +cauhgt -> caught +cheif -> chief +choosen -> chosen +cieling -> ceiling +collegue -> colleague +concensus -> consensus +contians -> contains +cosnt -> const +dervied -> derived +dosen't -> doesn't +fales -> false +fasle -> false +fitler -> filter +flase -> false +foward -> forward +frequecy -> frequency +gaurantee -> guarantee +guaratee -> guarantee +heigth -> height +heirarchy -> hierarchy +inclued -> include +interator -> iterator +intput -> input +invliad -> invalid +lenght -> length +liasion -> liaison +libary -> library +listner -> listener +looses: -> loses +looup -> lookup +manefist -> manifest +namesapce -> namespace +namespcae -> namespace +occassion -> occasion +occured -> occurred +ouptut -> output +ouput -> output +overide -> override +postion -> position +priviledge -> privilege +psuedo -> pseudo +recieve -> receive +refered -> referred +relevent -> relevant +repitition -> repetition +reuslt -> result +retrun -> return +retun -> return +reutrn -> return +saftey -> safety +seperate -> separate +singed -> signed +stirng -> string +strign -> string +swithc -> switch +swtich -> switch +thresold -> threshold +udpate -> update +widht -> width \ No newline at end of file diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md index e0aee8d27b9c..6cd09e93a129 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/readme.md @@ -20,8 +20,8 @@ When you flash this firmware for the first time, you should clear the eeprom so - Different RGB settings for Mac base and Win base layers. You can set different RGB animations, colors, brightness and speed using the standard RGB keyboard shortcuts. - Autocorrect is enabled. ([https://docs.qmk.fm/#/feature_autocorrect](https://docs.qmk.fm/#/feature_autocorrect)) - - Uses getreuer's 400 entry autocorrect dictionary. - [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict_extra.txt) + - Uses getreuer's autocorrect dictionary. + [https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt](https://github.com/getreuer/qmk-keymap/blob/main/features/autocorrection_dict.txt) - Caps Word enabled with RGB indicator. ([https://docs.qmk.fm/#/feature_caps_word](https://docs.qmk.fm/#/feature_caps_word)) From f832b6414151125d6fee501f999c35601ad8c02b Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Sun, 14 May 2023 09:19:42 -0400 Subject: [PATCH 151/160] removed housekeeping_task_mkillewald() and replaced with shutdown_user() --- .../ansi_encoder/keymaps/mkillewald/keymap.c | 1 - .../q1/iso/keymaps/mkillewald/keymap.c | 1 - .../ansi_encoder/keymaps/mkillewald/keymap.c | 1 - users/mkillewald/mkillewald.c | 57 ++++++------------- users/mkillewald/mkillewald.h | 8 --- 5 files changed, 18 insertions(+), 50 deletions(-) diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 75a40724626e..7d325694413f 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -70,7 +70,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_myfork_keychron_ft(); - housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c index a6de8613f1b9..cce76ad004e8 100644 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c @@ -63,7 +63,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_myfork_keychron_ft(); - housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index 96ffeef80e31..eea6b24b74eb 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -77,7 +77,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_myfork_keychron_ft(); - housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/users/mkillewald/mkillewald.c b/users/mkillewald/mkillewald.c index e1d8a544834a..2ab7773d56fa 100644 --- a/users/mkillewald/mkillewald.c +++ b/users/mkillewald/mkillewald.c @@ -79,12 +79,10 @@ void set_win_base_rgb(void) { } __attribute__ ((weak)) -void matrix_init_keymap(void) { - return; -} +void matrix_init_keymap(void) {} void matrix_init_user(void) { -#ifdef RGB_MATRIX_ENABLE +#if defined(RGB_MATRIX_ENABLE) rgb_matrix_init_user(); #endif @@ -92,14 +90,12 @@ void matrix_init_user(void) { } __attribute__ ((weak)) -void keyboard_post_init_keymap(void) { - return; -} +void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { user_config_read_eeprom(); -#ifdef AUTOCORRECT_OFF_AT_STARTUP +#if defined(AUTOCORRECT_OFF_AT_STARTUP) // toggle autocorrect off at startup if (autocorrect_is_enabled()) { autocorrect_toggle(); } #endif @@ -107,41 +103,24 @@ void keyboard_post_init_user(void) { keyboard_post_init_keymap(); } -void housekeeping_task_mkillewald(void) { - switch(bootloader_state) { - case BOOTLOADER_DO: - // bootloader was pressed two frames ago. RGB should now be off, - // so we can call the bootloader. - reset_keyboard(); - break; - case BOOTLOADER_WAIT: - // bootloader was pressed on previous frame, we wait this frame and - // set flag to do bootloader at end of next frame. For some reason, my - // Q2 needed this extra wait frame. - bootloader_state = BOOTLOADER_DO; - break; - case BOOTLOADER_PRESSED: - // User pressed bootloader keycode and RGB was disabled earlier in this - // frame. However RGB changes wont take place immediately, so we set a - // flag here which will be caught at end of the next frame. - bootloader_state = BOOTLOADER_WAIT; - break; - default: - break; - } +#if defined(RGB_MATRIX_ENABLE) +void rgb_matrix_update_pwm_buffers(void); +#endif + +__attribute__((weak)) void shutdown_keymap(void) {} + +void shutdown_user(void) { +#if defined(RGB_MATRIX_ENABLE) + // to disable RGB when entering DFU mode from QK_BOOT keycode + rgb_matrix_set_color_all(0x00, 0x00, 0x00); + rgb_matrix_update_pwm_buffers(); +#endif + + shutdown_keymap(); } bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case QK_BOOT: - // We want to turn off LEDs before calling bootloader, so here - // we call rgb_matrix_disable_noeeprom() and set a flag because - // the LEDs won't be updated until the next frame. - if (record->event.pressed) { - rgb_matrix_disable_noeeprom(); - bootloader_state = BOOTLOADER_PRESSED; - } - return false; // Skip all further processing of this key case RGB_TOG: if (record->event.pressed) { rgb_matrix_toggle_noeeprom(); diff --git a/users/mkillewald/mkillewald.h b/users/mkillewald/mkillewald.h index 16b6e5e66f2a..c1b955a23952 100644 --- a/users/mkillewald/mkillewald.h +++ b/users/mkillewald/mkillewald.h @@ -18,13 +18,6 @@ #include "quantum.h" -enum my_bootloader_state { - BOOTLOADER_INACTIVE, - BOOTLOADER_PRESSED, - BOOTLOADER_WAIT, - BOOTLOADER_DO -} bootloader_state; - enum my_keycodes { KC_LIGHT_TAB_TOGGLE = QK_USER_0, KC_LIGHT_ALPHAS_TOGGLE, @@ -42,5 +35,4 @@ enum my_keycodes { uint8_t is_win_mode(void); void set_mac_base_rgb(void); void set_win_base_rgb(void); -void housekeeping_task_mkillewald(void); bool process_record_mkillewald(uint16_t keycode, keyrecord_t *record); \ No newline at end of file From 78f4dbfc27791164da8f40d8da9aa0afc63ff3c9 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Mon, 15 May 2023 01:22:42 -0400 Subject: [PATCH 152/160] removed call to housekeeping_task_mkillewald() --- keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index 250c49476c87..db331c6b6ca2 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -63,7 +63,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_myfork_keychron_ft(); - housekeeping_task_mkillewald(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { From a990ff9a766b5b06c304be448621177434e03851 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 10:50:08 -0400 Subject: [PATCH 153/160] started using deferred exec instead of manual timers --- .../q1/ansi/keymaps/mkillewald/keymap.c | 1 - .../ansi_encoder/keymaps/mkillewald/keymap.c | 1 - .../q1/iso/keymaps/mkillewald/keymap.c | 1 - .../ansi_encoder/keymaps/mkillewald/keymap.c | 1 - users/mkillewald/myfork_keychron_ft.c | 167 ++++++++---------- users/mkillewald/rules.mk | 1 + 6 files changed, 79 insertions(+), 93 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index db331c6b6ca2..e4f6c2db728a 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -62,7 +62,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_myfork_keychron_ft(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c index 7d325694413f..dabc703d1204 100644 --- a/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi_encoder/keymaps/mkillewald/keymap.c @@ -69,7 +69,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_myfork_keychron_ft(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c index cce76ad004e8..d43ee99e6dfe 100644 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c @@ -62,7 +62,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_myfork_keychron_ft(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c index eea6b24b74eb..2965f9f5489e 100644 --- a/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q2/ansi_encoder/keymaps/mkillewald/keymap.c @@ -76,7 +76,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { void housekeeping_task_user(void) { housekeeping_task_keychron(); - housekeeping_task_myfork_keychron_ft(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index a6b8cbbe7efa..c3db7949c332 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -27,9 +27,8 @@ enum { }; // clang-format on +deferred_token combo_exec_token; uint16_t key_press_status = 0; -uint32_t timer_3s_buffer = 0; -uint32_t timer_300ms_buffer = 0; uint8_t factory_reset_count = 0; extern matrix_row_t matrix[MATRIX_ROWS]; @@ -41,6 +40,74 @@ HSV hsv; # endif #endif +static uint32_t LED_flash_300ms(uint32_t trigger_time, void *cb_arg) { + if (factory_reset_count++ > 6) { + factory_reset_count = 0; +#ifdef RGB_MATRIX_ENABLE + if (is_win_mode()) { + set_win_base_rgb(); + } else { + set_mac_base_rgb(); + } +# ifdef SPLIT_KEYBOARD + rgb_matrix_mode_noeeprom(led_state); + rgb_matrix_sethsv_noeeprom(hsv.h, hsv.s, hsv.v); +# endif +#endif + return 0; // no repeat + } + return 300; // repeat 300ms +} + +static void factory_reset(void) { + defer_exec(300, LED_flash_300ms, NULL); + factory_reset_count++; + layer_state_t default_layer = default_layer_state; + eeconfig_init(); + default_layer_set(default_layer); + led_test_mode = LED_TEST_MODE_OFF; +#ifdef LED_MATRIX_ENABLE + if (!led_matrix_is_enabled()) { + led_matrix_enable(); + } + led_matrix_init(); +#endif +#ifdef RGB_MATRIX_ENABLE + if (!rgb_matrix_is_enabled()) { + rgb_matrix_enable(); + } + rgb_matrix_init(); +# ifdef SPLIT_KEYBOARD + led_state = rgb_matrix_get_mode(); + hsv = rgb_matrix_get_hsv(); + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); +# endif +#endif +} + +static uint32_t combo_exec_3s(uint32_t trigger_time, void *cb_arg) { + if (key_press_status == KEY_PRESS_FACTORY_RESET) { + factory_reset(); + } else if (key_press_status == KEY_PRESS_LED_TEST) { +#ifdef SPLIT_KEYBOARD + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); +#endif + led_test_mode = LED_TEST_MODE_WHITE; +#ifdef LED_MATRIX_ENABLE + if (!led_matrix_is_enabled()) { + led_matrix_enable_noeeprom(); + } +#endif +#ifdef RGB_MATRIX_ENABLE + if (!rgb_matrix_is_enabled()) { + rgb_matrix_enable_noeeprom(); + } +#endif + } + key_press_status = 0; + return 0; // no repeat +} + __attribute__((weak)) bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -55,7 +122,7 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { key_press_status |= KEY_PRESS_STEP_0; } else { key_press_status &= ~KEY_PRESS_STEP_0; - timer_3s_buffer = 0; + cancel_deferred_exec(combo_exec_token); } return true; #endif @@ -67,11 +134,11 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_1; if (key_press_status == KEY_PRESS_FACTORY_RESET) { - timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + combo_exec_token = defer_exec(3000, combo_exec_3s, NULL); } } else { key_press_status &= ~KEY_PRESS_STEP_1; - timer_3s_buffer = 0; + cancel_deferred_exec(combo_exec_token); } return true; case RESET_KEY2: @@ -81,11 +148,11 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { key_press_status |= KEY_PRESS_STEP_2; if (key_press_status == KEY_PRESS_FACTORY_RESET) { - timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + combo_exec_token = defer_exec(3000, combo_exec_3s, NULL); } } else { key_press_status &= ~KEY_PRESS_STEP_2; - timer_3s_buffer = 0; + cancel_deferred_exec(combo_exec_token); } return true; #endif @@ -98,11 +165,11 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { led_test_mode = LED_TEST_MODE_WHITE; } } else if (key_press_status == KEY_PRESS_LED_TEST) { - timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + combo_exec_token = defer_exec(3000, combo_exec_3s, NULL); } } else { key_press_status &= ~KEY_PRESS_STEP_3; - timer_3s_buffer = 0; + cancel_deferred_exec(combo_exec_token); } return true; case BL_TEST_KEY2: @@ -124,11 +191,11 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { } # endif } else if (key_press_status == KEY_PRESS_LED_TEST) { - timer_3s_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); + combo_exec_token = defer_exec(3000, combo_exec_3s, NULL); } } else { key_press_status &= ~KEY_PRESS_STEP_4; - timer_3s_buffer = 0; + cancel_deferred_exec(combo_exec_token); } return true; #endif @@ -137,84 +204,6 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { } } -static void factory_reset(void) { - timer_300ms_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); - factory_reset_count++; - layer_state_t default_layer = default_layer_state; - eeconfig_init(); - default_layer_set(default_layer); - led_test_mode = LED_TEST_MODE_OFF; -#ifdef LED_MATRIX_ENABLE - if (!led_matrix_is_enabled()) { - led_matrix_enable(); - } - led_matrix_init(); -#endif -#ifdef RGB_MATRIX_ENABLE - if (!rgb_matrix_is_enabled()) { - rgb_matrix_enable(); - } - rgb_matrix_init(); -# ifdef SPLIT_KEYBOARD - led_state = rgb_matrix_get_mode(); - hsv = rgb_matrix_get_hsv(); - rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); -# endif -#endif -} - -static void timer_3s_task(void) { - if (sync_timer_elapsed32(timer_3s_buffer) > 3000) { - timer_3s_buffer = 0; - if (key_press_status == KEY_PRESS_FACTORY_RESET) { - factory_reset(); -#ifdef RGB_MATRIX_ENABLE - if (is_win_mode()) { set_win_base_rgb(); } -#endif - } else if (key_press_status == KEY_PRESS_LED_TEST) { -#ifdef SPLIT_KEYBOARD - rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); -#endif - led_test_mode = LED_TEST_MODE_WHITE; -#ifdef LED_MATRIX_ENABLE - if (!led_matrix_is_enabled()) { - led_matrix_enable_noeeprom(); - } -#endif -#ifdef RGB_MATRIX_ENABLE - if (!rgb_matrix_is_enabled()) { - rgb_matrix_enable_noeeprom(); - } -#endif - } - key_press_status = 0; - } -} - -static void timer_300ms_task(void) { - if (sync_timer_elapsed32(timer_300ms_buffer) > 300) { - if (factory_reset_count++ > 6) { - timer_300ms_buffer = 0; - factory_reset_count = 0; -#ifdef SPLIT_KEYBOARD - rgb_matrix_mode_noeeprom(led_state); - rgb_matrix_sethsv_noeeprom(hsv.h, hsv.s, hsv.v); -#endif - } else { - timer_300ms_buffer = sync_timer_read32() == 0 ? 1 : sync_timer_read32(); - } - } -} - -void housekeeping_task_myfork_keychron_ft(void) { - if (timer_3s_buffer) { - timer_3s_task(); - } - if (timer_300ms_buffer) { - timer_300ms_task(); - } -} - #ifdef LED_MATRIX_ENABLE bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max) { if (factory_reset_count) { diff --git a/users/mkillewald/rules.mk b/users/mkillewald/rules.mk index 7667847e6864..ef24a1758ab8 100644 --- a/users/mkillewald/rules.mk +++ b/users/mkillewald/rules.mk @@ -1,5 +1,6 @@ RAW_ENABLE = no VIA_ENABLE = yes +DEFERRED_EXEC_ENABLE = yes SRC += mkillewald.c SRC += eeprom_user_config.c From 2f372e795263eae1dd4b89543c743e67eb961adb Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 11:02:27 -0400 Subject: [PATCH 154/160] changed ifdef to if defined --- users/mkillewald/myfork_keychron_ft.c | 22 +++++++++++----------- users/mkillewald/myfork_keychron_ft.h | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index c3db7949c332..9b0730d52ebb 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -32,8 +32,8 @@ uint16_t key_press_status = 0; uint8_t factory_reset_count = 0; extern matrix_row_t matrix[MATRIX_ROWS]; -#ifdef SPLIT_KEYBOARD -# ifdef RGB_MATRIX_ENABLE +#if defined(SPLIT_KEYBOARD) +# if defined(RGB_MATRIX_ENABLE) uint8_t led_state = 0; uint8_t light_test_state = 0; HSV hsv; @@ -43,7 +43,7 @@ HSV hsv; static uint32_t LED_flash_300ms(uint32_t trigger_time, void *cb_arg) { if (factory_reset_count++ > 6) { factory_reset_count = 0; -#ifdef RGB_MATRIX_ENABLE +#if defined(RGB_MATRIX_ENABLE) if (is_win_mode()) { set_win_base_rgb(); } else { @@ -66,13 +66,13 @@ static void factory_reset(void) { eeconfig_init(); default_layer_set(default_layer); led_test_mode = LED_TEST_MODE_OFF; -#ifdef LED_MATRIX_ENABLE +#if defined(LED_MATRIX_ENABLE) if (!led_matrix_is_enabled()) { led_matrix_enable(); } led_matrix_init(); #endif -#ifdef RGB_MATRIX_ENABLE +#if defined(RGB_MATRIX_ENABLE) if (!rgb_matrix_is_enabled()) { rgb_matrix_enable(); } @@ -89,16 +89,16 @@ static uint32_t combo_exec_3s(uint32_t trigger_time, void *cb_arg) { if (key_press_status == KEY_PRESS_FACTORY_RESET) { factory_reset(); } else if (key_press_status == KEY_PRESS_LED_TEST) { -#ifdef SPLIT_KEYBOARD +#if defined(SPLIT_KEYBOARD) rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); #endif led_test_mode = LED_TEST_MODE_WHITE; -#ifdef LED_MATRIX_ENABLE +#if defined(LED_MATRIX_ENABLE) if (!led_matrix_is_enabled()) { led_matrix_enable_noeeprom(); } #endif -#ifdef RGB_MATRIX_ENABLE +#if defined(RGB_MATRIX_ENABLE) if (!rgb_matrix_is_enabled()) { rgb_matrix_enable_noeeprom(); } @@ -115,7 +115,7 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { # ifdef FN_KEY1 case FN_KEY1: /* fall through */ # endif -# ifdef FN_KEY2 +# if defined(FN_KEY2) case FN_KEY2: # endif if (record->event.pressed) { @@ -204,7 +204,7 @@ bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record) { } } -#ifdef LED_MATRIX_ENABLE +#if defined(LED_MATRIX_ENABLE) bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max) { if (factory_reset_count) { for (uint8_t i = led_min; i <= led_max; i++) { @@ -215,7 +215,7 @@ bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t } #endif -#ifdef RGB_MATRIX_ENABLE +#if defined(RGB_MATRIX_ENABLE) bool rgb_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max) { if (factory_reset_count) { if (rgb_matrix_get_mode() == RGB_MATRIX_SOLID_COLOR) { diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h index bdda7c2d4398..954cfbc50ba9 100644 --- a/users/mkillewald/myfork_keychron_ft.h +++ b/users/mkillewald/myfork_keychron_ft.h @@ -37,7 +37,7 @@ enum { extern uint16_t key_press_status; extern uint32_t timer_3s_buffer; -#ifdef SPLIT_KEYBOARD +#if defined(SPLIT_KEYBOARD) # ifdef RGB_MATRIX_ENABLE extern uint8_t led_state; extern uint8_t light_test_state; @@ -48,10 +48,10 @@ extern HSV hsv; bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record); void housekeeping_task_myfork_keychron_ft(void); -#ifdef LED_MATRIX_ENABLE +#if defined(LED_MATRIX_ENABLE) bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max); #endif -#ifdef RGB_MATRIX_ENABLE +#if defined(RGB_MATRIX_ENABLE) bool rgb_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max); #endif \ No newline at end of file From 666cd7925d43d1d26de8e6f11bde634729ea3bdd Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 11:03:24 -0400 Subject: [PATCH 155/160] changed ifdef to if defined --- users/mkillewald/myfork_keychron_ft.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h index 954cfbc50ba9..0773adf04131 100644 --- a/users/mkillewald/myfork_keychron_ft.h +++ b/users/mkillewald/myfork_keychron_ft.h @@ -38,7 +38,7 @@ enum { extern uint16_t key_press_status; extern uint32_t timer_3s_buffer; #if defined(SPLIT_KEYBOARD) -# ifdef RGB_MATRIX_ENABLE +# if defined(RGB_MATRIX_ENABLE) extern uint8_t led_state; extern uint8_t light_test_state; extern HSV hsv; From 5e963c88cbad9e9d8c1f08067d721006c9043563 Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 11:07:14 -0400 Subject: [PATCH 156/160] removed unneeded function delcaration --- users/mkillewald/myfork_keychron_ft.h | 1 - 1 file changed, 1 deletion(-) diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h index 0773adf04131..4a07899fec1b 100644 --- a/users/mkillewald/myfork_keychron_ft.h +++ b/users/mkillewald/myfork_keychron_ft.h @@ -46,7 +46,6 @@ extern HSV hsv; #endif bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record); -void housekeeping_task_myfork_keychron_ft(void); #if defined(LED_MATRIX_ENABLE) bool led_matrix_indicators_advanced_myfork_keychron_ft(uint8_t led_min, uint8_t led_max); From f3afd9f97edb768a1c2a6307f8000a4d1d47d21e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 12:12:46 -0400 Subject: [PATCH 157/160] fixed tab indent, more ifdef conversion --- users/mkillewald/myfork_keychron_ft.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index 9b0730d52ebb..eec5915e4fec 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -44,12 +44,12 @@ static uint32_t LED_flash_300ms(uint32_t trigger_time, void *cb_arg) { if (factory_reset_count++ > 6) { factory_reset_count = 0; #if defined(RGB_MATRIX_ENABLE) - if (is_win_mode()) { - set_win_base_rgb(); - } else { - set_mac_base_rgb(); - } -# ifdef SPLIT_KEYBOARD + if (is_win_mode()) { + set_win_base_rgb(); + } else { + set_mac_base_rgb(); + } +# if defined(SPLIT_KEYBOARD) rgb_matrix_mode_noeeprom(led_state); rgb_matrix_sethsv_noeeprom(hsv.h, hsv.s, hsv.v); # endif @@ -77,7 +77,7 @@ static void factory_reset(void) { rgb_matrix_enable(); } rgb_matrix_init(); -# ifdef SPLIT_KEYBOARD +# if defined(SPLIT_KEYBOARD) led_state = rgb_matrix_get_mode(); hsv = rgb_matrix_get_hsv(); rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); From 591d90558f77c22931fd560284cfe2c03c96280f Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 16:45:22 -0400 Subject: [PATCH 158/160] header clean up --- users/mkillewald/myfork_keychron_ft.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h index 4a07899fec1b..32d43e9164aa 100644 --- a/users/mkillewald/myfork_keychron_ft.h +++ b/users/mkillewald/myfork_keychron_ft.h @@ -24,6 +24,7 @@ #define KEY_PRESS_STEP_4 (0x1 << 4) #define KEY_PRESS_FACTORY_RESET (KEY_PRESS_STEP_0 | KEY_PRESS_STEP_1 | KEY_PRESS_STEP_2) #define KEY_PRESS_LED_TEST (KEY_PRESS_STEP_0 | KEY_PRESS_STEP_3 | KEY_PRESS_STEP_4) + // clang-format off enum { LED_TEST_MODE_OFF, @@ -35,10 +36,8 @@ enum { } led_test_mode; // clang-format on -extern uint16_t key_press_status; -extern uint32_t timer_3s_buffer; -#if defined(SPLIT_KEYBOARD) -# if defined(RGB_MATRIX_ENABLE) +#if defined(RGB_MATRIX_ENABLE) +# if defined(SPLIT_KEYBOARD) extern uint8_t led_state; extern uint8_t light_test_state; extern HSV hsv; From 6419c6a00e72bbde105ee9ea923bdd690696c06c Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Tue, 16 May 2023 21:04:29 -0400 Subject: [PATCH 159/160] combined nested #if define's --- users/mkillewald/myfork_keychron_ft.c | 4 +--- users/mkillewald/myfork_keychron_ft.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/users/mkillewald/myfork_keychron_ft.c b/users/mkillewald/myfork_keychron_ft.c index eec5915e4fec..e6d75c77537a 100644 --- a/users/mkillewald/myfork_keychron_ft.c +++ b/users/mkillewald/myfork_keychron_ft.c @@ -32,12 +32,10 @@ uint16_t key_press_status = 0; uint8_t factory_reset_count = 0; extern matrix_row_t matrix[MATRIX_ROWS]; -#if defined(SPLIT_KEYBOARD) -# if defined(RGB_MATRIX_ENABLE) +#if defined(RGB_MATRIX_ENABLE) && defined(SPLIT_KEYBOARD) uint8_t led_state = 0; uint8_t light_test_state = 0; HSV hsv; -# endif #endif static uint32_t LED_flash_300ms(uint32_t trigger_time, void *cb_arg) { diff --git a/users/mkillewald/myfork_keychron_ft.h b/users/mkillewald/myfork_keychron_ft.h index 32d43e9164aa..b9636ae9ec19 100644 --- a/users/mkillewald/myfork_keychron_ft.h +++ b/users/mkillewald/myfork_keychron_ft.h @@ -36,12 +36,10 @@ enum { } led_test_mode; // clang-format on -#if defined(RGB_MATRIX_ENABLE) -# if defined(SPLIT_KEYBOARD) +#if defined(RGB_MATRIX_ENABLE) && defined(SPLIT_KEYBOARD) extern uint8_t led_state; extern uint8_t light_test_state; extern HSV hsv; -# endif #endif bool process_record_myfork_keychron_ft(uint16_t keycode, keyrecord_t *record); From 30affe9064d321ede7774ccfef68b115fd19de5e Mon Sep 17 00:00:00 2001 From: Mike Killewald Date: Thu, 18 May 2023 13:26:23 -0400 Subject: [PATCH 160/160] changed KC_LALT to KC_LOPTN on mac base layer --- keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c | 2 +- keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h | 7 ++++++- keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c index e4f6c2db728a..8253e642fc98 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/keymap.c @@ -30,7 +30,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_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LOPTN, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN] = LAYOUT_ansi_82( KC_LBMAC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, diff --git a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h index e8733b342526..984a27aa77c8 100644 --- a/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h +++ b/keyboards/keychron/q1/ansi/keymaps/mkillewald/layers.h @@ -38,4 +38,9 @@ enum layers{ #define RESET_KEY2_ALT KC_LTTOG #define BL_TEST_KEY1 KC_RIGHT -#define BL_TEST_KEY2 KC_HOME \ No newline at end of file +#define BL_TEST_KEY2 KC_HOME + +#if !defined(KC_LOPTN) +#define KC_LOPTN KC_LOPT +#endif + diff --git a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c index d43ee99e6dfe..ad8217dad303 100644 --- a/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c +++ b/keyboards/keychron/q1/iso/keymaps/mkillewald/keymap.c @@ -30,7 +30,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_LBRC, KC_RBRC, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LOPTN, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN] = LAYOUT_iso_83( KC_LBMAC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,