diff options
Diffstat (limited to 'users')
117 files changed, 426 insertions, 1677 deletions
diff --git a/users/alfrdmalr/alfrdmalr.h b/users/alfrdmalr/alfrdmalr.h index c779a353d9..828001b582 100644 --- a/users/alfrdmalr/alfrdmalr.h +++ b/users/alfrdmalr/alfrdmalr.h @@ -148,7 +148,7 @@ enum alfrdmalr_keycodes { // RIGHT // - CORE -#define ____NUMPAD_R1____ KC_NLCK, KC_7, KC_8, KC_9, KC_MINS +#define ____NUMPAD_R1____ KC_NUM, KC_7, KC_8, KC_9, KC_MINS #define ____NUMPAD_R2____ KC_SPC, KC_4, KC_5, KC_6, KC_PLUS #define ____NUMPAD_R3____ KC_NO, KC_1, KC_2, KC_3, KC_SLSH diff --git a/users/anderson/seq.c b/users/anderson/seq.c index ff50648599..8e6edb35d3 100644 --- a/users/anderson/seq.c +++ b/users/anderson/seq.c @@ -11,7 +11,7 @@ void seq_start(void) { bool seq_feed(uint16_t keycode) { if (keycode == KC_ENTER) { for (int i = 0; i < buffer_size + 1; i++) { - tap_code(KC_BSPACE); + tap_code(KC_BACKSPACE); } for (int i = 0; i < seq_config_size; i++) { seq_t item = seq_config[i]; @@ -21,7 +21,7 @@ bool seq_feed(uint16_t keycode) { } buffer_size = 0; return false; - } else if (keycode == KC_BSPACE) { + } else if (keycode == KC_BACKSPACE) { if (buffer_size) { buffer_size--; tap_code(keycode); diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c index da85d4f6d4..fccae5ad6d 100644 --- a/users/arkag/arkag.c +++ b/users/arkag/arkag.c @@ -190,7 +190,7 @@ void set_os (uint8_t os, bool update) { } switch (os) { case OS_MAC: - set_unicode_input_mode(UC_OSX); + set_unicode_input_mode(UC_MAC); underglow = (Color){ 213, 255, 255 }; break; case OS_WIN: @@ -458,7 +458,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; - case KC_BSPACE: + case KC_BACKSPACE: if (record->event.pressed) { state = active; velocikey_accelerate(); diff --git a/users/arkag/mechmini2.jpg b/users/arkag/mechmini2.jpg Binary files differdeleted file mode 100644 index 611a0859c0..0000000000 --- a/users/arkag/mechmini2.jpg +++ /dev/null diff --git a/users/art/art.c b/users/art/art.c index 151249ec3f..f96a5d6cfd 100644 --- a/users/art/art.c +++ b/users/art/art.c @@ -64,7 +64,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { //Checking all other non-backspace keys to clear the backspace buffer. This is to prevent the bug of deleting N chars sometime after using a macro switch (keycode) { case LT(COMBOS,KC_BSPC): - case KC_BSPACE: + case KC_BACKSPACE: case KC_DEL: case KC_LSFT: case KC_RSFT: @@ -537,7 +537,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool shifted = get_mods() & MOD_MASK_SHIFT; clear_mods(); - press_n_times(15, KC_BSPACE); + press_n_times(15, KC_BACKSPACE); send_string_with_translation("heckout "); char_to_bspace = 13; if (shifted) { @@ -553,7 +553,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool shifted = get_mods() & MOD_MASK_SHIFT; clear_mods(); - press_n_times(15, KC_BSPACE); + press_n_times(15, KC_BACKSPACE); send_string_with_translation("ommit "); char_to_bspace = 11; layer_off(GIT_C); @@ -616,7 +616,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case G_RBASE: if (!record->event.pressed) { - press_n_times(18, KC_BSPACE); + press_n_times(18, KC_BACKSPACE); send_string_with_translation("base -i "); char_to_bspace = 14; layer_off(GIT_R); @@ -624,7 +624,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case G_RVERT: if (!record->event.pressed) { - press_n_times(18, KC_BSPACE); + press_n_times(18, KC_BACKSPACE); send_string_with_translation("vert "); char_to_bspace = 11; layer_off(GIT_R); @@ -635,7 +635,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool shifted = get_mods() & MOD_MASK_SHIFT; clear_mods(); - press_n_times(18, KC_BSPACE); + press_n_times(18, KC_BACKSPACE); send_string_with_translation("set "); char_to_bspace = 10; @@ -654,7 +654,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case G_SHOW: if (!record->event.pressed) { - press_n_times(16, KC_BSPACE); + press_n_times(16, KC_BACKSPACE); send_string_with_translation("how "); char_to_bspace = 9; layer_off(GIT_S); @@ -665,7 +665,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool shifted = get_mods() & MOD_MASK_SHIFT; clear_mods(); - press_n_times(16, KC_BSPACE); + press_n_times(16, KC_BACKSPACE); send_string_with_translation("tash "); char_to_bspace = 10; @@ -681,7 +681,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case G_STAT: if (!record->event.pressed) { - press_n_times(16, KC_BSPACE); + press_n_times(16, KC_BACKSPACE); send_string_with_translation("tatus "); char_to_bspace = 11; layer_off(GIT_S); diff --git a/users/art/funcs/string_funcs.c b/users/art/funcs/string_funcs.c index d3a177a1b1..3cf35356e1 100644 --- a/users/art/funcs/string_funcs.c +++ b/users/art/funcs/string_funcs.c @@ -95,7 +95,7 @@ combo_t key_combos[] = { [ED_F10] = COMBO(combo_f10, KC_F10), [ED_F11] = COMBO(combo_f11, KC_F11), [ED_F12] = COMBO(combo_f12, KC_F12), - [ED_PSCREEN] = COMBO(combo_pscreen, KC_PSCREEN), + [ED_PSCREEN] = COMBO(combo_pscreen, KC_PRINT_SCREEN), [ED_CS_ENTER] = COMBO_ACTION(done_sm), #endif @@ -169,7 +169,7 @@ bool handle_del_bspace(void) { layer_off(GIT_R); layer_off(GIT_S); - press_n_times(char_to_bspace, KC_BSPACE); + press_n_times(char_to_bspace, KC_BACKSPACE); char_to_bspace = 1; press_n_times(char_to_del, KC_DEL); char_to_del = 0; diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index a84a7bbc21..6a722e6db1 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -80,7 +80,7 @@ const uint32_t PROGMEM unicode_map[] = { bool process_record_macro(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // AltGr + Caps should change the oled layout variable - case KC_CAPSLOCK: + case KC_CAPS_LOCK: if (record->event.pressed) { if (get_mods() & MOD_BIT(KC_RALT)) { userspace_config.layout = (userspace_config.layout + 1) % 3; diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index bdb7f12bbd..49b91129ba 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -23,7 +23,7 @@ // Allow hooking into the RGB matrix indications using keymap code -// Modulates the brightness of indicator +// Modulates the brightness of indicator RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) { RGB output; output.r = r / 2; @@ -63,12 +63,12 @@ __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_mi return false; } // Set RGB state depending on layer -void 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 thisInd = 3; RGB thisCol; // Load keymap hooks if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { - return; + return false; } // Grab color info switch (get_highest_layer(layer_state)) { @@ -110,6 +110,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { break; } helper_painter(led_min, led_max, thisCol, thisInd); + return false; } // Hook into shutdown code to make all perkey LED's red on hitting reset @@ -120,11 +121,3 @@ void shutdown_rgb(void) { // Delay until this registers while(timer_elapsed(timer_start) < 250) {wait_ms(1);} } - -// Hook into suspend code -void suspend_power_down_rgb(void) { - rgb_matrix_set_suspend_state(true); -} -void suspend_wakeup_init_rgb(void) { - rgb_matrix_set_suspend_state(false); -} diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index 62b6da9f2f..3e96b997fe 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -21,7 +21,7 @@ */ // For custom indicators -void 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); // Hook into shutdown code void shutdown_rgb(void); void suspend_wakeup_init_rgb(void); diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 477378102b..3c467d5e7d 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -121,7 +121,7 @@ // For perkey leds #ifdef RGB_MATRIX_ENABLE // This is not working -//# define RGB_DISABLE_TIMEOUT 1800000 +//# define RGB_MATRIX_TIMEOUT 1800000 # define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode # define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON diff --git a/users/brandonschlack/process_records.h b/users/brandonschlack/process_records.h index 057233fb0e..b377ffaed2 100644 --- a/users/brandonschlack/process_records.h +++ b/users/brandonschlack/process_records.h @@ -119,9 +119,9 @@ void matrix_scan_cmd_tab(void); * Common shortcuts used in macOS * Reference: https://support.apple.com/en-us/HT201236 */ -#define MC_POWR KC_POWER // Power (KC_POWER) -#define MC_SLEP LOPT(LCMD(KC_POWER)) // Sleep (Option-Command-Power) -#define MC_SLPD LCTL(LSFT(KC_POWER)) // Sleep Display (Control-Shift-Power) +#define MC_POWR KC_PWR // Power (KC_PWR) +#define MC_SLEP LOPT(LCMD(KC_PWR)) // Sleep (Option-Command-Power) +#define MC_SLPD LCTL(LSFT(KC_PWR)) // Sleep Display (Control-Shift-Power) #define MC_LOCK LCTL(LCMD(KC_Q)) // Lock Screen (Control-Command-Q) #define MC_MSSN KC_FIND // Mission Control: Configure karabiner for find -> mission_control #define MC_LHPD KC_MENU // Launchpad: Configure karabiner for menu -> launchpad diff --git a/users/brandonschlack/rgb_bs.c b/users/brandonschlack/rgb_bs.c index 1abf785b49..6b88503f41 100644 --- a/users/brandonschlack/rgb_bs.c +++ b/users/brandonschlack/rgb_bs.c @@ -75,7 +75,7 @@ void rgb_theme_step_reverse(void) { rgb_theme_color_t get_rgb_theme_color(uint8_t index) { rgb_theme_t theme = get_rgb_theme(); - size_t rgb_theme_color_max = sizeof theme.colors / sizeof *theme.colors; + size_t rgb_theme_color_max = ARRAY_SIZE(theme.colors); if (index == _ADJUST) { return default_adjust; @@ -98,7 +98,7 @@ void rgb_theme_layer(layer_state_t state) { #ifdef RGB_MATRIX_ENABLE void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type) { - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (!HAS_ANY_FLAGS(g_led_config.flags[i], led_type)) { rgb_matrix_set_color( i, red, green, blue ); } diff --git a/users/byungyoonc/saturated_solid_multisplash.h b/users/byungyoonc/saturated_solid_multisplash.h index f302348524..c6850a7873 100644 --- a/users/byungyoonc/saturated_solid_multisplash.h +++ b/users/byungyoonc/saturated_solid_multisplash.h @@ -43,7 +43,7 @@ static bool saturated_solid_multisplash(effect_params_t* params) { RGB rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } - return led_max < DRIVER_LED_TOTAL; + return led_max < RGB_MATRIX_LED_COUNT; } # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/users/cedrikl/cedrikl.c b/users/cedrikl/cedrikl.c index 0479e22b5d..f9f4f1fbc0 100644 --- a/users/cedrikl/cedrikl.c +++ b/users/cedrikl/cedrikl.c @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // Turn on/off NUM LOCK if current state is different void activate_numlock(bool turn_on) { if (host_keyboard_led_state().num_lock != turn_on) { - tap_code(KC_NUMLOCK); + tap_code(KC_NUM_LOCK); } } diff --git a/users/csc027/defines.h b/users/csc027/defines.h index 85d7d065b7..1086973ba2 100644 --- a/users/csc027/defines.h +++ b/users/csc027/defines.h @@ -189,8 +189,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. * `-----------------------------------' `-----------------------------------' */ -#define ___________________CONVENIENCE_L1__________________ XXXXXXX, XXXXXXX, KC_INS, KC_SLCK, KC_PSCR, XXXXXXX -#define ___________________CONVENIENCE_L2__________________ _______, XXXXXXX, KC_APP, MC_lcad, MC_rdcc, KC_NLCK +#define ___________________CONVENIENCE_L1__________________ XXXXXXX, XXXXXXX, KC_INS, KC_SCRL, KC_PSCR, XXXXXXX +#define ___________________CONVENIENCE_L2__________________ _______, XXXXXXX, KC_APP, MC_lcad, MC_rdcc, KC_NUM #define ___________________CONVENIENCE_L3__________________ _______, XXXXXXX, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT #define ___________________CONVENIENCE_L4__________________ _______, _______, _______, _______, _______, _______ @@ -266,7 +266,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ___________________CSGO_4x12_L4____________________ KC_LCTL, KC_Z, KC_LALT, KC_X, KC_B, KC_SPC #define ___________________CSGO_4x12_R1____________________ KC_6, KC_P7, KC_P8, KC_P9, KC_0, KC_BSPC -#define ___________________CSGO_4x12_R2____________________ KC_Y, KC_P4, KC_P5, KC_P6, XXXXXXX, KC_NLCK +#define ___________________CSGO_4x12_R2____________________ KC_Y, KC_P4, KC_P5, KC_P6, XXXXXXX, KC_NUM #define ___________________CSGO_4x12_R3____________________ KC_H, KC_P1, KC_P2, KC_P3, KC_PENT, KC_ESC #define ___________________CSGO_4x12_R4____________________ KC_SPC, KC_P0, KC_P0, KC_PDOT, TO(_QW), TO(_QW) diff --git a/users/curry/config.h b/users/curry/config.h index 0c96293bd5..d5e1ba7bc5 100644 --- a/users/curry/config.h +++ b/users/curry/config.h @@ -7,7 +7,13 @@ #define USB_POLLING_INTERVAL_MS 1 #if defined(RGBLIGHT_ENABLE) -# undef RGBLIGHT_ANIMATIONS +# undef RGBLIGHT_EFFECT_RAINBOW_MOOD +# undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +# undef RGBLIGHT_EFFECT_CHRISTMAS +# undef RGBLIGHT_EFFECT_STATIC_GRADIENT +# undef RGBLIGHT_EFFECT_RGB_TEST +# undef RGBLIGHT_EFFECT_ALTERNATING +# undef RGBLIGHT_EFFECT_TWINKLE # define RGBLIGHT_SLEEP # define RGBLIGHT_EFFECT_BREATHING # define RGBLIGHT_EFFECT_SNAKE diff --git a/users/curry/oled.c b/users/curry/oled.c index 5a8f0de61d..89112af121 100644 --- a/users/curry/oled.c +++ b/users/curry/oled.c @@ -41,7 +41,7 @@ void add_keylog(uint16_t keycode) { keylog_str[i] = keylog_str[i - 1]; } - if (keycode < (sizeof(code_to_name) / sizeof(char))) { + if (keycode < ARRAY_SIZE(code_to_name)) { keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); } diff --git a/users/curry/rgb_matrix_user.c b/users/curry/rgb_matrix_user.c index 96f1f1d4f3..3c2008aa01 100644 --- a/users/curry/rgb_matrix_user.c +++ b/users/curry/rgb_matrix_user.c @@ -36,7 +36,7 @@ void check_default_layer(uint8_t mode, uint8_t type) { } } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { if (userspace_config.rgb_layer_change && rgb_matrix_config.enable) { switch (get_highest_layer(layer_state)) { case _RAISE: @@ -55,6 +55,7 @@ void rgb_matrix_indicators_user(void) { } check_default_layer(0, LED_FLAG_MODIFIER); } + return false; } bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { @@ -131,7 +132,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode uint16_t time = scale16by8(RGBLED_NUM, speed / 8); hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (HAS_FLAGS(g_led_config.flags[i], led_type)) { rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } @@ -141,7 +142,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode default: // Solid Color { RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (HAS_FLAGS(g_led_config.flags[i], led_type)) { rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/users/cwebster2/my_miryoku.h b/users/cwebster2/my_miryoku.h index 2c8ab6fe2b..8b167cd619 100644 --- a/users/cwebster2/my_miryoku.h +++ b/users/cwebster2/my_miryoku.h @@ -56,7 +56,7 @@ #define _______NUM______L3____ KC_GRV, KC_1, KC_2, KC_3, KC_BSLS #define _______NUM_______T____ KC_DOT, KC_0, KC_MINS -#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYSREQ +#define _______FN_______L1____ KC_F12, KC_F7, KC_F8, KC_F9, KC_SYRQ #define _______FN_______L2____ KC_F11, KC_F4, KC_F5, KC_F6, KC_TRNS #define _______FN_______L3____ KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUSE #define _______FN________T____ KC_MENU, KC_SPC, KC_TAB diff --git a/users/danielo515/danielo515.c b/users/danielo515/danielo515.c index f083650279..e7fb08f2eb 100644 --- a/users/danielo515/danielo515.c +++ b/users/danielo515/danielo515.c @@ -37,7 +37,7 @@ void matrix_scan_user(void) { } } // tripe delete! - SEQ_ONE_KEY(KC_BSPACE) { SEND_STRING(SS_TAP(X_BSPACE) SS_TAP(X_BSPACE) SS_TAP(X_BSPACE)); } + SEQ_ONE_KEY(KC_BACKSPACE) { SEND_STRING(SS_TAP(X_BSPACE) SS_TAP(X_BSPACE) SS_TAP(X_BSPACE)); } SEQ_TWO_KEYS(KC_P, KC_G) { SEND_STRING("ps -ef | grep "); } SEQ_TWO_KEYS(KC_J, KC_A) { SEND_STRING("() => {}" SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT)); } // this is a pain to type diff --git a/users/danielo515/tap_dance.c b/users/danielo515/tap_dance.c index 7ddb55c29d..0b7128ba81 100644 --- a/users/danielo515/tap_dance.c +++ b/users/danielo515/tap_dance.c @@ -75,7 +75,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { [_TD_F12] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_F12), [_TD_H_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_H, KC_ENT), [_TD_CLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLON), - [_TD_SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BSLASH), + [_TD_SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BACKSLASH), // OLD ONES [LEFT_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME), [RGT_HOME] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_RGHT, KC_END), diff --git a/users/davidkristoffersen/util/functions.c b/users/davidkristoffersen/util/functions.c index 781d8f214d..3ab4ace2d6 100644 --- a/users/davidkristoffersen/util/functions.c +++ b/users/davidkristoffersen/util/functions.c @@ -33,14 +33,14 @@ code_set_t EN_SHIFT_CODES [] = { const shift_code_t SHIFT_CODES [] = { #ifdef LAYER_NO {.lang = LAYER_NO, - .size = ARR_LEN(NO_SHIFT_CODES), + .size = ARRAY_SIZE(NO_SHIFT_CODES), .codes = NO_SHIFT_CODES}, #endif {.lang = LAYER_EN, - .size = ARR_LEN(EN_SHIFT_CODES), + .size = ARRAY_SIZE(EN_SHIFT_CODES), .codes = EN_SHIFT_CODES}, }; -const int SHIFT_CODES_SIZE = ARR_LEN(SHIFT_CODES); +const int SHIFT_CODES_SIZE = ARRAY_SIZE(SHIFT_CODES); #endif #ifdef LAYER_NO @@ -72,7 +72,7 @@ const code_set_t EN2NO_CODES [] = { {KC_DLR, NO_DLR}, {KC_GRV, NO_GRV} }; -const int EN2NO_CODES_SIZE = ARR_LEN(EN2NO_CODES); +const int EN2NO_CODES_SIZE = ARRAY_SIZE(EN2NO_CODES); #endif // Check if layer is an active default layer diff --git a/users/davidkristoffersen/util/functions.h b/users/davidkristoffersen/util/functions.h index eee1dadc57..5fef010694 100644 --- a/users/davidkristoffersen/util/functions.h +++ b/users/davidkristoffersen/util/functions.h @@ -15,8 +15,6 @@ // Return false if test equal false #define HANDLE_FALSE(bool) if (!bool) return false; -// Generic array lenght define -#define ARR_LEN(arr) (sizeof(arr) / sizeof(arr)[0]) // Printf-like functionality for send_string #define SEND_VAR(str, ...) \ do { \ diff --git a/users/dennytom/chording_engine/engine.part.1 b/users/dennytom/chording_engine/engine.part.1 index 73df4cdeaa..e4f1b260dc 100644 --- a/users/dennytom/chording_engine/engine.part.1 +++ b/users/dennytom/chording_engine/engine.part.1 @@ -85,16 +85,16 @@ bool handle_US_ANSI_shifted_keys(int16_t keycode, bool in) { regular_keycode = KC_EQUAL; break; case KC_LEFT_CURLY_BRACE: - regular_keycode = KC_LBRACKET; + regular_keycode = KC_LEFT_BRACKET; break; case KC_RIGHT_CURLY_BRACE: - regular_keycode = KC_RBRACKET; + regular_keycode = KC_RIGHT_BRACKET; break; case KC_PIPE: - regular_keycode = KC_BSLASH; + regular_keycode = KC_BACKSLASH; break; case KC_COLON: - regular_keycode = KC_SCOLON; + regular_keycode = KC_SEMICOLON; break; case KC_DOUBLE_QUOTE: regular_keycode = KC_QUOTE; diff --git a/users/dennytom/chording_engine/tests/minunit.h b/users/dennytom/chording_engine/tests/minunit.h index ed71b62533..d3f51bfb4f 100644 --- a/users/dennytom/chording_engine/tests/minunit.h +++ b/users/dennytom/chording_engine/tests/minunit.h @@ -113,13 +113,13 @@ enum keycodes { KC_PLUS, KC_EQUAL, KC_LEFT_CURLY_BRACE, - KC_LBRACKET, + KC_LEFT_BRACKET, KC_RIGHT_CURLY_BRACE, - KC_RBRACKET, + KC_RIGHT_BRACKET, KC_PIPE, - KC_BSLASH, + KC_BACKSLASH, KC_COLON, - KC_SCOLON, + KC_SEMICOLON, KC_DOUBLE_QUOTE, KC_QUOTE, KC_LEFT_ANGLE_BRACKET, diff --git a/users/doogle999/doogle999.c b/users/doogle999/doogle999.c index c9ee125741..5d71599687 100644 --- a/users/doogle999/doogle999.c +++ b/users/doogle999/doogle999.c @@ -391,9 +391,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) if(numpadKeyPressed && !(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) { - add_key(KC_NLCK); + add_key(KC_NUM_LOCK); send_keyboard_report(); - del_key(KC_NLCK); + del_key(KC_NUM_LOCK); } } diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c index 111b5f79d7..40383f124f 100644 --- a/users/drashna/callbacks.c +++ b/users/drashna/callbacks.c @@ -49,7 +49,7 @@ void keyboard_post_init_user(void) { keyboard_post_init_transport_sync(); #endif #ifdef I2C_SCANNER_ENABLE - matrix_scan_i2c(); + keyboard_post_init_i2c(); #endif keyboard_post_init_keymap(); diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 91f3a06b7c..d63f05b590 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -129,3 +129,15 @@ void keyboard_post_init_i2c(void) { scan_timer = timer_read(); } #endif + +#if defined(AUTOCORRECT_ENABLE) && defined(AUDIO_ENABLE) +# ifdef USER_SONG_LIST +float autocorrect_song[][2] = SONG(MARIO_GAMEOVER); +# else +float autocorrect_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +# endif +bool apply_autocorrect(uint8_t backspaces, const char *str) { + PLAY_SONG(autocorrect_song); + return true; +} +#endif diff --git a/users/drashna/keyrecords/autocorrection/autocorrection.c b/users/drashna/keyrecords/autocorrection/autocorrection.c deleted file mode 100644 index 90fdba8f5e..0000000000 --- a/users/drashna/keyrecords/autocorrection/autocorrection.c +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright 2021 Google LLC -// Copyright 2021 @filterpaper -// SPDX-License-Identifier: Apache-2.0 -// Original source: https://getreuer.info/posts/keyboards/autocorrection - -#include "autocorrection.h" -#include <string.h> - -#if __has_include("autocorrection_data.h") -# pragma GCC push_options -# pragma GCC optimize("O0") -# include "autocorrection_data.h" -# ifndef AUTOCORRECTION_MIN_LENGTH -# define AUTOCORRECTION_MIN_LENGTH AUTOCORRECT_MIN_LENGTH -# endif -# ifndef AUTOCORRECTION_MAX_LENGTH -# define AUTOCORRECTION_MAX_LENGTH AUTOCORRECT_MAX_LENGTH -# endif -# define autocorrection_data autocorrect_data -# if AUTOCORRECTION_MIN_LENGTH < 4 -# error Minimum Length is too short and may cause overflows -# endif -# if DICTIONARY_SIZE > SIZE_MAX -# error Dictionary size excees maximum size permitted -# endif - -static uint8_t typo_buffer[AUTOCORRECT_MAX_LENGTH] = {KC_SPC}; -static uint8_t typo_buffer_size = 1; - -/** - * @brief function for querying the enabled state of autocorrect - * - * @return true if enabled - * @return false if disabled - */ -bool autocorrect_is_enabled(void) { - return userspace_config.autocorrection; -} - -/** - * @brief Enables autocorrect and saves state to eeprom - * - */ -void autocorrect_enable(void) { - userspace_config.autocorrection = true; - eeconfig_update_user(userspace_config.raw); -} - -/** - * @brief Disables autocorrect and saves state to eeprom - * - */ -void autocorrect_disable(void) { - userspace_config.autocorrection = false; - typo_buffer_size = 0; - eeconfig_update_user(userspace_config.raw); -} - -/** - * @brief Toggles autocorrect's status and save state to eeprom - * - */ -void autocorrect_toggle(void) { - userspace_config.autocorrection = !userspace_config.autocorrection; - typo_buffer_size = 0; - eeconfig_update_user(userspace_config.raw); -} - -/** - * @brief handler for determining if autocorrect should process keypress - * - * @param keycode Keycode registered by matrix press, per keymap - * @param record keyrecord_t structure - * @param typo_buffer_size passed along to allow resetting of autocorrect buffer - * @param mods allow processing of mod status - * @return true Allow autocorection - * @return false Stop processing and escape from autocorrect. - */ -__attribute__((weak)) bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) { - // See quantum_keycodes.h for reference on these matched ranges. - switch (*keycode) { - // Exclude these keycodes from processing. - case KC_LSFT: - case KC_RSFT: - case KC_CAPS: - case QK_TO ... QK_ONE_SHOT_LAYER_MAX: - case QK_LAYER_TAP_TOGGLE ... QK_LAYER_MOD_MAX: - case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: - return false; - - // Mask for base keycode from shifted keys. - case QK_LSFT ... QK_LSFT + 255: - case QK_RSFT ... QK_RSFT + 255: - if (*keycode >= QK_LSFT && *keycode <= (QK_LSFT + 255)) { - *mods |= MOD_LSFT; - } else { - *mods |= MOD_RSFT; - } - *keycode &= 0xFF; // Get the basic keycode. - return true; -# ifndef NO_ACTION_TAPPING - // Exclude tap-hold keys when they are held down - // and mask for base keycode when they are tapped. - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: -# ifdef NO_ACTION_LAYER - // Exclude Layer Tap, if layers are disabled - // but action tapping is still enabled. - return false; -# endif - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - // Exclude hold keycode - if (!record->tap.count) { - return false; - } - *keycode &= 0xFF; - break; -# else - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: - // Exclude if disabled - return false; -# endif - // Exclude swap hands keys when they are held down - // and mask for base keycode when they are tapped. - case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: -# ifdef SWAP_HANDS_ENABLE - if (*keycode >= 0x56F0 || !record->tap.count) { - return false; - } - *keycode &= 0xFF; - break; -# else - // Exclude if disabled - return false; -# endif - } - - // Disable autocorrect while a mod other than shift is active. - if ((*mods & ~MOD_MASK_SHIFT) != 0) { - *typo_buffer_size = 0; - return false; - } - - return true; -} - -/** - * @brief handling for when autocorrection has been triggered - * - * @param backspaces number of characters to remove - * @param str pointer to PROGMEM string to replace mistyped seletion with - * @return true apply correction - * @return false user handled replacement - */ -__attribute__((weak)) bool apply_autocorrect(uint8_t backspaces, const char *str) { - return true; -} - -/** - * @brief Process handler for autocorrect feature - * - * @param keycode Keycode registered by matrix press, per keymap - * @param record keyrecord_t structure - * @return true Continue processing keycodes, and send to host - * @return false Stop processing keycodes, and don't send to host - */ -bool process_autocorrection(uint16_t keycode, keyrecord_t *record) { - uint8_t mods = get_mods(); -# ifndef NO_ACTION_ONESHOT - mods |= get_oneshot_mods(); -# endif - - if ((keycode >= AUTOCORRECT_ON && keycode <= AUTOCORRECT_TOGGLE) && record->event.pressed) { - if (keycode == AUTOCORRECT_ON) { - autocorrect_enable(); - } else if (keycode == AUTOCORRECT_OFF) { - autocorrect_disable(); - } else if (keycode == AUTOCORRECT_TOGGLE) { - autocorrect_toggle(); - } else { - return true; - } - - return false; - } - - if (!autocorrect_is_enabled()) { - typo_buffer_size = 0; - return true; - } - - if (!record->event.pressed) { - return true; - } - - // autocorrect keycode verification and extraction - if (!process_autocorrect_user(&keycode, record, &typo_buffer_size, &mods)) { - return true; - } - - // keycode buffer check - switch (keycode) { - case KC_A ... KC_Z: - // process normally - break; - case KC_1 ... KC_0: - case KC_TAB ... KC_SEMICOLON: - case KC_GRAVE ... KC_SLASH: - // Set a word boundary if space, period, digit, etc. is pressed. - keycode = KC_SPC; - break; - case KC_ENTER: - // Behave more conservatively for the enter key. Reset, so that enter - // can't be used on a word ending. - typo_buffer_size = 0; - keycode = KC_SPC; - break; - case KC_BSPC: - // Remove last character from the buffer. - if (typo_buffer_size > 0) { - --typo_buffer_size; - } - return true; - case KC_QUOTE: - // Treat " (shifted ') as a word boundary. - if ((mods & MOD_MASK_SHIFT) != 0) { - keycode = KC_SPC; - } - break; - default: - // Clear state if some other non-alpha key is pressed. - typo_buffer_size = 0; - return true; - } - - // Rotate oldest character if buffer is full. - if (typo_buffer_size >= AUTOCORRECT_MAX_LENGTH) { - memmove(typo_buffer, typo_buffer + 1, AUTOCORRECT_MAX_LENGTH - 1); - typo_buffer_size = AUTOCORRECT_MAX_LENGTH - 1; - } - - // Append `keycode` to buffer. - typo_buffer[typo_buffer_size++] = keycode; - // Return if buffer is smaller than the shortest word. - if (typo_buffer_size < AUTOCORRECT_MIN_LENGTH) { - return true; - } - - // Check for typo in buffer using a trie stored in `autocorrect_data`. - uint16_t state = 0; - uint8_t code = pgm_read_byte(autocorrect_data + state); - for (int8_t i = typo_buffer_size - 1; i >= 0; --i) { - uint8_t const key_i = typo_buffer[i]; - - if (code & 64) { // Check for match in node with multiple children. - code &= 63; - for (; code != key_i; code = pgm_read_byte(autocorrect_data + (state += 3))) { - if (!code) return true; - } - // Follow link to child node. - state = (pgm_read_byte(autocorrect_data + state + 1) | pgm_read_byte(autocorrect_data + state + 2) << 8); - // Check for match in node with single child. - } else if (code != key_i) { - return true; - } else if (!(code = pgm_read_byte(autocorrect_data + (++state)))) { - ++state; - } - - // Stop if `state` becomes an invalid index. This should not normally - // happen, it is a safeguard in case of a bug, data corruption, etc. - if (state >= DICTIONARY_SIZE) { - return true; - } - - code = pgm_read_byte(autocorrect_data + state); - - if (code & 128) { // A typo was found! Apply autocorrect. - const uint8_t backspaces = (code & 63) + !record->event.pressed; - if (apply_autocorrect(backspaces, (char const *)(autocorrect_data + state + 1))) { - for (uint8_t i = 0; i < backspaces; ++i) { - tap_code(KC_BSPC); - } - send_string_P((char const *)(autocorrect_data + state + 1)); - } - - if (keycode == KC_SPC) { - typo_buffer[0] = KC_SPC; - typo_buffer_size = 1; - return true; - } else { - typo_buffer_size = 0; - return false; - } - } - } - return true; -} -# pragma GCC pop_options -#else -# pragma message "Warning!!! Autocorrect is not corretly setup!" -bool process_autocorrection(uint16_t keycode, keyrecord_t* record) { - return true; -} -#endif diff --git a/users/drashna/keyrecords/autocorrection/autocorrection.h b/users/drashna/keyrecords/autocorrection/autocorrection.h deleted file mode 100644 index 8946b91f1f..0000000000 --- a/users/drashna/keyrecords/autocorrection/autocorrection.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2021 Google LLC -// Copyright 2021 @filterpaper -// SPDX-License-Identifier: Apache-2.0 -// Original source: https://getreuer.info/posts/keyboards/autocorrection - -#pragma once - -#include "drashna.h" - -bool process_autocorrection(uint16_t keycode, keyrecord_t *record); -bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods); -bool apply_autocorrect(uint8_t backspaces, const char *str); - -bool autocorrect_is_enabled(void); -void autocorrect_enable(void); -void autocorrect_disable(void); -void autocorrect_toggle(void); diff --git a/users/drashna/keyrecords/autocorrection/autocorrection_data.h b/users/drashna/keyrecords/autocorrection/autocorrection_data.h deleted file mode 100644 index 90484d3b12..0000000000 --- a/users/drashna/keyrecords/autocorrection/autocorrection_data.h +++ /dev/null @@ -1 +0,0 @@ -#include "autocorrect_data.h" diff --git a/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py b/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py deleted file mode 100755 index 0dd9b78b9c..0000000000 --- a/users/drashna/keyrecords/autocorrection/make_autocorrection_data.py +++ /dev/null @@ -1,298 +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. - -"""Python program to make autocorrection_data.h. - -This program reads "autocorrection_dict.txt" and generates a C source file -"autocorrection_data.h" with a serialized trie embedded as an array. Run this -program without arguments like - -$ python3 make_autocorrection_data.py - -Or to read from a different typo dict file, pass it as the first argument like - -$ python3 make_autocorrection_data.py dict.txt - -Each line of the dict file defines one typo and its correction with the syntax -"typo -> correction". Blank lines or lines starting with '#' are ignored. -Example: - - :thier -> their - dosen't -> doesn't - fitler -> filter - lenght -> length - ouput -> output - widht -> width - -See autocorrection_dict_extra.txt for a larger example. - -For full documentation, see -https://getreuer.info/posts/keyboards/autocorrection -""" - -import sys -import textwrap -from typing import Any, Dict, Iterator, List, Tuple - -try: - from english_words import english_words_lower_alpha_set as CORRECT_WORDS -except ImportError: - print('Autocorrection will falsely trigger when a typo is a substring of a ' - 'correctly spelled word. To check for this, install the english_words ' - 'package and rerun this script:\n\n pip install english_words\n') - # Use a minimal word list as a fallback. - CORRECT_WORDS = ('apparent', 'association', 'available', 'classification', - 'effect', 'entertainment', 'fantastic', 'information', - 'integrate', 'international', 'language', 'loosest', - 'manual', 'nothing', 'provides', 'reference', 'statehood', - 'technology', 'virtually', 'wealthier', 'wonderful') - -KC_A = 4 -KC_SPC = 0x2c -KC_QUOT = 0x34 - -TYPO_CHARS = dict( - [ - ("'", KC_QUOT), - (':', KC_SPC), # "Word break" character. - ] + - # Characters a-z. - [(chr(c), c + KC_A - ord('a')) for c in range(ord('a'), ord('z') + 1)] -) - - -def parse_file(file_name: str) -> List[Tuple[str, str]]: - """Parses autocorrections dictionary file. - - Each line of the file defines one typo and its correction with the syntax - "typo -> correction". Blank lines or lines starting with '#' are ignored. The - function validates that typos only have characters in TYPO_CHARS, that - typos are not substrings of other typos, and checking that typos don't trigger - on CORRECT_WORDS. - - Args: - file_name: String, path of the autocorrections dictionary. - Returns: - List of (typo, correction) tuples. - """ - correct_words = ('information', 'available', 'international', 'language', 'loosest', 'reference', 'wealthier', 'entertainment', 'association', 'provides', 'technology', 'statehood') - autocorrections = [] - typos = set() - for line_number, typo, correction in parse_file_lines(file_name): - if typo in typos: - print(f'Warning:{line_number}: Ignoring duplicate typo: "{typo}"') - continue - - # Check that `typo` is valid. - if not(all([c in TYPO_CHARS for c in typo])): - print(f'Error:{line_number}: Typo "{typo}" has ' - 'characters other than ' + ''.join(TYPO_CHARS.keys())) - sys.exit(1) - for other_typo in typos: - if typo in other_typo or other_typo in typo: - print(f'Error:{line_number}: Typos may not be substrings of one ' - f'another, otherwise the longer typo would never trigger: ' - f'"{typo}" vs. "{other_typo}".') - sys.exit(1) - if len(typo) < 5: - print(f'Warning:{line_number}: It is suggested that typos are at ' - f'least 5 characters long to avoid false triggers: "{typo}"') - - check_typo_against_dictionary(typo, line_number, correct_words) - - autocorrections.append((typo, correction)) - typos.add(typo) - - return autocorrections - - -def make_trie(autocorrections: List[Tuple[str, str]]) -> Dict[str, Any]: - """Makes a trie from the the typos, writing in reverse. - - Args: - autocorrections: List of (typo, correction) tuples. - Returns: - Dict of dict, representing the trie. - """ - trie = {} - for typo, correction in autocorrections: - node = trie - for letter in typo[::-1]: - node = node.setdefault(letter, {}) - node['LEAF'] = (typo, correction) - - return trie - - -def parse_file_lines(file_name: str) -> Iterator[Tuple[int, str, str]]: - """Parses lines read from `file_name` into typo-correction pairs.""" - - line_number = 0 - for line in open(file_name, 'rt'): - line_number += 1 - line = line.strip() - if line and line[0] != '#': - # Parse syntax "typo -> correction", using strip to ignore indenting. - tokens = [token.strip() for token in line.split('->', 1)] - if len(tokens) != 2 or not tokens[0]: - print(f'Error:{line_number}: Invalid syntax: "{line}"') - sys.exit(1) - - typo, correction = tokens - typo = typo.lower() # Force typos to lowercase. - typo = typo.replace(' ', ':') - - yield line_number, typo, correction - - -def check_typo_against_dictionary(typo: str, line_number: int, correct_words) -> None: - """Checks `typo` against English dictionary words.""" - - if typo.startswith(':') and typo.endswith(':'): - if typo[1:-1] in correct_words: - print(f'Warning:{line_number}: Typo "{typo}" is a correctly spelled dictionary word.') - elif typo.startswith(':') and not typo.endswith(':'): - for word in correct_words: - if word.startswith(typo[1:]): - print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger on correctly spelled word "{word}".') - elif not typo.startswith(':') and typo.endswith(':'): - for word in correct_words: - if word.endswith(typo[:-1]): - print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger on correctly spelled word "{word}".') - elif not typo.startswith(':') and not typo.endswith(':'): - for word in correct_words: - if typo in word: - print(f'Warning:{line_number}: Typo "{typo}" would falsely trigger on correctly spelled word "{word}".') - - -def serialize_trie(autocorrections: List[Tuple[str, str]], - trie: Dict[str, Any]) -> List[int]: - """Serializes trie and correction data in a form readable by the C code. - - Args: - autocorrections: List of (typo, correction) tuples. - trie: Dict of dicts. - Returns: - List of ints in the range 0-255. - """ - table = [] - - # Traverse trie in depth first order. - def traverse(trie_node: Dict[str, Any]) -> Dict[str, Any]: - if 'LEAF' in trie_node: # Handle a leaf trie node. - typo, correction = trie_node['LEAF'] - word_boundary_ending = typo[-1] == ':' - typo = typo.strip(':') - i = 0 # Make the autocorrection data for this entry and serialize it. - while i < min(len(typo), len(correction)) and typo[i] == correction[i]: - i += 1 - backspaces = len(typo) - i - 1 + word_boundary_ending - assert 0 <= backspaces <= 63 - correction = correction[i:] - data = [backspaces + 128] + list(bytes(correction, 'ascii')) + [0] - - entry = {'data': data, 'links': [], 'byte_offset': 0} - table.append(entry) - elif len(trie_node) == 1: # Handle trie node with a single child. - c, trie_node = next(iter(trie_node.items())) - entry = {'chars': c, 'byte_offset': 0} - - # It's common for a trie to have long chains of single-child nodes. We - # find the whole chain so that we can serialize it more efficiently. - while len(trie_node) == 1 and 'LEAF' not in trie_node: - c, trie_node = next(iter(trie_node.items())) - entry['chars'] += c - - table.append(entry) - entry['links'] = [traverse(trie_node)] - else: # Handle trie node with multiple children. - entry = {'chars': ''.join(sorted(trie_node.keys())), 'byte_offset': 0} - table.append(entry) - entry['links'] = [traverse(trie_node[c]) for c in entry['chars']] - return entry - - traverse(trie) - - def serialize(e: Dict[str, Any]) -> List[int]: - if not e['links']: # Handle a leaf table entry. - return e['data'] - elif len(e['links']) == 1: # Handle a chain table entry. - return [TYPO_CHARS[c] for c in e['chars']] + [0] - else: # Handle a branch table entry. - data = [] - for c, link in zip(e['chars'], e['links']): - data += [TYPO_CHARS[c] | (0 if data else 64)] + encode_link(link) - return data + [0] - - byte_offset = 0 - for e in table: # To encode links, first compute byte offset of each entry. - e['byte_offset'] = byte_offset - byte_offset += len(serialize(e)) - - return [b for e in table for b in serialize(e)] # Serialize final table. - - -def encode_link(link: Dict[str, Any]) -> List[int]: - """Encodes a node link as two bytes.""" - byte_offset = link['byte_offset'] - if not (0 <= byte_offset <= 0xffff): - print('Error: The autocorrection table is too large, a node link exceeds ' - '64KB limit. Try reducing the autocorrection dict to fewer entries.') - sys.exit(1) - return [byte_offset & 255, byte_offset >> 8] - - -def write_generated_code(autocorrections: List[Tuple[str, str]], - data: List[int], - file_name: str) -> None: - """Writes autocorrection data as generated C code to `file_name`. - - Args: - autocorrections: List of (typo, correction) tuples. - data: List of ints in 0-255, the serialized trie. - file_name: String, path of the output C file. - """ - assert all(0 <= b <= 255 for b in data) - - def typo_len(e: Tuple[str, str]) -> int: - return len(e[0]) - - min_typo = min(autocorrections, key=typo_len)[0] - max_typo = max(autocorrections, key=typo_len)[0] - generated_code = ''.join([ - '// Generated code.\n\n', - f'// Autocorrection dictionary ({len(autocorrections)} entries):\n', - ''.join(sorted(f'// {typo:<{len(max_typo)}} -> {correction}\n' - for typo, correction in autocorrections)), - f'\n#define AUTOCORRECTION_MIN_LENGTH {len(min_typo)} // "{min_typo}"\n', - f'#define AUTOCORRECTION_MAX_LENGTH {len(max_typo)} // "{max_typo}"\n\n', - textwrap.fill('static const uint8_t autocorrection_data[%d] PROGMEM = {%s};' % ( - len(data), ', '.join(map(str, data))), width=80, subsequent_indent=' '), - '\n\n']) - - with open(file_name, 'wt') as f: - f.write(generated_code) - - -def main(argv): - dict_file = argv[1] if len(argv) > 1 else 'autocorrection_dict.txt' - autocorrections = parse_file(dict_file) - trie = make_trie(autocorrections) - data = serialize_trie(autocorrections, trie) - print(f'Processed %d autocorrection entries to table with %d bytes.' - % (len(autocorrections), len(data))) - write_generated_code(autocorrections, data, 'autocorrection_data.h') - -if __name__ == '__main__': - main(sys.argv) diff --git a/users/drashna/keyrecords/autocorrection/readme.md b/users/drashna/keyrecords/autocorrection/readme.md deleted file mode 100644 index d920508793..0000000000 --- a/users/drashna/keyrecords/autocorrection/readme.md +++ /dev/null @@ -1,301 +0,0 @@ -# Autocorrection - -This is taken from [Pascal Getreuer's implemenation](https://getreuer.info/posts/keyboards/autocorrection/index.html), with a number of modifications. - -To enabled Autocorrection, add `AUTOCORRECTION_ENABLE = yes` to your `rules.mk` file. - -This is mostly a reproduction of Pascal's docs: - -## Overview -Some words are more prone to typos than others. I have a habit of typo-ing *ouput* and *fitler*. This post describes a rudimentary autocorrection implementation that runs on your keyboard with QMK. - -The animation below shows the effect as I type *aparent*. As I press the final t, the autocorrection feature detects the typo and automatically sends keys to correct it: - -Example: Autocorrecting *aparent* → apparent. - -**Features**: -* It runs on your keyboard, so it is always active no matter what software. -* Low resource cost: for an autocorrection dictionary of 70 entries, firmware size cost is 1620 bytes and average CPU cost per key press is about 20 µs. -* It is case insensitive. It corrects Fitler to Filter and FITLER to FILTER. -* It works within words. It corrects fitlered, fitlering, and useful for programming, within longer identifiers like DesignButterworthFitle*r. - -**Limitations**: Running autocorrection on the keyboard comes with some constraints. It is rudimentary like I said: -* It is limited to alphabet characters a–z. No accented or Unicode letters; I’m sorry this probably isn’t useful for languages besides English. -* It does not follow mouse or hotkey driven cursor movement. - -## Taking autocorrection for a test drive -With the above flashed to your keyboard, try for instance typing the misspelled word ouput. The instant you type the final t, the word should be speedily autocorrected to output. As further tests, try becuase and invliad. - -Here is the full list of typos corrected using the provided autocorrection_data.h file. : is a special character denoting a word break. See below for how to change the autocorrection dictionary. - -``` -: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 -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 -``` - -## Firmware size and CPU costs -I am anxiously aware that a keyboard microcontroller has limited resources. So I was sure to measure how much memory and CPU time autocorrection consumes during development. These measurements are for the example autocorrection dictionary as used above, which has 70 entries: -* **Firmware size**: Autocorrection increases my firmware size by a total of 1620 bytes. Breaking that down, 1104 bytes are for the autocorrection_data array and 516 bytes for the autocorrection code. -* **CPU time**: On my Elite-C microcontrollers, the average CPU time for process_autocorrection to process an alpha key press is around 20 µs. Consider this a rough order-of-magnitude cost. Processing cost increases (more trie nodes are visited) when recent input is close to a known typo, with the max being when a long typo is matched. - -The costs are not free but reasonable. For reference, the firmware size cost for mouse keys is 2124 bytes and the CPU time to process a layer switch is about 70 µs, so autocorrection is cheaper than those things. Of course, the cost scales with the size of the autocorrection dictionary, so keep that in mind if you add a lot more entries. - -## How does it work? -The function process_autocorrection maintains a small buffer of recent key presses. On each key press, it checks whether the buffer ends in a recognized typo, and if so, automatically sends keystrokes to correct it. - -The tricky part is how to efficiently check the buffer for typos. We don’t want to spend too much memory or time on storing or searching the typos. A good solution is to represent the typos with a trie data structure. A trie is a tree data structure where each node is a letter, and words are formed by following a path to one of the leaves. - - -An example trie. -Since we search whether the buffer ends in a typo, we store the trie writing in reverse. The trie is queried starting from the last letter, then second to last letter, and so on, until either a letter doesn’t match or we reach a leaf, meaning a typo was found. - -## Changing the autocorrection dictionary -The file autocorrection_data.h encodes the typos to correct. While you could simply use the version of this file provided above for a practical configuration, you can make your own to personalize the autocorrection to your most troublesome typos: - -1. First, create an autocorrection dictionary autocorrection_dict.txt, like - - ``` -:thier -> their -fitler -> filter -lenght -> length -ouput -> output -widht -> width -``` - For a practical 70-entry example, see autocorrection_dict.txt. And for a yet larger 400-entry example, see autocorrection_dict_extra.txt. - - The syntax is `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. The correction may have any characters. - -2. Use the make_autocorrection_data.py Python script to process the dictionary - -``` -$ python3 make_autocorrection_data.py -Processed 70 autocorrection entries to table with 1104 bytes. -``` -The script arranges the entries in autocorrection_dict.txt into a trie and generates autocorrection_data.h with the serialized trie embedded as an array. - -3. Finally, recompile and flash your keymap. - -The generated C header looks like this: - -autocorrection_data.h -```c -// Generated code. - -#define AUTOCORRECTION_MIN_LENGTH 5 // "cheif" -#define AUTOCORRECTION_MAX_LENGTH 10 // "accomodate" - -static const uint8_t autocorrection_data[1104] PROGMEM = {108, 43, 0, 6, - 71, 0, 7, 81, 0, 8, 199, 0, 9, 240, 1, 10, 250, 1, 11, 26, 2, 17, 53, 2, - 18, 190, 2, 19, 202, 2, 21, 212, 2, 22, 20, 3, 23, 67, 3, 28, 16, 4, 0, - 72, 50, 0, 22, 60, 0, 0, 11, 23, 44, 8, 11, 23, 44, 0, 132, 0, 8, 22, 18, - 18, 15, 0, 132, 115, 101, 115, 0, 11, 23, 12, 26, 22, 0, 129, 99, 104, 0, - 68, 94, 0, 8, 106, 0, 15, 174, 0, 21, 187, 0, 0, 12, 15, 25, 17, 12, 0, - 131, 97, 108, 105, 100, 0, 74, 119, 0, 12, 129, 0, 21, 140, 0, 24, 165, - 0, 0, 17, 12, 22, 0, 131, 103, 110, 101, 100, 0, 25, 21, 8, 7, 0, 131, - 105, 118, 101, 100, 0, 72, 147, 0, 24, 156, 0, 0, 9, 8, 21, 0, 129, 114, - 101, 100, 0, 6, 6, 18, 0, 129, 114, 101, 100, 0, 15, 6, 17, 12, 0, 129, - 100, 101, 0, 18, 22, 8, 21, 11, 23, 0, 130, 104, 111, 108, 100, 0, 4, 26, - 18, 9, 0, 131, 114, 119, 97, 114, 100, 0, 68, 233, 0, 6, 246, 0, 7, 4, 1, - 8, 16, 1, 10, 52, 1, 15, 81, 1, 21, 90, 1, 22, 117, 1, 23, 144, 1, 24, - 215, 1, 25, 228, 1, 0, 6, 19, 22, 8, 16, 4, 17, 0, 130, 97, 99, 101, 0, - 19, 4, 22, 8, 16, 4, 17, 0, 131, 112, 97, 99, 101, 0, 12, 21, 8, 25, 18, - 0, 130, 114, 105, 100, 101, 0, 23, 0, 68, 25, 1, 17, 36, 1, 0, 21, 4, 24, - 10, 0, 130, 110, 116, 101, 101, 0, 4, 21, 24, 4, 10, 0, 135, 117, 97, - 114, 97, 110, 116, 101, 101, 0, 68, 59, 1, 7, 69, 1, 0, 24, 10, 44, 0, - 131, 97, 117, 103, 101, 0, 8, 15, 12, 25, 12, 21, 19, 0, 130, 103, 101, - 0, 22, 4, 9, 0, 130, 108, 115, 101, 0, 76, 97, 1, 24, 109, 1, 0, 24, 20, - 4, 0, 132, 99, 113, 117, 105, 114, 101, 0, 23, 44, 0, 130, 114, 117, 101, - 0, 4, 0, 79, 126, 1, 24, 134, 1, 0, 9, 0, 131, 97, 108, 115, 101, 0, 6, - 8, 5, 0, 131, 97, 117, 115, 101, 0, 4, 0, 71, 156, 1, 19, 193, 1, 21, - 203, 1, 0, 18, 16, 0, 80, 166, 1, 18, 181, 1, 0, 18, 6, 4, 0, 135, 99, - 111, 109, 109, 111, 100, 97, 116, 101, 0, 6, 6, 4, 0, 132, 109, 111, 100, - 97, 116, 101, 0, 7, 24, 0, 132, 112, 100, 97, 116, 101, 0, 8, 19, 8, 22, - 0, 132, 97, 114, 97, 116, 101, 0, 10, 8, 15, 15, 18, 6, 0, 130, 97, 103, - 117, 101, 0, 8, 12, 6, 8, 21, 0, 131, 101, 105, 118, 101, 0, 12, 8, 11, - 6, 0, 130, 105, 101, 102, 0, 17, 0, 76, 3, 2, 21, 16, 2, 0, 15, 8, 12, 6, - 0, 133, 101, 105, 108, 105, 110, 103, 0, 12, 23, 22, 0, 131, 114, 105, - 110, 103, 0, 70, 33, 2, 23, 44, 2, 0, 12, 23, 26, 22, 0, 131, 105, 116, - 99, 104, 0, 10, 12, 8, 11, 0, 129, 104, 116, 0, 72, 69, 2, 10, 80, 2, 18, - 89, 2, 21, 156, 2, 24, 167, 2, 0, 22, 18, 18, 11, 6, 0, 131, 115, 101, - 110, 0, 12, 21, 23, 22, 0, 129, 110, 103, 0, 12, 0, 86, 98, 2, 23, 124, - 2, 0, 68, 105, 2, 22, 114, 2, 0, 12, 15, 0, 131, 105, 115, 111, 110, 0, - 4, 6, 6, 18, 0, 131, 105, 111, 110, 0, 76, 131, 2, 22, 146, 2, 0, 23, 12, - 19, 8, 21, 0, 134, 101, 116, 105, 116, 105, 111, 110, 0, 18, 19, 0, 131, - 105, 116, 105, 111, 110, 0, 23, 24, 8, 21, 0, 131, 116, 117, 114, 110, 0, - 85, 174, 2, 23, 183, 2, 0, 23, 8, 21, 0, 130, 117, 114, 110, 0, 8, 21, 0, - 128, 114, 110, 0, 7, 8, 24, 22, 19, 0, 131, 101, 117, 100, 111, 0, 24, - 18, 18, 15, 0, 129, 107, 117, 112, 0, 72, 219, 2, 18, 3, 3, 0, 76, 229, - 2, 15, 238, 2, 17, 248, 2, 0, 11, 23, 44, 0, 130, 101, 105, 114, 0, 23, - 12, 9, 0, 131, 108, 116, 101, 114, 0, 23, 22, 12, 15, 0, 130, 101, 110, - 101, 114, 0, 23, 4, 21, 8, 23, 17, 12, 0, 135, 116, 101, 114, 97, 116, - 111, 114, 0, 72, 30, 3, 17, 38, 3, 24, 51, 3, 0, 15, 4, 9, 0, 129, 115, - 101, 0, 4, 12, 23, 17, 18, 6, 0, 131, 97, 105, 110, 115, 0, 22, 17, 8, 6, - 17, 18, 6, 0, 133, 115, 101, 110, 115, 117, 115, 0, 74, 86, 3, 11, 96, 3, - 15, 118, 3, 17, 129, 3, 22, 218, 3, 24, 232, 3, 0, 11, 24, 4, 6, 0, 130, - 103, 104, 116, 0, 71, 103, 3, 10, 110, 3, 0, 12, 26, 0, 129, 116, 104, 0, - 17, 8, 15, 0, 129, 116, 104, 0, 22, 24, 8, 21, 0, 131, 115, 117, 108, - 116, 0, 68, 139, 3, 8, 150, 3, 22, 210, 3, 0, 21, 4, 19, 19, 4, 0, 130, - 101, 110, 116, 0, 85, 157, 3, 25, 200, 3, 0, 68, 164, 3, 21, 175, 3, 0, - 19, 4, 0, 132, 112, 97, 114, 101, 110, 116, 0, 4, 19, 0, 68, 185, 3, 19, - 193, 3, 0, 133, 112, 97, 114, 101, 110, 116, 0, 4, 0, 131, 101, 110, 116, - 0, 8, 15, 8, 21, 0, 130, 97, 110, 116, 0, 18, 6, 0, 130, 110, 115, 116, - 0, 12, 9, 8, 17, 4, 16, 0, 132, 105, 102, 101, 115, 116, 0, 83, 239, 3, - 23, 6, 4, 0, 87, 246, 3, 24, 254, 3, 0, 17, 12, 0, 131, 112, 117, 116, 0, - 18, 0, 130, 116, 112, 117, 116, 0, 19, 24, 18, 0, 131, 116, 112, 117, - 116, 0, 70, 29, 4, 8, 41, 4, 11, 51, 4, 21, 69, 4, 0, 8, 24, 20, 8, 21, - 9, 0, 129, 110, 99, 121, 0, 23, 9, 4, 22, 0, 130, 101, 116, 121, 0, 6, - 21, 4, 21, 12, 8, 11, 0, 135, 105, 101, 114, 97, 114, 99, 104, 121, 0, 4, - 5, 12, 15, 0, 130, 114, 97, 114, 121, 0}; -``` - -## Troubleshooting -### Avoiding false triggers -By default, typos are searched within words, to find typos within longer identifiers like maxFitlerOuput. While this is useful, a consequence is that autocorrection will falsely trigger when a typo happens to be a substring of a correctly-spelled word. For instance, if we had thier -> their as an entry, it would falsely trigger on (correct, though relatively uncommon) words like “wealthier” and “filthier.” - -The solution is to set a word break : before and/or after the typo to constrain matching. : matches space, period, comma, underscore, digits, and most other non-alpha characters. - -| Text | thier | :thier | thier: | :thier: | -|------|-------|--------|--------|---------| -|see thier typo|matches|matches|matches|matches| -it’s thiers |matches|matches|no|no| -wealthier words|matches|no|matches|no| - -:thier: is most restrictive, matching only when thier is a whole word. - -The make_autocorrection_data.py script makes an effort to check for entries that would false trigger as substrings of correct words. It searches each typo against a dictionary of 25K English words from the english_words Python package, provided it’s installed. - -### Overriding autocorrection -Occasionally you might actually want to type a typo (for instance, while editing autocorrection_dict.txt) without being autocorrected. Here is a way to do that: - -1. Begin typing the typo. -2. Before typing the last letter, press and release the Ctrl or Alt key. -3. Type the remaining letters. - -This works because the autocorrection implementation doesn’t understand hotkeys, so it resets itself whenever a modifier other than shift is held. - -Alternatively, the `AUTO_CTN` keycode will toggle autocorrection on and off. - -## Closing thoughts -Based on my own use, an autocorrection dictionary of a few dozen entries is enough to help in day-to-day writing. On the other hand, it is of course far from comprehensively checking that every word is spelled correctly. Keyboard microcontrollers might not have the resources check against a full English dictionary any time soon, but a lot of editors and other software have good integrated spell check features. - -I suggest to enable and use spell check in combination with autocorrection: -* Sublime: Open the View menu and enable “Spell Check.” -* Eclipse: Open the Window menu, click Preferences, and search for “Spelling.” -* Vim: Type :set spell, and misspellings will be highlighted. Use ]s to jump to the next misspelled word and z= to get suggested corrections for the word under the cursor. See the :help spell documentation. Vim also has an abbreviations feature that can autocorrect misspellings (see :help abbreviations). -* Emacs: Use M-x flyspell-mode to enable Flyspell mode in the current buffer. Or for programming, use M-x flyspell-prog-mode to check comments and strings only. See the spelling documentation. There is also an abbreviations feature that can do autocorrection. - -Some useful resources: - -* Wikipedia has a [large list of common typos](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines). -* EmacsWiki has another [list of typos](https://www.emacswiki.org/emacs/autocorrection_abbrev_defs). -* You can find data on English word frequencies at https://www.wordfrequency.info/samples.asp. - -# Appendix: Trie binary data format -This section details how the trie is serialized to byte data in autocorrection_data. You don’t need to care about this to use this autocorrection implementation. But I document it for the record in case anyone is interested in modifying the implementation, or just curious how it works. - -What I did here is fairly arbitrary, but it is simple to decode and gets the job done. - -## Encoding -All autocorrection data is stored in a single flat array autocorrection_data. Each trie node is associated with a byte offset into this array, where data for that node is encoded, beginning with root at offset 0. There are three kinds of nodes. The highest two bits of the first byte of the node indicate what kind: - -* 00 ⇒ chain node: a trie node with a single child. -* 01 ⇒ branching node: a trie node with multiple children. -* 10 ⇒ leaf node: a leaf, corresponding to a typo and storing its correction. - -An example trie. -Branching node. Each branch is encoded with one byte for the keycode (KC_A–KC_Z) followed by a link to the child node. Links between nodes are 16-bit byte offsets relative to the beginning of the array, serialized in little endian order. - -All branches are serialized this way, one after another, and terminated with a zero byte. As described above, the node is identified as a branch by setting the two high bits of the first byte to 01, done by bitwise ORing the first keycode with 64. keycode. The root node for the above figure would be serialized like: - - +-------+-------+-------+-------+-------+-------+-------+ - | R|64 | node 2 | T | node 3 | 0 | - +-------+-------+-------+-------+-------+-------+-------+ - -Chain node. Tries tend to have long chains of single-child nodes, as seen in the example above with f-i-t-l in fitler. So to save space, we use a different format to encode chains than branching nodes. A chain is encoded as a string of keycodes, beginning with the node closest to the root, and terminated with a zero byte. The child of the last node in the chain is encoded immediately after. That child could be either a branching node or a leaf. - -In the figure above, the f-i-t-l chain is encoded as - - +-------+-------+-------+-------+-------+ - | L | T | I | F | 0 | - +-------+-------+-------+-------+-------+ -If we were to encode this chain using the same format used for branching nodes, we would encode a 16-bit node link with every node, costing 8 more bytes in this example. Across the whole trie, this adds up. Conveniently, we can point to intermediate points in the chain and interpret the bytes in the same way as before. E.g. starting at the i instead of the l, and the subchain has the same format. - -Leaf node. A leaf node corresponds to a particular typo and stores data to correct the typo. The leaf begins with a byte for the number of backspaces to type, and is followed by a null-terminated ASCII string of the replacement text. The idea is, after tapping backspace the indicated number of times, we can simply pass this string to QMK’s send_string_P function. For fitler, we need to tap backspace 3 times (not 4, because we catch the typo as the final ‘r’ is pressed) and replace it with lter. To identify the node as a leaf, the two high bits are set to 10 by ORing the backspace count with 128: - - +-------+-------+-------+-------+-------+-------+ - | 3|128 | 'l' | 't' | 'e' | 'r' | 0 | - +-------+-------+-------+-------+-------+-------+ -## Decoding -This format is by design decodable with fairly simple logic. A 16-bit variable state represents our current position in the trie, initialized with 0 to start at the root node. Then, for each keycode, test the highest two bits in the byte at state to identify the kind of node. - -* 00 ⇒ chain node: If the node’s byte matches the keycode, increment state by one to go to the next byte. If the next byte is zero, increment again to go to the following node. -* 01 ⇒ branching node: Search the branches for one that matches the keycode, and follow its node link. -* 10 ⇒ leaf node: a typo has been found! We read its first byte for the number of backspaces to type, then pass its following bytes to send_string_P to type the correction. diff --git a/users/drashna/keyrecords/process_records.c b/users/drashna/keyrecords/process_records.c index 197fd94171..89d1c80b8f 100644 --- a/users/drashna/keyrecords/process_records.c +++ b/users/drashna/keyrecords/process_records.c @@ -3,9 +3,6 @@ #include "drashna.h" #include "version.h" -#ifdef AUTOCORRECTION_ENABLE -# include "autocorrection/autocorrection.h" -#endif uint16_t copy_paste_timer; bool host_driver_disabled = false; @@ -65,9 +62,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #if defined(CUSTOM_POINTING_DEVICE) && process_record_pointing(keycode, record) #endif -#ifdef AUTOCORRECTION_ENABLE - && process_autocorrection(keycode, record) -#endif && true)) { return false; } diff --git a/users/drashna/keyrecords/process_records.h b/users/drashna/keyrecords/process_records.h index be31f992cb..cae3620fe4 100644 --- a/users/drashna/keyrecords/process_records.h +++ b/users/drashna/keyrecords/process_records.h @@ -46,9 +46,6 @@ enum userspace_custom_keycodes { KC_ZALGO, KC_SUPER, KC_ACCEL, - AUTOCORRECT_ON, - AUTOCORRECT_OFF, - AUTOCORRECT_TOGGLE, NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes }; diff --git a/users/drashna/keyrecords/tap_dance.md b/users/drashna/keyrecords/tap_dance.md index 0bf67cbd5a..fef1435918 100644 --- a/users/drashna/keyrecords/tap_dance.md +++ b/users/drashna/keyrecords/tap_dance.md @@ -88,7 +88,7 @@ void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; // if the tapdance is hit more than the number of elemints in the array, reset - if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t) ) ) { + if (state->count >= ARRAY_SIZE(diablo_times) ) { diablo_timer[diablo_keys->index].key_interval = 0; reset_tap_dance(state); } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) diff --git a/users/drashna/keyrecords/tap_dances.c b/users/drashna/keyrecords/tap_dances.c index 6caf6b6b3e..7bdea3cae3 100644 --- a/users/drashna/keyrecords/tap_dances.c +++ b/users/drashna/keyrecords/tap_dances.c @@ -23,7 +23,7 @@ void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; // if the tapdance is hit more than the number of elemints in the array, reset - if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) { + if (state->count >= ARRAY_SIZE(diablo_times)) { diablo_timer[diablo_keys->index].key_interval = 0; reset_tap_dance(state); } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) diff --git a/users/drashna/keyrecords/unicode.c b/users/drashna/keyrecords/unicode.c index b3fc71cb09..bfce38f555 100644 --- a/users/drashna/keyrecords/unicode.c +++ b/users/drashna/keyrecords/unicode.c @@ -43,7 +43,7 @@ typedef uint32_t (*translator_function_t)(bool is_shifted, uint32_t keycode); static inline uint32_t translator_name(bool is_shifted, uint32_t keycode) { \ static const uint32_t translation[] = {__VA_ARGS__}; \ uint32_t ret = keycode; \ - if ((keycode - KC_A) < (sizeof(translation) / sizeof(uint32_t))) { \ + if ((keycode - KC_A) < ARRAY_SIZE(translation)) { \ ret = translation[keycode - KC_A]; \ } \ return ret; \ diff --git a/users/drashna/oled/oled_stuff.c b/users/drashna/oled/oled_stuff.c index e082f8ab3e..7aee350baf 100644 --- a/users/drashna/oled/oled_stuff.c +++ b/users/drashna/oled/oled_stuff.c @@ -23,9 +23,6 @@ #ifdef AUDIO_CLICKY # include "process_clicky.h" #endif -#if defined(AUTOCORRECTION_ENABLE) -# include "keyrecords/autocorrection/autocorrection.h" -#endif #include <string.h> bool is_oled_enabled = true; @@ -87,7 +84,7 @@ void add_keylog(uint16_t keycode, keyrecord_t *record) { memmove(keylog_str, keylog_str + 1, OLED_KEYLOGGER_LENGTH - 1); - if (keycode < (sizeof(code_to_name) / sizeof(char))) { + if (keycode < ARRAY_SIZE(code_to_name)) { keylog_str[(OLED_KEYLOGGER_LENGTH - 1)] = pgm_read_byte(&code_to_name[keycode]); } @@ -458,10 +455,6 @@ void render_bootmagic_status(uint8_t col, uint8_t line) { #endif } -#if defined(CUSTOM_POINTING_DEVICE) -extern bool tap_toggling; -#endif - void render_user_status(uint8_t col, uint8_t line) { #ifdef AUDIO_ENABLE bool is_audio_on = false, l_is_clicky_on = false; @@ -490,9 +483,9 @@ void render_user_status(uint8_t col, uint8_t line) { # if !defined(OLED_DISPLAY_VERBOSE) oled_write_P(PSTR(" "), false); # endif -#elif defined(CUSTOM_POINTING_DEVICE) +#elif defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) static const char PROGMEM mouse_lock[3] = {0xF2, 0xF3, 0}; - oled_write_P(mouse_lock, tap_toggling); + oled_write_P(mouse_lock, get_auto_mouse_toggle()); #endif #ifdef AUDIO_ENABLE static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}}; @@ -771,8 +764,8 @@ void render_unicode_mode(uint8_t col, uint8_t line) { uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { static uint32_t anim_frame_duration = 500; -#ifdef CUSTOM_POINTING_DEVICE - if (tap_toggling) { +#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) + if (get_auto_mouse_toggle()) { animation_frame = (animation_frame + 1) % OLED_RTOGI_FRAMES; animation_type = 3; anim_frame_duration = 300; diff --git a/users/drashna/pointing/pointing.c b/users/drashna/pointing/pointing.c index c9a7945a84..1b64502ed3 100644 --- a/users/drashna/pointing/pointing.c +++ b/users/drashna/pointing/pointing.c @@ -3,10 +3,8 @@ #include "pointing.h" -static uint16_t mouse_timer = 0; -static uint16_t mouse_debounce_timer = 0; -static uint8_t mouse_keycode_tracker = 0; -bool tap_toggling = false, enable_acceleration = false; +static uint16_t mouse_debounce_timer = 0; +bool enable_acceleration = false; #ifdef TAPPING_TERM_PER_KEY # define TAP_CHECK get_tapping_term(KC_BTN1, NULL) @@ -17,6 +15,15 @@ bool tap_toggling = false, enable_acceleration = false; # define TAP_CHECK TAPPING_TERM #endif +__attribute__((weak)) void pointing_device_init_keymap(void) {} + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUSE); + set_auto_mouse_enable(true); + + pointing_device_init_keymap(); +} + __attribute__((weak)) report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report) { return mouse_report; } @@ -26,28 +33,16 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { mouse_report.x = 0; mouse_report.y = 0; - if (x != 0 && y != 0) { - mouse_timer = timer_read(); + if (x != 0 && y != 0 && (timer_elapsed(mouse_debounce_timer) > TAP_CHECK)) { #ifdef OLED_ENABLE oled_timer_reset(); #endif - if (timer_elapsed(mouse_debounce_timer) > TAP_CHECK) { - if (enable_acceleration) { - x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); - y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); - } - mouse_report.x = x; - mouse_report.y = y; - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); - } - } - } else if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { - layer_off(_MOUSE); - } else if (tap_toggling) { - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); + if (enable_acceleration) { + x = (mouse_xy_report_t)(x > 0 ? x * x / 16 + x : -x * x / 16 + x); + y = (mouse_xy_report_t)(y > 0 ? y * y / 16 + y : -y * y / 16 + y); } + mouse_report.x = x; + mouse_report.y = y; } return pointing_device_task_keymap(mouse_report); @@ -55,64 +50,10 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { switch (keycode) { - case TT(_MOUSE): - if (record->event.pressed) { - mouse_keycode_tracker++; - } else { -#if TAPPING_TOGGLE != 0 - if (record->tap.count == TAPPING_TOGGLE) { - tap_toggling ^= 1; -# if TAPPING_TOGGLE == 1 - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; -# else - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; -# endif - } else { - mouse_keycode_tracker--; - } -#endif - } - mouse_timer = timer_read(); - break; - case TG(_MOUSE): - if (record->event.pressed) { - tap_toggling ^= 1; - } - break; - case MO(_MOUSE): -#if defined(KEYBOARD_ploopy) - case DPI_CONFIG: -#elif (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && !defined(NO_CHARYBDIS_KEYCODES) - case SAFE_RANGE ... (CHARYBDIS_SAFE_RANGE-1): -#endif - case KC_MS_UP ... KC_MS_WH_RIGHT: - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; case KC_ACCEL: enable_acceleration = record->event.pressed; - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; -#if 0 - case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: break; -#endif - case QK_MOD_TAP ... QK_MOD_TAP_MAX: - if (record->event.pressed || !record->tap.count) { - break; - } default: - if (IS_NOEVENT(record->event)) break; - if ((keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) && (((keycode >> 0x8) & 0xF) == _MOUSE)) { - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; - } - if (layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { - layer_off(_MOUSE); - } - mouse_keycode_tracker = 0; mouse_debounce_timer = timer_read(); break; } @@ -122,6 +63,32 @@ bool process_record_pointing(uint16_t keycode, keyrecord_t* record) { layer_state_t layer_state_set_pointing(layer_state_t state) { if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO) || layer_state_cmp(state, _DIABLOII)) { state |= ((layer_state_t)1 << _MOUSE); + set_auto_mouse_enable(false); // auto mouse can be disabled any time during run time + } else { + set_auto_mouse_enable(true); } return state; } + + +#if defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) +__attribute__((weak)) bool is_mouse_record_keymap(uint16_t keycode, keyrecord_t *record) { return false; } + +bool is_mouse_record_user(uint16_t keycode, keyrecord_t* record) { + if (is_mouse_record_keymap(keycode, record)) { + return true; + } + switch (keycode) { +# if defined(KEYBOARD_ploopy) + case DPI_CONFIG: +# elif (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && !defined(NO_CHARYBDIS_KEYCODES) + case SAFE_RANGE ...(CHARYBDIS_SAFE_RANGE - 1): +# elif (defined(KEYBOARD_bastardkb_dilemma) && !defined(NO_DILEMMA_KEYCODES)) + case SAFE_RANGE ...(DILEMMA_SAFE_RANGE - 1): +# endif + case KC_ACCEL: + return true; + } + return false; +} +#endif diff --git a/users/drashna/pointing/pointing.h b/users/drashna/pointing/pointing.h index 8b00ffc0ec..28d8610148 100644 --- a/users/drashna/pointing/pointing.h +++ b/users/drashna/pointing/pointing.h @@ -3,8 +3,8 @@ #include "drashna.h" +void pointing_device_init_keymap(void); report_mouse_t pointing_device_task_keymap(report_mouse_t mouse_report); void matrix_scan_pointing(void); bool process_record_pointing(uint16_t keycode, keyrecord_t* record); layer_state_t layer_state_set_pointing(layer_state_t state); -extern bool tap_toggling, enable_acceleration; diff --git a/users/drashna/post_config.h b/users/drashna/post_config.h index ec9aa49462..029ffd65ad 100644 --- a/users/drashna/post_config.h +++ b/users/drashna/post_config.h @@ -5,7 +5,16 @@ // because layouts seem to not be respecting config.h order atm #ifdef RGBLIGHT_ENABLE -# undef RGBLIGHT_ANIMATIONS +# undef RGBLIGHT_EFFECT_BREATHING +# undef RGBLIGHT_EFFECT_RAINBOW_MOOD +# undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +# undef RGBLIGHT_EFFECT_SNAKE +# undef RGBLIGHT_EFFECT_KNIGHT +# undef RGBLIGHT_EFFECT_CHRISTMAS +# undef RGBLIGHT_EFFECT_STATIC_GRADIENT +# undef RGBLIGHT_EFFECT_RGB_TEST +# undef RGBLIGHT_EFFECT_ALTERNATING +# undef RGBLIGHT_EFFECT_TWINKLE # if defined(__AVR__) && (!defined(__AVR_AT90USB1286__) && !defined(RGBLIGHT_ALL_ANIMATIONS)) # define RGBLIGHT_EFFECT_BREATHING # define RGBLIGHT_EFFECT_SNAKE @@ -127,3 +136,7 @@ } \ } #endif + +#if defined(SPLIT_KEYBOARD) && defined(PROTOCOL_CHIBIOS) && !defined(USB_SUSPEND_WAKEUP_DELAY) +# define USB_SUSPEND_WAKEUP_DELAY 200 +#endif diff --git a/users/drashna/rgb/rgb_matrix_config.h b/users/drashna/rgb/rgb_matrix_config.h index 33979a198e..86f238f392 100644 --- a/users/drashna/rgb/rgb_matrix_config.h +++ b/users/drashna/rgb/rgb_matrix_config.h @@ -6,7 +6,6 @@ #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) #define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects // # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended #undef ENABLE_RGB_MATRIX_ALPHAS_MODS diff --git a/users/drashna/rgb/rgb_matrix_stuff.c b/users/drashna/rgb/rgb_matrix_stuff.c index 2c23c29784..2867641a3e 100644 --- a/users/drashna/rgb/rgb_matrix_stuff.c +++ b/users/drashna/rgb/rgb_matrix_stuff.c @@ -20,7 +20,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode uint16_t time = scale16by8(g_rgb_timer, speed / 8); hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (HAS_FLAGS(g_led_config.flags[i], led_type)) { RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); } @@ -30,7 +30,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode default: // Solid Color { RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (HAS_FLAGS(g_led_config.flags[i], led_type)) { RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); } @@ -91,9 +91,9 @@ bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { __attribute__((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { return true; } -void 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) { if (!rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { - return; + return false; } #if defined(RGBLIGHT_ENABLE) @@ -140,11 +140,12 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { break; } } + return false; } __attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { return true; } -void rgb_matrix_indicators_user(void) { - rgb_matrix_indicators_keymap(); +bool rgb_matrix_indicators_user(void) { + return rgb_matrix_indicators_keymap(); } diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 5644aad2c4..76bb5debe1 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -9,9 +9,9 @@ ifneq ($(PLATFORM),CHIBIOS) ifneq ($(strip $(LTO_SUPPORTED)), no) LTO_ENABLE = yes endif + SPACE_CADET_ENABLE = no + GRAVE_ESC_ENABLE = no endif -SPACE_CADET_ENABLE = no -GRAVE_ESC_ENABLE = no # DEBUG_MATRIX_SCAN_RATE_ENABLE = api ifneq ($(strip $(NO_SECRETS)), yes) @@ -115,6 +115,7 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes) SRC += $(USER_PATH)/pointing/pointing.c OPT_DEFS += -DCUSTOM_POINTING_DEVICE + OPT_DEFS += -DPOINTING_DEVICE_AUTO_MOUSE_ENABLE endif endif @@ -127,11 +128,8 @@ ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes) endif -AUTOCORRECTION_ENABLE ?= no ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes) - SRC += $(USER_PATH)/keyrecords/autocorrection/autocorrection.c - $(shell touch $(USER_PATH)/keyrecords/autocorrection/autocorrection.c) - OPT_DEFS += -DAUTOCORRECTION_ENABLE + AUTOCORRECT_ENABLE = yes endif ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) diff --git a/users/drashna/split/transport_sync.c b/users/drashna/split/transport_sync.c index 6b5c384480..11c56849eb 100644 --- a/users/drashna/split/transport_sync.c +++ b/users/drashna/split/transport_sync.c @@ -98,8 +98,8 @@ void user_transport_update(void) { #if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) user_state.is_oled_enabled = is_oled_enabled; #endif -#if defined(CUSTOM_POINTING_DEVICE) - user_state.tap_toggling = tap_toggling; +#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) + user_state.tap_toggling = get_auto_mouse_toggle(); #endif #ifdef UNICODE_COMMON_ENABLE user_state.unicode_mode = unicode_config.input_mode; @@ -122,8 +122,10 @@ void user_transport_update(void) { #if defined(OLED_ENABLE) && !defined(SPLIT_OLED_ENABLE) && defined(CUSTOM_OLED_DRIVER) is_oled_enabled = user_state.is_oled_enabled; #endif -#if defined(CUSTOM_POINTING_DEVICE) - tap_toggling = user_state.tap_toggling; +#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) + if (get_auto_mouse_toggle() != user_state.tap_toggling) { + auto_mouse_toggle(); + } #endif #ifdef SWAP_HANDS_ENABLE swap_hands = user_state.swap_hands; diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h index a878f71ca8..e3a94ca6a7 100644 --- a/users/edvorakjp/edvorakjp.h +++ b/users/edvorakjp/edvorakjp.h @@ -8,7 +8,7 @@ // clang-format off #define __EDVORAKJP_BASE_L1__ KC_QUOTE, KC_COMMA, KC_DOT, KC_Y, KC_Q #define __EDVORAKJP_BASE_L2__ KC_A, LALT_T(KC_O), LGUI_T(KC_E), LCTL_T(KC_I), KC_U -#define __EDVORAKJP_BASE_L3__ KC_SCOLON, KC_X, KC_C, KC_V, KC_Z +#define __EDVORAKJP_BASE_L3__ KC_SCLN, KC_X, KC_C, KC_V, KC_Z #define __EDVORAKJP_BASE_R1__ KC_F, KC_G, KC_R, KC_W, KC_P #define __EDVORAKJP_BASE_R2__ KC_D, RSFT_T(KC_T), RGUI_T(KC_N), RALT_T(KC_S), KC_M @@ -23,15 +23,15 @@ #define __EDVORAKJP_SYMBOL_L__ KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR #define __EDVORAKJP_SYMBOL_R__ KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK -#define __EDVORAKJP_BRACKET_L__ KC_LEFT_CURLY_BRACE, KC_LBRACKET, KC_LEFT_PAREN -#define __EDVORAKJP_BRACKET_R__ KC_RIGHT_PAREN, KC_RBRACKET, KC_RIGHT_CURLY_BRACE +#define __EDVORAKJP_BRACKET_L__ KC_LEFT_CURLY_BRACE, KC_LBRC, KC_LEFT_PAREN +#define __EDVORAKJP_BRACKET_R__ KC_RIGHT_PAREN, KC_RBRC, KC_RIGHT_CURLY_BRACE -#define __EDVORAKJP_PAGE__ KC_HOME, KC_PGDOWN, KC_PGUP, KC_END +#define __EDVORAKJP_PAGE__ KC_HOME, KC_PGDN, KC_PGUP, KC_END #define __EDVORAKJP_CURSOR__ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT #define LA_TAB LALT_T(KC_TAB) #define LS_SPC LSFT_T(KC_SPACE) -#define RC_BSPC RCTL_T(KC_BSPACE) +#define RC_BSPC RCTL_T(KC_BACKSPACE) #define RC_DEL RCTL_T(KC_DELETE) #define RG_ENT RGUI_T(KC_ENTER) diff --git a/users/ericgebhart/edge_keys.h b/users/ericgebhart/edge_keys.h index f37425322c..0b729fde6c 100644 --- a/users/ericgebhart/edge_keys.h +++ b/users/ericgebhart/edge_keys.h @@ -81,7 +81,7 @@ #define LEFT0 KC_GRV #define LEFT1 KC_GRV #define LEFT2 KC_TAB -#define LEFT3 KC_BSLASH +#define LEFT3 KC_BSLS //#define LEFT3 KC_COLN #define LEFT0_BP DB_GRV @@ -181,10 +181,10 @@ // I do not use those pinky keys. I had useful things there but there // are better more useful ways than those pinkys. #define ___5_BOTTOM_LEFT___ ___X2___, KC_INS, KC_LEFT, KC_RIGHT -#define ___5_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLASH, ___X2___ +#define ___5_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLS, ___X2___ #define ___4_BOTTOM_LEFT___ LCTL(KC_V), KC_INS, KC_LEFT, KC_RIGHT -#define ___4_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLASH, LCTL(KC_C) +#define ___4_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLS, LCTL(KC_C) // the bottom rows for keyboards on bepo. // bepo on bepo - not enough space to go around.... diff --git a/users/ericgebhart/layers.h b/users/ericgebhart/layers.h index 5faaf01736..aff401d65e 100755 --- a/users/ericgebhart/layers.h +++ b/users/ericgebhart/layers.h @@ -122,7 +122,7 @@ // Kinesis function key row. I don't use them. but might as well define them. #define ___KINTFUNC_L___ KC_ESC, ___FUNC_1_6___, KC_F7, KC_F8 -// #define ___KINTFUNC_RIGHT___ KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_FN0, RESET +// #define ___KINTFUNC_RIGHT___ KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_FN0, RESET #define ___KINTFUNC_R___ KC_F9, KC_F10, KC_F11, KC_F12, XXX, XXX, XXX, XXX, RESET // A TOPROWS Layer. diff --git a/users/gary/gary.h b/users/gary/gary.h index 10f2331591..ce920cf776 100644 --- a/users/gary/gary.h +++ b/users/gary/gary.h @@ -1,7 +1,6 @@ #include QMK_KEYBOARD_H #pragma once -#define USE_SERIAL #define MASTER_LEFT // Layers diff --git a/users/gordon/gordon.h b/users/gordon/gordon.h index 49b4f0569f..c6bd6e10b5 100644 --- a/users/gordon/gordon.h +++ b/users/gordon/gordon.h @@ -12,11 +12,11 @@ // KC codes that are too long #define DOLLAR KC_DOLLAR -#define LSQUIGLY KC_LBRACKET -#define RSQUIGLY KC_RBRACKET -#define NUMLOCK KC_NUMLOCK -#define CAPLOCK KC_CAPSLOCK -#define BK_SLASH KC_BSLASH +#define LSQUIGLY KC_LBRC +#define RSQUIGLY KC_RBRC +#define NUMLOCK KC_NUM_LOCK +#define CAPLOCK KC_CAPS_LOCK +#define BK_SLASH KC_BACKSLASH #define ASTERSK KC_KP_ASTERISK // Navigation @@ -57,8 +57,8 @@ #define NAV_E LT(_NAV,KC_E) #define NUMPAD_D LT(_NUMPAD,KC_D) #define MOUSE_C LT(_MOUSE,KC_C) -#define SYMB_BSP LT(_SYMBOLS,KC_BSPACE) -#define COL_MOUS LT(_MOUSE,KC_SCOLON) +#define SYMB_BSP LT(_SYMBOLS,KC_BACKSPACE) +#define COL_MOUS LT(_MOUSE,KC_SEMICOLON) #define SPAC_SYM LT(_SYMBOLS,KC_SPACE) #define SPAC_TXT LT(_TEXTNAV,KC_SPACE) @@ -80,7 +80,7 @@ #define ALT_SH_R MT(MOD_LSFT|MOD_LALT,KC_R) //MISC -#define PRINTSCR KC_PSCREEN +#define PRINTSCR KC_PRINT_SCREEN #define CALTDEL LCTL(LALT(KC_DEL)) #define TSKMGR LCTL(LSFT(KC_ESC)) diff --git a/users/gourdo1/gourdo1.c b/users/gourdo1/gourdo1.c index 26ecd8c1c0..b724a2f48d 100644 --- a/users/gourdo1/gourdo1.c +++ b/users/gourdo1/gourdo1.c @@ -593,7 +593,7 @@ bool caps_word_press_user(uint16_t keycode) { // Turn on/off NUM LOCK if current state is different void activate_numlock(bool turn_on) { if (IS_HOST_LED_ON(USB_LED_NUM_LOCK) != turn_on) { - tap_code(KC_NUMLOCK); + tap_code(KC_NUM_LOCK); } } diff --git a/users/gourdo1/gourdo1.h b/users/gourdo1/gourdo1.h index ecf6eaf25d..a198fd0805 100644 --- a/users/gourdo1/gourdo1.h +++ b/users/gourdo1/gourdo1.h @@ -17,9 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once -// DEFINE MACROS -#define ARRAYSIZE(arr) sizeof(arr) / sizeof(arr[0]) - // LAYERS -- Note: to avoid compile problems, make sure total layers matches DYNAMIC_KEYMAP_LAYER_COUNT defined in config.h (where _COLEMAK layer is defined) enum custom_user_layers { _BASE, diff --git a/users/greatwizard/config.h b/users/greatwizard/config.h index 2ee9e50900..8814fa6bdd 100644 --- a/users/greatwizard/config.h +++ b/users/greatwizard/config.h @@ -17,7 +17,16 @@ #define TAP_CODE_DELAY 5 -#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE #ifdef TAP_DANCE_ENABLE # define TAPPING_TERM 175 diff --git a/users/imchipwood/imchipwood.c b/users/imchipwood/imchipwood.c index e319c00ce7..b019012a71 100644 --- a/users/imchipwood/imchipwood.c +++ b/users/imchipwood/imchipwood.c @@ -131,7 +131,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { [ALT_F2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altf2_finished, altf2_reset), [CTL_F5] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctlf5_finished, ctlf5_reset), [ALT_F7] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altf7_finished, altf7_reset), - [DEL_NLCK] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_NLCK), + [DEL_NLCK] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_NUM), // Double tap right -> END [TD_REND] = ACTION_TAP_DANCE_DOUBLE(KC_RIGHT, KC_END), // Double tap left -> HOME diff --git a/users/ishtob/config.h b/users/ishtob/config.h index 695077528c..af4f1ac5cd 100755 --- a/users/ishtob/config.h +++ b/users/ishtob/config.h @@ -25,7 +25,6 @@ /* ws2812 RGB LED #define RGB_DI_PIN B5 -#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/users/issmirnov/rows.h b/users/issmirnov/rows.h index d35af2175c..4774e0162c 100644 --- a/users/issmirnov/rows.h +++ b/users/issmirnov/rows.h @@ -22,11 +22,11 @@ #define _________________SYMB_L1___________________ KC_MINS , KC_AT , KC_LCBR , KC_RCBR , KC_GRV #define _________________SYMB_L2___________________ KC_CIRC , KC_UNDS , KC_LPRN , KC_RPRN , KC_DLR -#define _________________SYMB_L3___________________ KC_LABK , KC_RABK , KC_LBRACKET , KC_RBRACKET , KC_TILD +#define _________________SYMB_L3___________________ KC_LABK , KC_RABK , KC_LBRC , KC_RBRC , KC_TILD #define _________________SYMB_R1___________________ KC_ASTR , KC_EXLM , KC_PIPE , KC_PERC , KC_PLUS #define _________________SYMB_R2___________________ KC_HASH , KC_EQL , KC_COLN , KC_SCLN , TAP_TOG_LAYER -#define _________________SYMB_R3___________________ KC_AMPR , KC_QUES , KC_SLASH , KC_BSLASH , TG(_NUMP) +#define _________________SYMB_R3___________________ KC_AMPR , KC_QUES , KC_SLASH , KC_BSLS , TG(_NUMP) #define _________________NUMP_L1___________________ KC_NO , KC_NO , LGUI(KC_UP) , XXXXXXX , XXXXXXX @@ -42,7 +42,7 @@ #define ______________OVERWATCH_L2_________________ KC_LCTL , KC_A , KC_S , KC_D , KC_F , KC_P #define ______________OVERWATCH_L3_________________ KC_LSHIFT , KC_Z , KC_X , KC_C , KC_V , KC_GRAVE // Ergodox only has 5 keys on bottom row: -#define ______________OVERWATCH_L4_________________ KC_LCTL , KC_F9 , KC_PSCREEN , KC_H , KC_R +#define ______________OVERWATCH_L4_________________ KC_LCTL , KC_F9 , KC_PSCR , KC_H , KC_R diff --git a/users/jjerrell/wrappers.h b/users/jjerrell/wrappers.h index cc0f963e8d..ac150a794f 100644 --- a/users/jjerrell/wrappers.h +++ b/users/jjerrell/wrappers.h @@ -319,9 +319,9 @@ #define __________________RAISE_R3___________________ KC_AT, KC_QUOT, KC_DQUO, KC_PLUS, KC_CIRC // Adjust -#define __________________ADJUST_L1__________________ KC_MAKE, DEBUG, RESET, TERM_ON, TERM_OFF -#define __________________ADJUST_L2__________________ KC__MUTE, KC__VOLDOWN, KC__VOLUP, KC_MPLY, KC_MNXT -#define __________________ADJUST_L3__________________ KC_VRSN, AU_ON, AU_OFF, CG_SWAP, CG_NORM +#define __________________ADJUST_L1__________________ KC_MAKE, DEBUG, RESET, XXXXXXX, XXXXXXX +#define __________________ADJUST_L2__________________ KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MNXT +#define __________________ADJUST_L3__________________ KC_VRSN, AU_ON, AU_OFF, CG_SWAP, CG_NORM #define __________________ADJUST_R1__________________ MU_MOD, MU_ON, MU_OFF, MI_ON, MI_OFF #define __________________ADJUST_R2__________________ MUV_IN, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD diff --git a/users/jonavin/jonavin.c b/users/jonavin/jonavin.c index b66b444f36..f203bd77df 100644 --- a/users/jonavin/jonavin.c +++ b/users/jonavin/jonavin.c @@ -213,7 +213,7 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { // Turn on/off NUM LOCK if current state is different void activate_numlock(bool turn_on) { if (IS_HOST_LED_ON(USB_LED_NUM_LOCK) != turn_on) { - tap_code(KC_NUMLOCK); + tap_code(KC_NUM_LOCK); } } diff --git a/users/jonavin/jonavin.h b/users/jonavin/jonavin.h index 3ebd3fe9f2..97f72c1248 100644 --- a/users/jonavin/jonavin.h +++ b/users/jonavin/jonavin.h @@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ARRAYSIZE(arr) sizeof(arr)/sizeof(arr[0]) #endif // !ARRAYSIZE - // LAYERS enum custom_user_layers { _BASE, diff --git a/users/kageurufu/rules.mk b/users/kageurufu/rules.mk index df9ae559a6..4bff403a7b 100644 --- a/users/kageurufu/rules.mk +++ b/users/kageurufu/rules.mk @@ -12,4 +12,3 @@ EXTRAKEY_ENABLE = yes COMMAND_ENABLE = yes CONSOLE_ENABLE = yes RGBLIGHT_ENABLE = no -RGBLIGHT_ANIMATIONS = yes diff --git a/users/konstantin/config.h b/users/konstantin/config.h index d429452363..f5247cf5a9 100644 --- a/users/konstantin/config.h +++ b/users/konstantin/config.h @@ -31,7 +31,16 @@ #define MOUSEKEY_WHEEL_TIME_TO_MAX 50 // RGB lighting -#undef RGBLIGHT_ANIMATIONS +#undef RGBLIGHT_EFFECT_BREATHING +#undef RGBLIGHT_EFFECT_RAINBOW_MOOD +#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#undef RGBLIGHT_EFFECT_SNAKE +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_ALTERNATING +#undef RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_EFFECT_BREATHING #define RGBLIGHT_EFFECT_RAINBOW_MOOD #define RGBLIGHT_EFFECT_RAINBOW_SWIRL diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index 5d80877f0e..f083839630 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c @@ -49,7 +49,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { bool numpad = IS_LAYER_ON_STATE(state, L_NUMPAD); bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); if (numpad != num_lock) { - tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state + tap_code(KC_NUM_LOCK); // Toggle Num Lock to match Numpad layer state } #endif diff --git a/users/kuatsure/kuatsure.c b/users/kuatsure/kuatsure.c index 88bf6790a4..84afcc9623 100644 --- a/users/kuatsure/kuatsure.c +++ b/users/kuatsure/kuatsure.c @@ -124,7 +124,7 @@ void matrix_scan_user(void) { } // TMUX - shift to last pane and zoom - SEQ_ONE_KEY(KC_SCOLON) { + SEQ_ONE_KEY(KC_SEMICOLON) { tmux_prefix(); SEND_STRING(";"); tmux_pane_zoom(); diff --git a/users/kuchosauronad0/config.h b/users/kuchosauronad0/config.h index 8502031f02..9315f879ae 100644 --- a/users/kuchosauronad0/config.h +++ b/users/kuchosauronad0/config.h @@ -19,8 +19,17 @@ #endif // !AUDIO_ENABLE #ifdef RGBLIGHT_ENABLE -# define RGBLIGHT_SLEEP -# undef RGBLIGHT_ANIMATIONS +# undef RGBLIGHT_SLEEP +#undef RGBLIGHT_EFFECT_BREATHING +#undef RGBLIGHT_EFFECT_RAINBOW_MOOD +#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#undef RGBLIGHT_EFFECT_SNAKE +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_ALTERNATING +#undef RGBLIGHT_EFFECT_TWINKLE # define RGBLIGHT_HUE_STEP 16 # define RGBLIGHT_SAT_STEP 16 # define RGBLIGHT_VAL_STEP 16 @@ -44,12 +53,12 @@ #if defined(LEADER_ENABLE) # define LEADER_PER_KEY_TIMING # define LEADER_TIMEOUT 250 -#endif // !LEADER_ENABLE +#endif // !LEADER_ENABLE #if defined(COMBO_ENABLE) # define COMBO_COUNT 4 # define COMBO_TERM 150 -#endif // !COMBO_ENABLE +#endif // !COMBO_ENABLE #if defined(NKRO_ENABLE) # define FORCE_NKRO @@ -82,5 +91,4 @@ #define TAP_CODE_DELAY 5 -#define MACRO_TIMER 5 - +#define MACRO_TIMER 5 diff --git a/users/losinggeneration/losinggeneration-keymap.h b/users/losinggeneration/losinggeneration-keymap.h index 74170dc312..bb1c6cf697 100644 --- a/users/losinggeneration/losinggeneration-keymap.h +++ b/users/losinggeneration/losinggeneration-keymap.h @@ -248,7 +248,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { * `-----------------------------------------''-----------------------------------------' */ #define NUMPAD_LAYER \ - KC_TAB , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_P7 , KC_P8 , KC_P9 , KC_PMNS, KC_BSPC, \ + KC_TAB , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NUM, KC_P7 , KC_P8 , KC_P9 , KC_PMNS, KC_BSPC, \ KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4 , KC_P5 , KC_P6 , KC_PPLS, KC_BSPC, \ KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P1 , KC_P2 , KC_P3 , KC_PENT, XXXXXXX, \ TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , KC_SPC , KC_P0 , KC_P0 , KC_PDOT, KC_PENT, XXXXXXX diff --git a/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h b/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h index 8a0e70a6b5..8aa779edb0 100644 --- a/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h +++ b/users/manna-harbour_miryoku/miryoku_babel/miryoku_alternatives.h @@ -249,13 +249,13 @@ U_NP, U_NP, KC_LPRN, KC_RPRN, KC_U #define MIRYOKU_ALTERNATIVES_FUN_FLIP \ RESET, U_NA, U_NA, U_NA, U_NA, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F12, \ -KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, \ +KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, U_NA, KC_SCRL, KC_F4, KC_F5, KC_F6, KC_F11, \ U_NA, KC_ALGR, U_NA, U_NA, U_NA, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F10, \ U_NP, U_NP, U_NA, U_NA, U_NA, KC_TAB, KC_SPC, KC_APP, U_NP, U_NP #define MIRYOKU_ALTERNATIVES_FUN \ KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, U_NA, U_NA, U_NA, U_NA, RESET, \ -KC_F11, KC_F4, KC_F5, KC_F6, KC_SLCK, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ +KC_F11, KC_F4, KC_F5, KC_F6, KC_SCRL, U_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, \ KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, U_NA, U_NA, U_NA, KC_ALGR, U_NA, \ U_NP, U_NP, KC_APP, KC_SPC, KC_TAB, U_NA, U_NA, U_NA, U_NP, U_NP diff --git a/users/mechmerlin/config.h b/users/mechmerlin/config.h index 459c181673..ec3b3e81e8 100644 --- a/users/mechmerlin/config.h +++ b/users/mechmerlin/config.h @@ -2,7 +2,16 @@ #ifdef RGBLIGHT_ENABLE #define RGBLIGHT_SLEEP - #define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE diff --git a/users/miles2go/config.h b/users/miles2go/config.h index 2a1d6504d6..dad7acad10 100644 --- a/users/miles2go/config.h +++ b/users/miles2go/config.h @@ -2,7 +2,16 @@ #ifdef RGBLIGHT_ENABLE #define RGBLIGHT_SLEEP -#undef RGBLIGHT_ANIMATIONS +#undef RGBLIGHT_EFFECT_RAINBOW_MOOD +#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#undef RGBLIGHT_EFFECT_SNAKE +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_ALTERNATING +#undef RGBLIGHT_EFFECT_TWINKLE + #define RGBLIGHT_EFFECT_BREATHING #endif // RGBLIGHT_ENABLE @@ -33,11 +42,11 @@ #define BABL_MODSWAP #define BABL_MOVE // Uncomment to add basic cursor movement #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts -#define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. -// edit the appropriate OS config file to enable Safari, Edge, vimpirator &etc. +#define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. +// edit the appropriate OS config file to enable Safari, Edge, vimpirator &etc. #define BABL_APP // Application specific settings this has sub-options. #define BABL_APP_CELLS // spreadsheets and tables -#define BABL_APP_EDITOR // Fancy editor commands +#define BABL_APP_EDITOR // Fancy editor commands #define BABL_APP_WINDOWSPLITTING // splitting frames & windows //All OSes diff --git a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h index bedc08fc02..552e98ba2e 100644 --- a/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h +++ b/users/miles2go/keymaps/handwired/ms_sculpt_mobile/config.h @@ -14,7 +14,7 @@ #define RGBLIGHT_COLOR_VI 0x00,0x90,0x00 #define RGBLIGHT_COLOR_READMUX 0x33,0xFF,0x33 // green screen #define RGBLIGHT_COLOR_CHROMEOS 0xf4,0xc2,0xd // google yellows -#endif +#endif #endif // bablpaste @@ -29,8 +29,17 @@ #define RGBLIGHT_COLOR_LAYER_2 0xFF, 0x00, 0x00 // symbol #define RGBLIGHT_COLOR_LAYER_3 0x00, 0xFF, 0xFF // move #define RGBLIGHT_COLOR_LAYER_4 0xFF, 0x00, 0xFF // delmove -#define RGBLIGHT_COLOR_LAYER_5 0x00, 0xFF, 0xFF -#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_COLOR_LAYER_5 0x00, 0xFF, 0xFF +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE #define RGB_LIGHT_EFFECT_BREATHE_MAX 200 #define RGBLIGHT_RAINBOW_SWIRL_RANGE 127 #endif // rgblight diff --git a/users/mtdjr/config.h b/users/mtdjr/config.h deleted file mode 100644 index 9769ebc18a..0000000000 --- a/users/mtdjr/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -// Put normal config.h settings here: -#define TAPPING_TERM 250 - -#endif // !USERSPACE_CONFIG_H diff --git a/users/mtdjr/mtdjr.c b/users/mtdjr/mtdjr.c deleted file mode 100644 index cd67bf3b5f..0000000000 --- a/users/mtdjr/mtdjr.c +++ /dev/null @@ -1,163 +0,0 @@ -#include "mtdjr.h" - -#ifdef SOLENOID_ENABLE - #include "solenoid.h" -#endif - -#ifndef RGB_MODE - #define RGB_MODE 2 -#endif -#ifndef RGB_HUE - #define RGB_HUE 285 -#endif - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_ESC), - [TD_ALTLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, LGUI(KC_L)), - [TD_ENDLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_END, LGUI(KC_L)), - [TD_PRINT] = ACTION_TAP_DANCE_DOUBLE(LGUI(LSFT(KC_3)), LGUI(LSFT(KC_4))), -}; - -// Macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case ROOT: - SEND_STRING("sudo su -\n"); - return false; break; - case PPLY: - SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n"); - return false; break; - case PSEF: - SEND_STRING("ps -ef | grep "); - return false; break; - } - } - return MACRO_NONE; -}; - -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(RGB_MODE); - rgblight_sethsv (RGB_HUE, 255, 255); - #endif - #ifdef SOLENOID_ENABLE - solenoid_setup(); - #endif -} - -void matrix_scan_user(void) { - #ifdef SOLENOID_ENABLE - solenoid_check(); - #endif -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_fire(); - } - #endif - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_ADJUST); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case SOLENOID_TOG: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_toggle(); - } - #endif - break; - case SOLENOID_DWELL_MINUS: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_dwell_minus(); - } - #endif - break; - case SOLENOID_DWELL_PLUS: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_dwell_plus(); - } - #endif - break; - case SOLENOID_BUZZ_ON: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_buzz_on(); - } - #endif - break; - case SOLENOID_BUZZ_OFF: - #ifdef SOLENOID_ENABLE - if (record->event.pressed) { - solenoid_buzz_off(); - } - #endif - break; - } - return true; -}; - -layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case _RAISE: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (240, 255, 255); - #endif - break; - case _LOWER: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (0, 255, 255); - #endif - break; - case _ADJUST: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (0, 0, 255); - #endif - break; - default: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom (RGB_HUE, 255, 255); - #endif - break; - } - return state; -} diff --git a/users/mtdjr/mtdjr.h b/users/mtdjr/mtdjr.h deleted file mode 100644 index 4d0b046fc3..0000000000 --- a/users/mtdjr/mtdjr.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -// Layers -enum user_enum { - // Layers - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - SUPER, - ADJUST, - // Solenoid - SOLENOID_TOG, - SOLENOID_DWELL_MINUS, - SOLENOID_DWELL_PLUS, - SOLENOID_BUZZ_ON, - SOLENOID_BUZZ_OFF, -}; - -// Macro / Send String -enum user_macros { - ROOT, - PPLY, - PSEF, -}; - -// TapDance -enum user_tapdance { - TD_ENDLOCK, - TD_ALTLOCK, - TD_PRINT, - TD_ESC, -}; - - -// Layers -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _SUPER 3 -#define _ADJUST 16 - -// Macros -#define KC_ROOT M(ROOT) -#define KC_PPLY M(PPLY) -#define KC_PSEF M(PSEF) - -// Tapdance -#define KC_EXC TD(TD_ESC) -#define KC_ELCK TD(TD_ENDLOCK) -#define KC_ALCK TD(TD_ALTLOCK) -#define KC_MPNT TD(TD_PRINT) - -// Custom Keycodes -#define KC_ KC_TRNS -#define KC_xxxx KC_NO -#define KC_LOWR LOWER -#define KC_RASE RAISE -#define KC_SUPR SUPER -#define KC_RST RESET - -// Key Combos -#define KC_XCPY LCTL(KC_INS) -#define KC_XINS LSFT(KC_INS) -#define KC_CAD LCTL(LALT(KC_DEL)) -#define KC_XCAD LCTL(LALT(KC_DEL)) -#define KC_XLCK LGUI(KC_L) - -// Solenoid -#define KC_STOG SOLENOID_TOG -#define KC_SDM SOLENOID_DWELL_MINUS -#define KC_SDP SOLENOID_DWELL_PLUS -#define KC_SBON SOLENOID_BUZZ_ON -#define KC_SBOF SOLENOID_BUZZ_OFF - -// RGB and Backlighting -#define KC_RGB RGB_TOG -#define KC_RHUI RGB_HUI -#define KC_RHUD RGB_HUD -#define KC_RSAI RGB_SAI -#define KC_RSAD RGB_SAD -#define KC_RVAI RGB_VAI -#define KC_RVAD RGB_VAD -#define KC_MOD RGB_MOD -#define KC_RMOD RGB_RMOD -#define KC_RPLN RGB_M_P -#define KC_RBTH RGB_M_B -#define KC_BLT BL_TOGG -#define KC_BLS BL_STEP -#define KC_BLI BL_INC -#define KC_BLD BL_DEC -#define KC_BLB BL_BRTG -#define KC_BLON BL_ON -#define KC_BLOF BL_OFF - - -#endif diff --git a/users/mtdjr/readme.md b/users/mtdjr/readme.md deleted file mode 100644 index e795ee23a5..0000000000 --- a/users/mtdjr/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2018 @mtdjr - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. diff --git a/users/mtdjr/rules.mk b/users/mtdjr/rules.mk deleted file mode 100644 index 6eec4b5b85..0000000000 --- a/users/mtdjr/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -SRC += mtdjr.c -TAP_DANCE_ENABLE = yes diff --git a/users/mtdjr/solenoid.h b/users/mtdjr/solenoid.h deleted file mode 100644 index 4ef329b4ad..0000000000 --- a/users/mtdjr/solenoid.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef SOLENOID_H -#define SOLENOID_H - -#include <timer.h> - - -#define SOLENOID_DEFAULT_DWELL 12 -#define SOLENOID_MAX_DWELL 100 -#define SOLENOID_MIN_DWELL 4 -#ifndef SOLENOID_ACTIVE - #define SOLENOID_ACTIVE false -#endif -#ifndef SOLENOID_PIN - #define SOLENOID_PIN F6 -#endif - - -bool solenoid_enabled = SOLENOID_ACTIVE; -bool solenoid_on = false; -bool solenoid_buzz = false; -bool solenoid_buzzing = false; -uint16_t solenoid_start = 0; -uint8_t solenoid_dwell = SOLENOID_DEFAULT_DWELL; - - -void solenoid_buzz_on(void) { - solenoid_buzz = true; -} - -void solenoid_buzz_off(void) { - solenoid_buzz = false; -} - -void solenoid_dwell_minus(void) { - if (solenoid_dwell > 0) solenoid_dwell--; -} - -void solenoid_dwell_plus(void) { - if (solenoid_dwell < SOLENOID_MAX_DWELL) solenoid_dwell++; -} - -void solenoid_toggle(void) { - solenoid_enabled = !solenoid_enabled; -} - -void solenoid_stop(void) { - writePinLow(SOLENOID_PIN); - solenoid_on = false; - solenoid_buzzing = false; -} - -void solenoid_fire(void) { - if (!solenoid_enabled) return; - - if (!solenoid_buzz && solenoid_on) return; - if (solenoid_buzz && solenoid_buzzing) return; - - solenoid_on = true; - solenoid_buzzing = true; - solenoid_start = timer_read(); - writePinHigh(SOLENOID_PIN); -} - -void solenoid_check(void) { - uint16_t elapsed = 0; - - if (!solenoid_on) return; - - elapsed = timer_elapsed(solenoid_start); - - //Check if it's time to finish this solenoid click cycle - if (elapsed > solenoid_dwell) { - solenoid_stop(); - return; - } - - //Check whether to buzz the solenoid on and off - if (solenoid_buzz) { - if (elapsed / SOLENOID_MIN_DWELL % 2 == 0){ - if (!solenoid_buzzing) { - solenoid_buzzing = true; - writePinHigh(SOLENOID_PIN); - } - } - else { - if (solenoid_buzzing) { - solenoid_buzzing = false; - writePinLow(SOLENOID_PIN); - } - } - } -} - -void solenoid_setup(void) { - setPinOutput(SOLENOID_PIN); -} - -#endif diff --git a/users/mtei/config.h b/users/mtei/config.h index b245d7cff2..77074357e8 100644 --- a/users/mtei/config.h +++ b/users/mtei/config.h @@ -6,7 +6,6 @@ #pragma once // Selection of RGBLIGHT MODE to use. -#undef RGBLIGHT_ANIMATIONS #undef RGBLIGHT_EFFECT_BREATHING #undef RGBLIGHT_EFFECT_RAINBOW_MOOD #undef RGBLIGHT_EFFECT_RAINBOW_SWIRL @@ -16,6 +15,7 @@ #undef RGBLIGHT_EFFECT_STATIC_GRADIENT #undef RGBLIGHT_EFFECT_RGB_TEST #undef RGBLIGHT_EFFECT_ALTERNATING +#undef RGBLIGHT_EFFECT_TWINKLE #if defined(LED_ANIMATIONS) # if LED_ANIMATIONS_LEVEL > 1 diff --git a/users/muppetjones/config.h b/users/muppetjones/config.h index e8afa9d8c5..3dd4d1b1b6 100644 --- a/users/muppetjones/config.h +++ b/users/muppetjones/config.h @@ -17,7 +17,6 @@ #pragma once #ifdef RGBLIGHT_ENABLE -// # define RGBLIGHT_ANIMATIONS # define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_SAT_STEP 16 # define RGBLIGHT_VAL_STEP 16 diff --git a/users/muppetjones/readme/rgblayers.md b/users/muppetjones/readme/rgblayers.md index fb69800177..862ba75941 100644 --- a/users/muppetjones/readme/rgblayers.md +++ b/users/muppetjones/readme/rgblayers.md @@ -14,7 +14,6 @@ This bit of code allows you to define layer lighting that respects your current ``` #ifdef RGBLIGHT_ENABLE - // # define RGBLIGHT_ANIMATIONS # define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_SAT_STEP 16 # define RGBLIGHT_VAL_STEP 16 diff --git a/users/muppetjones/wrappers.h b/users/muppetjones/wrappers.h index 301554f5d5..ba94d0eda4 100644 --- a/users/muppetjones/wrappers.h +++ b/users/muppetjones/wrappers.h @@ -65,7 +65,7 @@ * `----------------------------------' `----------------------------------' */ // NOTE: The "BACKLIT" keycode is planck specific -#define __ADJUST_L1________________________________ RESET, DEBUG, XXXXXXX, TERM_ON, TERM_OFF +#define __ADJUST_L1________________________________ RESET, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX #define __ADJUST_L2________________________________ RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD #define __ADJUST_L3________________________________ XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX diff --git a/users/ninjonas/ninjonas.h b/users/ninjonas/ninjonas.h index 94b4712a63..99a31db056 100644 --- a/users/ninjonas/ninjonas.h +++ b/users/ninjonas/ninjonas.h @@ -132,8 +132,8 @@ uint16_t encoder_rotated_timer; #define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPAP #define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE -#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP -#define _________MEDIA_3_________ XXXXXXX, KC_MRWD, KC__VOLDOWN +#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC_VOLU +#define _________MEDIA_3_________ XXXXXXX, KC_MRWD, KC_VOLD #if defined(KEYBOARD_crkbd_rev1) || defined(KEYBOARD_kyria_rev1) #define ________MOD_LEFT_________ T_GUI, KC_LCTL, LT_RAI diff --git a/users/not-quite-neo/nqn-basic-layout.h b/users/not-quite-neo/nqn-basic-layout.h index d1b9a1c477..71db9d379b 100644 --- a/users/not-quite-neo/nqn-basic-layout.h +++ b/users/not-quite-neo/nqn-basic-layout.h @@ -118,7 +118,7 @@ The naming convention for these blocks is #define L06_LEFT_03 KC_F9, KC_F10, KC_F11, KC_F12, _______ #define L06_RIGHT_01 KC_MAIL, KC_MSEL, KC_MY_COMPUTER, KC_CALCULATOR, N_PASTE #define L06_RIGHT_02 KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, N_COPY -#define L06_RIGHT_03 KC_PSCR, KC_SLCK, KC_PAUS, KC_NLCK, N_CUT +#define L06_RIGHT_03 KC_PSCR, KC_SCRL, KC_PAUS, KC_NUM, N_CUT #endif diff --git a/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h b/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h index 8276cf207f..f5ab1631a7 100644 --- a/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h +++ b/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h @@ -23,7 +23,7 @@ Additionally, there are some common chars that we dit not yet define: // NQN key definitions in no particular order -#define N_LT KC_NONUS_BSLASH +#define N_LT KC_NONUS_BACKSLASH #define N_HS KC_NONUS_HASH #define N_DOTS RALT(KC_DOT) // … #define N_USC LSFT(KC_SLASH) // _ @@ -31,7 +31,7 @@ Additionally, there are some common chars that we dit not yet define: #define N_RSQBR RALT(KC_9) // ] #define N_CIRC KC_GRAVE // ^ #define N_EXKL LSFT(KC_1) // ! -#define N_GT LSFT(KC_NONUS_BSLASH) // > +#define N_GT LSFT(KC_NONUS_BACKSLASH) // > #define N_EQ LSFT(KC_0) // = #define N_AMP LSFT(KC_6) // & #define N_BSLS RALT(KC_MINS) // \ backslash @@ -44,23 +44,23 @@ Additionally, there are some common chars that we dit not yet define: #define N_RPARN LSFT(KC_9) // ) #define N_MINS KC_SLASH // - #define N_COLN LSFT(KC_DOT) // : -#define N_HASH KC_BSLASH // # +#define N_HASH KC_BACKSLASH // # #define N_DLR LSFT(KC_4) // $ -#define N_PIPE RALT(KC_NONUS_BSLASH) // | +#define N_PIPE RALT(KC_NONUS_BACKSLASH) // | #define N_TILD RALT(KC_RBRC) // ~ #define N_GRAVE LSFT(KC_EQUAL) // ` #define N_PLUS KC_RBRC // + #define N_PERC LSFT(KC_5) // % #define N_QUOT LSFT(KC_2) // " -#define N_SING LSFT(KC_BSLASH) // ' +#define N_SING LSFT(KC_BACKSLASH) // ' #define N_SEMI LSFT(KC_COMM) // ; #define N_EURO RALT(KC_E) // € #define N_AT RALT(KC_Q) // @ #define N_Z KC_Y #define N_Y KC_Z #define N_AE KC_QUOTE // ä -#define N_OE KC_SCOLON // ö -#define N_UE KC_LBRACKET // ü +#define N_OE KC_SCLN // ö +#define N_UE KC_LBRC // ü #define N_MU RALT(KC_M) // µ #define N_SS KC_MINS // ß #define N_DEGRE LSFT(KC_GRAVE) // ° diff --git a/users/nstickney/nstickney.c b/users/nstickney/nstickney.c index 8222e7289d..94453ec340 100644 --- a/users/nstickney/nstickney.c +++ b/users/nstickney/nstickney.c @@ -38,13 +38,13 @@ void dance_lock_finished(qk_tap_dance_state_t *state, void *user_data) { register_code(KC_LGUI); break; case 2: - register_code(KC_NLCK); + register_code(KC_NUM); break; case 3: register_code(KC_CAPS); break; case 4: - register_code(KC_SLCK); + register_code(KC_SCRL); break; default: break; @@ -57,13 +57,13 @@ void dance_lock_reset(qk_tap_dance_state_t *state, void *user_data) { unregister_code(KC_LGUI); break; case 2: - register_code(KC_NLCK); + register_code(KC_NUM); break; case 3: register_code(KC_CAPS); break; case 4: - register_code(KC_SLCK); + register_code(KC_SCRL); break; default: break; diff --git a/users/pcoves/tapDance.c b/users/pcoves/tapDance.c index f8c9aaf466..548ed35274 100644 --- a/users/pcoves/tapDance.c +++ b/users/pcoves/tapDance.c @@ -6,7 +6,7 @@ void left(qk_tap_dance_state_t* state, void* user_data) { switch (state->count) { case 1: if (state->pressed) - tap_code16(S(KC_LBRACKET)); + tap_code16(S(KC_LEFT_BRACKET)); else tap_code16(S(KC_9)); break; @@ -14,7 +14,7 @@ void left(qk_tap_dance_state_t* state, void* user_data) { if (state->pressed) tap_code16(S(KC_COMM)); else - tap_code(KC_LBRACKET); + tap_code(KC_LEFT_BRACKET); break; default: reset_tap_dance(state); @@ -25,7 +25,7 @@ void right(qk_tap_dance_state_t* state, void* user_data) { switch (state->count) { case 1: if (state->pressed) - tap_code16(S(KC_RBRACKET)); + tap_code16(S(KC_RIGHT_BRACKET)); else tap_code16(S(KC_0)); break; @@ -33,7 +33,7 @@ void right(qk_tap_dance_state_t* state, void* user_data) { if (state->pressed) tap_code16(S(KC_DOT)); else - tap_code(KC_RBRACKET); + tap_code(KC_RIGHT_BRACKET); break; default: reset_tap_dance(state); diff --git a/users/rmw/rmw.h b/users/rmw/rmw.h index 272a400c75..b4018d5570 100644 --- a/users/rmw/rmw.h +++ b/users/rmw/rmw.h @@ -48,7 +48,7 @@ enum user_custom_keycodes_universal { ,R_CUT = LGUI(KC_X) ,R_COPY = LGUI(KC_C) ,R_PASTE = LGUI(KC_V) - ,DEL_WRD = LALT(KC_BSPACE) + ,DEL_WRD = LALT(KC_BACKSPACE) ,MVW_LEFT = LALT(KC_LEFT) ,MVW_RIGHT = LALT(KC_RIGHT) ,SELW_LEFT = LALT(S(KC_LEFT)) @@ -72,7 +72,7 @@ enum user_custom_keycodes_universal { ,R_CUT = LCTL(KC_X) ,R_COPY = LCTL(KC_C) ,R_PASTE = LCTL(KC_V) - ,DEL_WRD = LALT(KC_BSPACE) + ,DEL_WRD = LALT(KC_BACKSPACE) ,MVW_LEFT = LCTL(KC_LEFT) ,MVW_RIGHT = LCTL(KC_RIGHT) ,SELW_LEFT = LCTL(S(KC_LEFT)) diff --git a/users/romus/romus.h b/users/romus/romus.h index b65e32eb5b..f79777d91b 100644 --- a/users/romus/romus.h +++ b/users/romus/romus.h @@ -183,8 +183,8 @@ enum { * | | | | | | || | | | | | | * `------------------------------------------------------------------------' */ #define ALTCHAR \ - KC_GRV, DBL_QUO,DBL_DQT,CUR_EUR,CUR_BPN,_______,_______,KC_HOME,KC_PGUP,KC_PSCREEN, KC_BSLASH, KC_SLSH, \ - REDO, DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,KC_LALT,KC_INS, KC_END, KC_PGDN,KC_SCROLLLOCK, CUR_BIT, KC_MINUS, \ + KC_GRV, DBL_QUO,DBL_DQT,CUR_EUR,CUR_BPN,_______,_______,KC_HOME,KC_PGUP,KC_PSCR, KC_BSLS, KC_SLSH, \ + REDO, DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,KC_LALT,KC_INS, KC_END, KC_PGDN,KC_SCRL, CUR_BIT, KC_MINUS, \ UNDO, CUT, COPY, PASTE, EXIT, KC_LSFT,_______,_______,_______,_______, CUR_YEN, KC_EQUAL, \ _______,_______,_______,_______,_______,_______,_______,DBL_SPC,_______,_______, _______, _______ @@ -199,7 +199,7 @@ enum { * | Ctrl| Alt | / | ` | SYM | Spc || F5 | Ent | 0 | < | v | > | * `------------------------------------------------------------------------' */ #define GAME \ - K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NLCK,KC_BSPC, \ + K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NUM, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_P4, KC_P5, KC_P6, KC_BSLS,KC_ENT , \ KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_P1, KC_P2, KC_P3, KC_UP,K_MOUSE, \ KC_LCTL,KC_LALT,KC_SLSH,KC_GRV, K_NUMBR,KC_SPC, KC_F5, KC_ENT, KC_P0, KC_LEFT,KC_DOWN,KC_RGHT diff --git a/users/rupa/wrappers.h b/users/rupa/wrappers.h index c5cae464b8..938ec2db99 100644 --- a/users/rupa/wrappers.h +++ b/users/rupa/wrappers.h @@ -91,8 +91,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define ____65_LOWER_______________ROW1 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ZZZZZ, _______, _______ #define ____65_LOWER_______________ROW2 _______, U_FRACT, U_ITALI, U_MONOS, U_NORML, U_SANSI, U_SANSN, U_SCRPT, _______, _______, KC_PSCR, _______, _______, _______, _______ -#define ____65_LOWER_______________ROW3 _______, _______, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -#define ____65_LOWER_______________ROW4 _______, ZALGO , _______, KC_CAPS, VRSN, _______, KC_NLCK, _______, _______, _______, _______, _______, _______, _______ +#define ____65_LOWER_______________ROW3 _______, _______, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +#define ____65_LOWER_______________ROW4 _______, ZALGO , _______, KC_CAPS, VRSN, _______, KC_NUM, _______, _______, _______, _______, _______, _______, _______ #define ____65_LOWER_______________ROW5 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ /* _ADJUST diff --git a/users/rverst/config.h b/users/rverst/config.h index f5cb5c76fd..52e7c861ca 100644 --- a/users/rverst/config.h +++ b/users/rverst/config.h @@ -18,9 +18,16 @@ #ifdef RGBLIGHT_ENABLE # define RGBLIGHT_SLEEP -# ifdef RGBLIGHT_ANIMATIONS -# undef RGBLIGHT_ANIMATIONS -# endif +# undef RGBLIGHT_EFFECT_BREATHING +# undef RGBLIGHT_EFFECT_RAINBOW_MOOD +# undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +# undef RGBLIGHT_EFFECT_SNAKE +# undef RGBLIGHT_EFFECT_KNIGHT +# undef RGBLIGHT_EFFECT_CHRISTMAS +# undef RGBLIGHT_EFFECT_STATIC_GRADIENT +# undef RGBLIGHT_EFFECT_RGB_TEST +# undef RGBLIGHT_EFFECT_ALTERNATING +# undef RGBLIGHT_EFFECT_TWINKLE # define RGBLIGHT_SLEEP # define RGBLIGHT_EFFECT_BREATHING # define RGBLIGHT_EFFECT_RAINBOW_MOOD diff --git a/users/scheiklp/koy_keys_on_quertz_de_latin1.h b/users/scheiklp/koy_keys_on_quertz_de_latin1.h index e098e75dfc..7c88eabd79 100644 --- a/users/scheiklp/koy_keys_on_quertz_de_latin1.h +++ b/users/scheiklp/koy_keys_on_quertz_de_latin1.h @@ -16,7 +16,7 @@ Additionally, there are some common chars that we dit not yet define: // NQN key definitions in no particular order -#define N_LT KC_NONUS_BSLASH +#define N_LT KC_NONUS_BACKSLASH #define N_HS KC_NONUS_HASH #define N_DOTS RALT(KC_DOT) // … #define N_USC LSFT(KC_SLASH) // _ @@ -24,7 +24,7 @@ Additionally, there are some common chars that we dit not yet define: #define N_RSQBR RALT(KC_9) // ] #define N_CIRC KC_GRAVE // ^ #define N_EXKL LSFT(KC_1) // ! -#define N_GT LSFT(KC_NONUS_BSLASH) // > +#define N_GT LSFT(KC_NONUS_BACKSLASH) // > #define N_EQ LSFT(KC_0) // = #define N_AMP LSFT(KC_6) // & #define N_BSLS RALT(KC_MINS) // \ backslash @@ -37,23 +37,23 @@ Additionally, there are some common chars that we dit not yet define: #define N_RPARN LSFT(KC_9) // ) #define N_MINS KC_SLASH // - #define N_COLN LSFT(KC_DOT) // : -#define N_HASH KC_BSLASH // # +#define N_HASH KC_BACKSLASH // # #define N_DLR LSFT(KC_4) // $ -#define N_PIPE RALT(KC_NONUS_BSLASH) // | +#define N_PIPE RALT(KC_NONUS_BACKSLASH) // | #define N_TILD RALT(KC_RBRC) // ~ #define N_GRAVE LSFT(KC_EQUAL) // ` #define N_PLUS KC_RBRC // + #define N_PERC LSFT(KC_5) // % #define N_QUOT LSFT(KC_2) // " -#define N_SING LSFT(KC_BSLASH) // ' +#define N_SING LSFT(KC_BACKSLASH) // ' #define N_SEMI LSFT(KC_COMM) // ; #define N_EURO RALT(KC_E) // € #define N_AT RALT(KC_Q) // @ #define N_Z KC_Y #define N_Y KC_Z #define N_AE KC_QUOTE // ä -#define N_OE KC_SCOLON // ö -#define N_UE KC_LBRACKET // ü +#define N_OE KC_SCLN // ö +#define N_UE KC_LBRC // ü #define N_MU RALT(KC_M) // µ #define N_SS KC_MINS // ß #define N_DEGRE LSFT(KC_GRAVE) // ° diff --git a/users/sethBarberee/config.h b/users/sethBarberee/config.h index c97d39151b..00cb96d3e0 100644 --- a/users/sethBarberee/config.h +++ b/users/sethBarberee/config.h @@ -26,16 +26,23 @@ # ifndef RGBLIGHT_VAL_STEP # define RGBLIGHT_VAL_STEP 8 #endif -// Trim animations I don't use/like -# ifdef RGBLIGHT_ANIMATIONS -# undef RGBLIGHT_ANIMATIONS -# endif -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -# define RGBLIGHT_EFFECT_TWINKLE -# ifndef CAPS_LOCK_MODE -# define CAPS_LOCK_MODE RGBLIGHT_MODE_STATIC_LIGHT -# endif + // Trim animations I don't use/like +# undef RGBLIGHT_EFFECT_BREATHING +# undef RGBLIGHT_EFFECT_RAINBOW_MOOD +# undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +# undef RGBLIGHT_EFFECT_SNAKE +# undef RGBLIGHT_EFFECT_KNIGHT +# undef RGBLIGHT_EFFECT_CHRISTMAS +# undef RGBLIGHT_EFFECT_STATIC_GRADIENT +# undef RGBLIGHT_EFFECT_RGB_TEST +# undef RGBLIGHT_EFFECT_ALTERNATING +# undef RGBLIGHT_EFFECT_TWINKLE +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_TWINKLE +# ifndef CAPS_LOCK_MODE +# define CAPS_LOCK_MODE RGBLIGHT_MODE_STATIC_LIGHT +# endif #endif // RGBLIGHT_ENABLE #ifndef AUDIO_ENABLE diff --git a/users/sigma/sigma.c b/users/sigma/sigma.c index 8470060a53..64fa68228b 100644 --- a/users/sigma/sigma.c +++ b/users/sigma/sigma.c @@ -67,7 +67,7 @@ void set_os(uint8_t os) { #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) switch (os) { case _OS_MACOS: - set_unicode_input_mode(UC_OSX); + set_unicode_input_mode(UC_MAC); break; case _OS_LINUX: set_unicode_input_mode(UC_LNX); diff --git a/users/snowe/wrappers.h b/users/snowe/wrappers.h index 9ef7dce607..47fe4a5ace 100644 --- a/users/snowe/wrappers.h +++ b/users/snowe/wrappers.h @@ -88,5 +88,5 @@ NOTE: These are all the same length. If you do a search/replace #define _________________ADJUST_L2_________________ MU_TOG , TG(_GAMING), AU_ON, AU_OFF, AG_NORM #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, _______ #define _________________ADJUST_R1_________________ _______, _______, _______, _______, _______ -#define _________________ADJUST_R2_________________ RESET, CG_TOGG, _______, _______, _______ +#define _________________ADJUST_R2_________________ KC_RESET,CG_TOGG, _______, _______, _______ #define _________________ADJUST_R3_________________ _______, KC_MNXT, KC_VOLU, KC_VOLD, KC_MPLY diff --git a/users/spidey3/config.h b/users/spidey3/config.h index 91bcf910ee..808de4d591 100644 --- a/users/spidey3/config.h +++ b/users/spidey3/config.h @@ -14,7 +14,16 @@ # define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF # define RGBLIGHT_STARTUP_ANIMATION -# undef RGBLIGHT_ANIMATIONS +# undef RGBLIGHT_EFFECT_BREATHING +# undef RGBLIGHT_EFFECT_RAINBOW_MOOD +# undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +# undef RGBLIGHT_EFFECT_SNAKE +# undef RGBLIGHT_EFFECT_KNIGHT +# undef RGBLIGHT_EFFECT_CHRISTMAS +# undef RGBLIGHT_EFFECT_STATIC_GRADIENT +# undef RGBLIGHT_EFFECT_RGB_TEST +# undef RGBLIGHT_EFFECT_ALTERNATING +# undef RGBLIGHT_EFFECT_TWINKLE # define RGBLIGHT_EFFECT_BREATHING # define RGBLIGHT_EFFECT_RAINBOW_MOOD # define RGBLIGHT_EFFECT_RAINBOW_SWIRL @@ -42,7 +51,7 @@ #define SPI_DEBUG_SCAN_RATE #undef MANUFACTURER -#define MANUFACTURER Window of Fire +#define MANUFACTURER "Window of Fire" // Some keyboards enable BACKLIGHT_CAPS_LOCK without checking if backlight is enabled. // Undef as appropriate to avoid compiler warnings in that case. diff --git a/users/spidey3/layer_rgb.c b/users/spidey3/layer_rgb.c index c867468194..bdf4584ef1 100644 --- a/users/spidey3/layer_rgb.c +++ b/users/spidey3/layer_rgb.c @@ -97,7 +97,7 @@ const rgblight_segment_t *const PROGMEM _rgb_layers[] = { // clang-format on -const uint8_t PROGMEM _n_rgb_layers = sizeof(_rgb_layers) / sizeof(_rgb_layers[0]) - 1; +const uint8_t PROGMEM _n_rgb_layers = ARRAY_SIZE(_rgb_layers) - 1; void clear_rgb_layers() { for (uint8_t i = 0; i < _n_rgb_layers; i++) { @@ -112,8 +112,7 @@ void do_rgb_layers(layer_state_t state, uint8_t start, uint8_t end) { } } -void do_rgb_unicode(void) { - uint8_t uc_mode = get_unicode_input_mode(); +void do_rgb_unicode(uint8_t uc_mode) { for (uint8_t i = 0; i < UC__COUNT; i++) { bool is_on = i == uc_mode; rgblight_set_layer_state(UNICODE_OFFSET + i, is_on); @@ -123,7 +122,7 @@ void do_rgb_unicode(void) { void do_rgb_all(void) { do_rgb_layers(default_layer_state, LAYER_BASE_DEFAULT, LAYER_BASE_REGULAR); do_rgb_layers(layer_state, LAYER_BASE_REGULAR, LAYER_BASE_END); - do_rgb_unicode(); + do_rgb_unicode(get_unicode_input_mode()); rgblight_set_layer_state(MISC_OFFSET + 0, spi_gflock); rgblight_set_layer_state(MISC_OFFSET + 1, spi_replace_mode != SPI_NORMAL); } @@ -148,7 +147,7 @@ extern rgblight_status_t rgblight_status; # define STARTUP_ANIMATION_CYCLE_STEP 2 # define STARTUP_ANIMATION_RAMP_TO_STEPS 70 # define STARTUP_ANIMATION_STEP_TIME 10 -# define STARTUP_ANIMATION_INITIAL_DELAY 0 // milliseconds, must be < 255 * STEP_TIME +# define STARTUP_ANIMATION_INITIAL_DELAY 0 // milliseconds, must be < 255 * STEP_TIME // clang-format off typedef enum { @@ -382,6 +381,13 @@ bool led_update_user_rgb(led_t led_state) { return true; } +#if defined(UNICODE_COMMON_ENABLE) +void unicode_input_mode_set_user_rgb(uint8_t input_mode) { + rgb_layer_ack(ACK_MEH); + do_rgb_unicode(input_mode); +} +#endif + void rgb_layer_ack_yn(bool yn) { rgb_layer_ack(yn ? ACK_YES : ACK_NO); } void rgb_layer_ack(layer_ack_t n) { @@ -458,7 +464,7 @@ void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { break; case RGB_TOG: - // Hack - we only get called on the press for RGB_TOG, + // Hack - we only get called on the press for RGB_TOG, // but the flag is only flipped on the release... rgb_layer_ack_yn(!rgblight_config.enable); break; @@ -476,20 +482,5 @@ void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { rgb_layer_ack_yn(keymap_config.nkro); break; #endif - -#if defined(UNICODE_COMMON_ENABLE) - case UC_M_MA: - case UC_M_LN: - case UC_M_WI: - case UC_M_BS: - case UC_M_WC: - case UC_M_EM: - - case UC_MOD: - case UC_RMOD: - rgb_layer_ack(ACK_MEH); - do_rgb_unicode(); - break; -#endif } } diff --git a/users/spidey3/rules.mk b/users/spidey3/rules.mk index c95582e176..35cfdb4187 100644 --- a/users/spidey3/rules.mk +++ b/users/spidey3/rules.mk @@ -11,5 +11,5 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) SRC += layer_rgb.c endif ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) - SRC += unicode.c + SRC += spidey3_unicode.c endif diff --git a/users/spidey3/spidey3.c b/users/spidey3/spidey3.c index 842bb465f7..b4c261ce1d 100644 --- a/users/spidey3/spidey3.c +++ b/users/spidey3/spidey3.c @@ -98,14 +98,14 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin clear_oneshot_mods(); #endif - bool caps = host_keyboard_led_state().caps_lock; + bool caps = host_keyboard_led_state().caps_lock; uint32_t base = ((shifted == caps) ? baseAlphaLower : baseAlphaUpper); _register(base + (keycode - KC_A)); set_mods(temp_mod); } return false; case KC_0: - if (shifted) { // skip shifted numbers, so that we can still use symbols etc. + if (shifted) { // skip shifted numbers, so that we can still use symbols etc. return true; } if (record->event.pressed) { @@ -113,7 +113,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin } return false; case KC_1 ... KC_9: - if (shifted) { // skip shifted numbers, so that we can still use symbols etc. + if (shifted) { // skip shifted numbers, so that we can still use symbols etc. return true; } if (record->event.pressed) { @@ -122,7 +122,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin return false; case KC_SPACE: if (record->event.pressed) { - _register(spaceGlyph); // em space + _register(spaceGlyph); // em space } return false; } @@ -199,8 +199,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // clang-format off - case CH_CPNL: host_consumer_send(AL_CONTROL_PANEL); return false; - case CH_ASST: host_consumer_send(AL_ASSISTANT); return false; case CH_SUSP: tap_code16(LGUI(LSFT(KC_L))); return true; // clang-format on @@ -285,11 +283,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } else { switch (keycode) { - case CH_CPNL: - case CH_ASST: - host_consumer_send(0); - return false; - case SPI_KP_00: unregister_code(KC_KP_0); return false; @@ -338,7 +331,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_mods(mods); return false; } - } else { // on release of KC_BSPC + } else { // on release of KC_BSPC // In case KC_DEL is still being sent even after the release of KC_BSPC if (delkey_registered) { unregister_code(KC_DEL); @@ -387,3 +380,11 @@ bool led_update_user(led_t led_state) { return true; #endif } + +#if defined(UNICODE_COMMON_ENABLE) +void unicode_input_mode_set_user(uint8_t input_mode) { +# ifdef RGBLIGHT_ENABLE + unicode_input_mode_set_user_rgb(input_mode); +# endif +} +#endif diff --git a/users/spidey3/spidey3.h b/users/spidey3/spidey3.h index e91b299e55..2b2cac0a20 100644 --- a/users/spidey3/spidey3.h +++ b/users/spidey3/spidey3.h @@ -6,7 +6,7 @@ #include QMK_KEYBOARD_H #ifdef UNICODEMAP_ENABLE -# include "unicode.h" +# include "spidey3_unicode.h" #endif enum userspace_layers { @@ -17,9 +17,7 @@ enum userspace_layers { }; enum custom_keycodes { - CH_CPNL = SAFE_RANGE, // AL Control Panel - CH_ASST, // AL Context-aware Desktop Assistant - CH_SUSP, // Suspend + CH_SUSP = SAFE_RANGE, // Suspend SPI_NORMAL, SPI_WIDE, @@ -65,6 +63,11 @@ void rgb_layer_ack(layer_ack_t n); void rgb_layer_ack_yn(bool yn); void clear_rgb_layers(void); void shutdown_user_rgb(void); + +# if defined(UNICODE_COMMON_ENABLE) +void unicode_input_mode_set_user_rgb(uint8_t input_mode); +# endif + #endif #ifdef UNICODEMAP_ENABLE diff --git a/users/spidey3/unicode.c b/users/spidey3/spidey3_unicode.c index 5292b0809b..c2804d8805 100644 --- a/users/spidey3/unicode.c +++ b/users/spidey3/spidey3_unicode.c @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later -#include "unicode.h" +#include "spidey3_unicode.h" const uint32_t PROGMEM unicode_map[] = { [BUL1] = 0x2022, // • diff --git a/users/spidey3/unicode.h b/users/spidey3/spidey3_unicode.h index ee8e00056c..ee8e00056c 100644 --- a/users/spidey3/unicode.h +++ b/users/spidey3/spidey3_unicode.h diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c index 6655170d4a..5e58bc9e3f 100644 --- a/users/talljoe/talljoe.c +++ b/users/talljoe/talljoe.c @@ -39,7 +39,7 @@ const char layer_names[32][16] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = TEMPLATE_TKL( - US_LOCK, 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_PSCR, KC_SLCK, MO_ADJ , + US_LOCK, 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_PSCR, KC_SCRL, MO_ADJ , US_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 , US_BSLS, KC_INS , KC_HOME, KC_PGUP, US_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_BSPC, KC_DEL , KC_END , KC_PGDN, CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, KC_QUOT, US_ENT , diff --git a/users/tominabox1/config.h b/users/tominabox1/config.h index f853e18605..cf5d317fb7 100644 --- a/users/tominabox1/config.h +++ b/users/tominabox1/config.h @@ -15,14 +15,23 @@ #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 50 - #define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_SLEEP #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 50 - #define DRIVER_LED_TOTAL RGBLED_NUM + #define RGB_MATRIX_LED_COUNT RGBLED_NUM #endif // RGBL_MATRIX_ENABLE #endif // KEYBOARD_lazydesigners_dimple diff --git a/users/tominabox1/dimple_rgb.c b/users/tominabox1/dimple_rgb.c index 49d95eb43a..299dc830f1 100644 --- a/users/tominabox1/dimple_rgb.c +++ b/users/tominabox1/dimple_rgb.c @@ -1,7 +1,7 @@ #include "dz60rgb.h" #include "config.h" #if defined (dzrgb60_iso) -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, {0, K_12, J_12, L_12}, @@ -86,7 +86,7 @@ led_config_t g_led_config = { { } }; #elif defined (dzrgb60_hhkb) -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, H_15, G_15, I_15}, {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, @@ -172,7 +172,7 @@ led_config_t g_led_config = { { } }; #elif defined (dzrgb60_hhkb_iso) -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, H_15, G_15, I_15}, {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, @@ -258,7 +258,7 @@ led_config_t g_led_config = { { } }; #elif defined (dzrgb60_ansi) -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, {0, K_12, J_12, L_12}, @@ -343,7 +343,7 @@ led_config_t g_led_config = { { } }; #else -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, K_14, J_14, L_14}, {0, K_13, J_13, L_13}, {0, K_12, J_12, L_12}, diff --git a/users/tominabox1/tominabox1.c b/users/tominabox1/tominabox1.c index b4ec224d07..999222fa67 100644 --- a/users/tominabox1/tominabox1.c +++ b/users/tominabox1/tominabox1.c @@ -58,7 +58,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode uint16_t time = scale16by8(g_rgb_counters.tick, speed / 8); hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (HAS_FLAGS(g_led_config.flags[i], led_type)) { rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } @@ -68,7 +68,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode default: // Solid Color { RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { + for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++) { if (HAS_FLAGS(g_led_config.flags[i], led_type)) { rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/users/twschum/xtonhasvim.c b/users/twschum/xtonhasvim.c index a1adf39f04..15d1b0d940 100644 --- a/users/twschum/xtonhasvim.c +++ b/users/twschum/xtonhasvim.c @@ -70,7 +70,7 @@ static void comma_period(uint16_t keycode) { case VIM_COMMA: if (SHIFTED) { // indent - tap_code16(LGUI(KC_LBRACKET)); + tap_code16(LGUI(KC_LEFT_BRACKET)); } else { // toggle comment tap_code16(LGUI(KC_SLASH)); @@ -79,7 +79,7 @@ static void comma_period(uint16_t keycode) { case VIM_PERIOD: if (SHIFTED) { // outdent - tap_code16(LGUI(KC_RBRACKET)); + tap_code16(LGUI(KC_RIGHT_BRACKET)); } break; } diff --git a/users/txkyel/txkyel.c b/users/txkyel/txkyel.c index b01a71bb81..6ae6f4f1f9 100644 --- a/users/txkyel/txkyel.c +++ b/users/txkyel/txkyel.c @@ -49,7 +49,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { [HC_LEFT] = ACTION_TAP_HOLD_CTL(KC_LEFT), [HC_RGHT] = ACTION_TAP_HOLD_CTL(KC_RGHT), [TH_ESC_TAB] = ACTION_TAP_HOLD(KC_TAB, KC_ESC), - [TH_HOME_BSLS] = ACTION_TAP_HOLD(KC_BSLASH, KC_HOME), + [TH_HOME_BSLS] = ACTION_TAP_HOLD(KC_BACKSLASH, KC_HOME), [TH_HOME_BSLS] = ACTION_TAP_HOLD(KC_PIPE, KC_END), [TH_QUOT_GRV] = ACTION_TAP_HOLD(KC_QUOT, KC_GRV), }; diff --git a/users/uqs/config.h b/users/uqs/config.h index b8a140fe87..5530417de1 100644 --- a/users/uqs/config.h +++ b/users/uqs/config.h @@ -4,7 +4,6 @@ #ifdef RGBLIGHT_ENABLE # define RGBLIGHT_SLEEP -//# define RGBLIGHT_ANIMATIONS // disabled to save space # define RGBLIGHT_LAYERS # define RGBLIGHT_MAX_LAYERS 8 // default is 16 # define RGBLIGHT_DISABLE_KEYCODES // RGB_foo keys no longer work, saves 600 bytes diff --git a/users/uqs/uqs.c b/users/uqs/uqs.c index 72284143c6..7e2d09e0f6 100644 --- a/users/uqs/uqs.c +++ b/users/uqs/uqs.c @@ -78,9 +78,9 @@ const rgblight_segment_t* const PROGMEM my_rgb_layers[] = { my_rgb_segments[L_MOUSE], }; -_Static_assert(sizeof(my_rgb_layers) / sizeof(my_rgb_layers[0]) == - sizeof(my_rgb_segments) / sizeof(my_rgb_segments[0]), - "Number of rgb_segment definitions does not match up!"); +_Static_assert(ARRAY_SIZE(my_rgb_layers) == + ARRAY_SIZE(my_rgb_segments), + "Number of rgb_segment definitions does not match up!"); #endif #ifdef COMBO_ENABLE @@ -125,7 +125,7 @@ const uint16_t PROGMEM my_combos[][4] = { {KC_BTN1, KC_BTN2, KC_BTN3, COMBO_END}, }; -const uint16_t COMBO_LEN = sizeof(my_action_combos) / sizeof(my_action_combos[0]) + sizeof(my_combos) / sizeof(my_combos[0]); +const uint16_t COMBO_LEN = ARRAY_SIZE(my_action_combos) + ARRAY_SIZE(my_combos); #define MY_ACTION_COMBO(ck) \ [ck] = { .keys = &(my_action_combos[ck][0]) } @@ -162,11 +162,11 @@ combo_t key_combos[] = { MY_COMBO(14), }; -_Static_assert(sizeof(key_combos) / sizeof(key_combos[0]) == - (sizeof(my_action_combos) / sizeof(my_action_combos[0]) + sizeof(my_combos) / sizeof(my_combos[0])), - "Number of combo definitions does not match up!"); +_Static_assert(ARRAY_SIZE(key_combos) == + (ARRAY_SIZE(my_action_combos) + ARRAY_SIZE(my_combos)), + "Number of combo definitions does not match up!"); #else -combo_t key_combos[sizeof(my_action_combos) / sizeof(my_action_combos[0]) + sizeof(my_combos) / sizeof(my_combos[0])]; +combo_t key_combos[ARRAY_SIZE(my_action_combos) + ARRAY_SIZE(my_combos)]; #endif void process_combo_event(uint16_t combo_index, bool pressed) { @@ -235,10 +235,10 @@ void keyboard_post_init_user(void) { #endif #if defined(COMBO_ENABLE) && !defined(COMBO_STATICALLY) uint8_t i = 0; - for (; i < sizeof(my_action_combos) / sizeof(my_action_combos[0]); i++) { + for (; i < ARRAY_SIZE(my_action_combos); i++) { key_combos[i].keys = &(my_action_combos[i][0]); } - for (uint8_t j = 0; j < sizeof(my_combos) / sizeof(my_combos[0]); j++, i++) { + for (uint8_t j = 0; j < ARRAY_SIZE(my_combos); j++, i++) { key_combos[i].keycode = my_combos[j][0]; key_combos[i].keys = &(my_combos[j][1]); } diff --git a/users/vitoni/rgb_matrix_effects.h b/users/vitoni/rgb_matrix_effects.h index ed74500b18..c3234b159b 100644 --- a/users/vitoni/rgb_matrix_effects.h +++ b/users/vitoni/rgb_matrix_effects.h @@ -22,7 +22,7 @@ enum states { #if defined(RGB_DISABLE_WITH_FADE_OUT) ,FADE_OUT //!< before supending #endif - ,SUSPENDED //!< expecting to be suspended by RGB_DISABLE_TIMEOUT any time + ,SUSPENDED //!< expecting to be suspended by RGB_MATRIX_TIMEOUT any time }; /** @@ -99,8 +99,8 @@ bool fade_in(const uint8_t time); #endif #if defined(RGB_DISABLE_WITH_FADE_OUT) -# if !defined(RGB_DISABLE_TIMEOUT) -# warning "RGB_DISABLE_WITH_FADE_OUT expects RGB_DISABLE_TIMEOUT to be defined" +# if !defined(RGB_MATRIX_TIMEOUT) +# warning "RGB_DISABLE_WITH_FADE_OUT expects RGB_MATRIX_TIMEOUT to be defined" # endif #endif diff --git a/users/vitoni/vitoni.c b/users/vitoni/vitoni.c index 2a0ff5c46f..f8cb50ea78 100644 --- a/users/vitoni/vitoni.c +++ b/users/vitoni/vitoni.c @@ -31,17 +31,17 @@ void matrix_scan_user_rgb(void) { #endif #if defined(RGB_DISABLE_WITH_FADE_OUT) const uint32_t fade_out_duration = scale_2_rgb_time(128); - const uint32_t start_fade_out_after_millis = (RGB_DISABLE_TIMEOUT) > fade_out_duration - ? (RGB_DISABLE_TIMEOUT) - fade_out_duration + const uint32_t start_fade_out_after_millis = (RGB_MATRIX_TIMEOUT) > fade_out_duration + ? (RGB_MATRIX_TIMEOUT) - fade_out_duration : 0; if (start_fade_out_after_millis <= inactivity_millis) { update_value(&state, FADE_OUT, &calc_offset); } -#elif defined(RGB_DISABLE_TIMEOUT) +#elif defined(RGB_MATRIX_TIMEOUT) // having to set brightness "manually" to black as starting point for fade in // for the time when returning from suspended state - if (RGB_DISABLE_TIMEOUT <= inactivity_millis + 15) { + if (RGB_MATRIX_TIMEOUT <= inactivity_millis + 15) { rgb_matrix_config.hsv.v = 0; state = SUSPENDED; } diff --git a/users/xtonhasvim/xtonhasvim.c b/users/xtonhasvim/xtonhasvim.c index 5f6701830f..1bb5781c47 100644 --- a/users/xtonhasvim/xtonhasvim.c +++ b/users/xtonhasvim/xtonhasvim.c @@ -108,7 +108,7 @@ static void comma_period(uint16_t keycode) { case VIM_COMMA: if (SHIFTED) { // indent - CMD(KC_LBRACKET); + CMD(KC_LEFT_BRACKET); } else { // toggle comment CMD(KC_SLASH); @@ -117,7 +117,7 @@ static void comma_period(uint16_t keycode) { case VIM_PERIOD: if (SHIFTED) { // outdent - CMD(KC_RBRACKET); + CMD(KC_RIGHT_BRACKET); } break; } diff --git a/users/xulkal/config.h b/users/xulkal/config.h index 88e3efbe72..7f7782807e 100644 --- a/users/xulkal/config.h +++ b/users/xulkal/config.h @@ -31,5 +31,5 @@ #undef ENABLE_RGB_MATRIX_SOLID_SPLASH // 20m timeout (20m * 60s * 1000mil) -#define RGB_DISABLE_TIMEOUT 1200000 +#define RGB_MATRIX_TIMEOUT 1200000 #define OLED_SCROLL_TIMEOUT 20000 diff --git a/users/xulkal/custom_tap_dance.c b/users/xulkal/custom_tap_dance.c index 2c5d145f1b..bcbfb577bb 100644 --- a/users/xulkal/custom_tap_dance.c +++ b/users/xulkal/custom_tap_dance.c @@ -6,7 +6,7 @@ //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { [COMM_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUOT), - [BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BSPACE, LCTL(KC_BSPACE)), + [BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BACKSPACE, LCTL(KC_BACKSPACE)), [DELETE] = ACTION_TAP_DANCE_DOUBLE (KC_DELETE, LCTL(KC_DELETE)) }; @@ -17,7 +17,7 @@ static uint16_t td_timer; const uint16_t PROGMEM td_keymaps[TD_MAX - TD_MIN][2] = { [TD_COMM - TD_MIN] = { KC_COMM, KC_QUOT }, - [TD_BSPC - TD_MIN] = { KC_BSPACE, LCTL(KC_BSPACE) }, + [TD_BSPC - TD_MIN] = { KC_BACKSPACE, LCTL(KC_BACKSPACE) }, [TD_DEL - TD_MIN] = { KC_DELETE, LCTL(KC_DELETE) } }; diff --git a/users/xulkal/layouts.h b/users/xulkal/layouts.h index 63e73c32e6..41861a5958 100644 --- a/users/xulkal/layouts.h +++ b/users/xulkal/layouts.h @@ -62,7 +62,7 @@ #define __________________RAISE_R1_________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 #define __________________RAISE_R2_________________ _______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, _______ -#define __________________RAISE_R3_________________ _______, KC_DEL, KC_END, KC_PGDN, KC_SLCK, _______ +#define __________________RAISE_R3_________________ _______, KC_DEL, KC_END, KC_PGDN, KC_SCRL, _______ #define __________________RAISE_R4_________________ _______, _______, _______, _______, _______, _______ #define __________________RAISE_R5_________________ _______, KC_MPRV, KC_VOLU, KC_VOLD, KC_MNXT, KC_MPLY @@ -86,7 +86,7 @@ #define __________________LOWER_L4_________________ _______, _______, _______, _______, _______, _______ #define __________________LOWER_L5_________________ _______, _______, _______, _______, _______, _______ -#define __________________LOWER_R1_________________ _______, _______, _______, KC_SLCK, KC_NLCK, KC_DEL +#define __________________LOWER_R1_________________ _______, _______, _______, KC_SCRL, KC_NUM, KC_DEL #define __________________LOWER_R2_________________ _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, _______ #define __________________LOWER_R3_________________ _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, _______ #define __________________LOWER_R4_________________ _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, _______ @@ -96,7 +96,7 @@ * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | RESET| DEBUG| | | | | |TERM_ON|TERM_OFF| | | | + * | | RESET| DEBUG| | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | |MusMod|Aud on|AudOff|AGnorm| |AGswap|ClkUp |ClkDwn| | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -113,7 +113,7 @@ #define _________________ADJUST_L5_________________ _______, _______, _______, _______, _______, _______ #define _________________ADJUST_R1_________________ _______, _______, _______, _______, _______, _______ -#define _________________ADJUST_R2_________________ _______, TERM_ON, TERM_OFF, _______, _______, _______ +#define _________________ADJUST_R2_________________ _______, _______, _______, _______, _______, _______ #define _________________ADJUST_R3_________________ AG_SWAP, CK_UP, CK_DOWN, _______, _______, _______ #define _________________ADJUST_R4_________________ MI_OFF, CK_ON, CK_OFF, _______, _______, _______ #define _________________ADJUST_R5_________________ _______, _______, _______, _______, _______, _______ diff --git a/users/yanfali/config.h b/users/yanfali/config.h index a39e95c9dd..fa5ec42c09 100644 --- a/users/yanfali/config.h +++ b/users/yanfali/config.h @@ -14,7 +14,16 @@ #undef RGBLED_NUM #define RGBLED_NUM 20 -#undef RGBLIGHT_ANIMATIONS +#undef RGBLIGHT_EFFECT_BREATHING +#undef RGBLIGHT_EFFECT_RAINBOW_MOOD +#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#undef RGBLIGHT_EFFECT_SNAKE +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +#undef RGBLIGHT_EFFECT_RGB_TEST +#undef RGBLIGHT_EFFECT_ALTERNATING +#undef RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_EFFECT_RAINBOW_MOOD #define RGBLIGHT_EFFECT_RAINBOW_SWIRL diff --git a/users/zigotica/combos.c b/users/zigotica/combos.c index 8fb5b3c9fc..a4d4f15618 100644 --- a/users/zigotica/combos.c +++ b/users/zigotica/combos.c @@ -25,7 +25,7 @@ const uint16_t PROGMEM caps_combo[] = {KC_C, KC_L, COMBO_END}; combo_t key_combos[] = { [EM_EMAIL] = COMBO_ACTION(email_combo), - [CL_CAPSL] = COMBO(caps_combo, KC_CAPSLOCK), + [CL_CAPSL] = COMBO(caps_combo, KC_CAPS), }; void process_combo_event(uint16_t combo_index, bool pressed) { diff --git a/users/zigotica/tapdances.c b/users/zigotica/tapdances.c index 74bb1b605e..06015fc64d 100644 --- a/users/zigotica/tapdances.c +++ b/users/zigotica/tapdances.c @@ -27,7 +27,7 @@ void ios_media(qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_action_t tap_dance_actions[] = { [0] = ACTION_TAP_DANCE_FN(ios_media), - [1] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_SCOLON), + [1] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_SCLN), [2] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COLON), [3] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC), [4] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_RPRN), |