Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
QMK Bot 2023-06-04 01:12:08 +00:00
commit 1e2b75a886
3 changed files with 21 additions and 2 deletions

View File

@ -20,8 +20,8 @@
"caps_lock": "B9", "caps_lock": "B9",
"on_state": 0 "on_state": 0
}, },
"diode_direction": "COL2ROW",
"rgblight": { "rgblight": {
"pin": "A7",
"led_count": 24, "led_count": 24,
"sleep": true, "sleep": true,
"animations": { "animations": {
@ -38,6 +38,7 @@
} }
}, },
"ws2812": { "ws2812": {
"pin": "A7",
"driver": "spi" "driver": "spi"
}, },
"community_layouts": ["65_ansi_blocker_tsangan"], "community_layouts": ["65_ansi_blocker_tsangan"],

View File

@ -57,7 +57,7 @@ void autocorrect_toggle(void) {
} }
/** /**
* @brief handler for determining if autocorrect should process keypress * @brief handler for user to override whether autocorrect should process this keypress
* *
* @param keycode Keycode registered by matrix press, per keymap * @param keycode Keycode registered by matrix press, per keymap
* @param record keyrecord_t structure * @param record keyrecord_t structure
@ -67,6 +67,23 @@ void autocorrect_toggle(void) {
* @return false Stop processing and escape from autocorrect. * @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) { __attribute__((weak)) bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) {
return process_autocorrect_default_handler(keycode, record, typo_buffer_size, mods);
}
/**
* @brief fallback handler for determining if autocorrect should process this keypress
* can be used by user callback to get the basic keycode being "wrapped"
*
* NOTE: These values may have been edited by user callback before getting here
*
* @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.
*/
bool process_autocorrect_default_handler(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods) {
// See quantum_keycodes.h for reference on these matched ranges. // See quantum_keycodes.h for reference on these matched ranges.
switch (*keycode) { switch (*keycode) {
// Exclude these keycodes from processing. // Exclude these keycodes from processing.

View File

@ -9,6 +9,7 @@
bool process_autocorrect(uint16_t keycode, keyrecord_t *record); bool process_autocorrect(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 process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods);
bool process_autocorrect_default_handler(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods);
bool apply_autocorrect(uint8_t backspaces, const char *str); bool apply_autocorrect(uint8_t backspaces, const char *str);
bool autocorrect_is_enabled(void); bool autocorrect_is_enabled(void);