From 4a87af0e9af046d5fc00d930476920c0c34a57a7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 29 Nov 2022 11:43:42 -0800 Subject: [Keymap] Drashna updates for 0.19 (#19175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix up bastardkb boards since blackpill support is officially added. * Check for blackpill version, not elite c. * Add checks in chibiOS config since multiple ARM controllers supported. * Rework rules.mk for keymaps to better handle arm vs avr support * Start moving away from `matrix_*_*` functions. * `housekeeping_task_*` instead of `matrix_scan_*` * `keyboard_(pre|post)_init_*` instead of `matrix_init_*` * Add ℂℴmⅈℂ unicode input method. * Clean up unicode code to be more compact and flexible. * Remove/move Pro Micro LED commands to userspace and better filter them * Fixup OLED code * Use newer quantum keycode functions/preprocessors rather than manual bit manipulation * Make unicode mode render much more compact/simple. * Make qmk secrets more self contained * Remove custom implementation of split watchdog --- users/drashna/drashna.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'users/drashna/drashna.c') diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index d63f05b590..283e82d13d 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -130,14 +130,35 @@ void keyboard_post_init_i2c(void) { } #endif -#if defined(AUTOCORRECT_ENABLE) && defined(AUDIO_ENABLE) -# ifdef USER_SONG_LIST +#if defined(AUTOCORRECT_ENABLE) +# if defined(AUDIO_ENABLE) +# ifdef USER_SONG_LIST float autocorrect_song[][2] = SONG(MARIO_GAMEOVER); -# else +# else float autocorrect_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +# endif # endif + bool apply_autocorrect(uint8_t backspaces, const char *str) { + if (layer_state_is(_GAMEPAD)) { + return false; + } + // TO-DO use unicode stuff for this. Will probably have to reverse engineer + // send string to get working properly, to send char string. + +# if defined(AUDIO_ENABLE) PLAY_SONG(autocorrect_song); +# endif return true; } #endif + +#if defined(CAPS_WORD_ENABLE) && !defined(NO_ACTION_ONESHOT) +void oneshot_locked_mods_changed_user(uint8_t mods) { + if (mods & MOD_MASK_SHIFT) { + del_mods(MOD_MASK_SHIFT); + set_oneshot_locked_mods(~MOD_MASK_SHIFT & get_oneshot_locked_mods()); + caps_word_on(); + } +} +#endif -- cgit v1.2.3