diff options
Diffstat (limited to 'quantum/process_keycode')
22 files changed, 255 insertions, 260 deletions
diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index 03b0af9277..c189dd02b7 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c @@ -62,5 +62,5 @@ void process_audio_all_notes_off(void) { stop_all_notes(); } -__attribute__((weak)) void audio_on_user() {} -__attribute__((weak)) void audio_off_user() {} +__attribute__((weak)) void audio_on_user(void) {} +__attribute__((weak)) void audio_off_user(void) {} diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index 35d4851ee5..aad1a164ae 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -344,7 +344,7 @@ bool get_autoshift_state(void) { return autoshift_flags.enabled; } -uint16_t get_generic_autoshift_timeout() { +uint16_t get_generic_autoshift_timeout(void) { return autoshift_timeout; } __attribute__((weak)) uint16_t get_autoshift_timeout(uint16_t keycode, keyrecord_t *record) { @@ -397,8 +397,17 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { break; # endif } - // If Retro Shift is disabled, possible custom actions shouldn't happen. - // clang-format off + // If Retro Shift is disabled, possible custom actions shouldn't happen. + // clang-format off +# if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) +# if defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) + const bool is_hold_on_interrupt = get_hold_on_other_key_press(keycode, record); +# elif defined(IGNORE_MOD_TAP_INTERRUPT) + const bool is_hold_on_interrupt = false; +# else + const bool is_hold_on_interrupt = IS_QK_MOD_TAP(keycode); +# endif +# endif if (IS_RETRO(keycode) # if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING) // Not tapped or #defines mean that rolls should use hold action. @@ -407,27 +416,7 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { # ifdef RETRO_TAPPING_PER_KEY || !get_retro_tapping(keycode, record) # endif - || (record->tap.interrupted && (IS_LT(keycode) -# if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) -# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY - ? get_hold_on_other_key_press(keycode, record) -# else - ? true -# endif -# else - ? false -# endif -# if defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) -# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - : !get_ignore_mod_tap_interrupt(keycode, record) -# else - : false -# endif -# else - : true -# endif - )) - ) + || (record->tap.interrupted && is_hold_on_interrupt)) # endif ) { // clang-format on @@ -454,10 +443,10 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { # endif ) { // Fixes modifiers not being applied to rolls with AUTO_SHIFT_MODIFIERS set. -# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) +# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) if (autoshift_flags.in_progress -# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY - && !get_ignore_mod_tap_interrupt(keycode, record) +# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY + && get_hold_on_other_key_press(keycode, record) # endif ) { autoshift_end(KC_NO, now, false, &autoshift_lastrecord); @@ -495,7 +484,7 @@ void retroshift_poll_time(keyevent_t *event) { retroshift_time = timer_read(); } // Used to swap the times of Retro Shifted key and Auto Shift key that interrupted it. -void retroshift_swap_times() { +void retroshift_swap_times(void) { if (last_retroshift_time != 0 && autoshift_flags.in_progress) { uint16_t temp = retroshift_time; retroshift_time = last_retroshift_time; diff --git a/quantum/process_keycode/process_auto_shift.h b/quantum/process_keycode/process_auto_shift.h index 86adb04985..66a4b3138a 100644 --- a/quantum/process_keycode/process_auto_shift.h +++ b/quantum/process_keycode/process_auto_shift.h @@ -22,9 +22,8 @@ # define AUTO_SHIFT_TIMEOUT 175 #endif -#define IS_LT(kc) ((kc) >= QK_LAYER_TAP && (kc) <= QK_LAYER_TAP_MAX) -#define IS_MT(kc) ((kc) >= QK_MOD_TAP && (kc) <= QK_MOD_TAP_MAX) -#define IS_RETRO(kc) (IS_MT(kc) || IS_LT(kc)) +#define IS_RETRO(kc) (IS_QK_MOD_TAP(kc) || IS_QK_LAYER_TAP(kc)) + #define DO_GET_AUTOSHIFT_TIMEOUT(keycode, record, ...) record // clang-format off #define AUTO_SHIFT_ALPHA KC_A ... KC_Z diff --git a/quantum/process_keycode/process_autocorrect.c b/quantum/process_keycode/process_autocorrect.c index 8aeebf0e06..1376788266 100644 --- a/quantum/process_keycode/process_autocorrect.c +++ b/quantum/process_keycode/process_autocorrect.c @@ -126,9 +126,13 @@ __attribute__((weak)) bool process_autocorrect_user(uint16_t *keycode, keyrecord // and mask for base keycode when they are tapped. case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: #ifdef SWAP_HANDS_ENABLE - // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TG, SH_TT, ..., + // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TOGG, SH_TT, ..., // which currently overlap the SH_T(kc) range. - if (IS_SWAP_HANDS_KEYCODE(*keycode) || !record->tap.count) { + if (IS_SWAP_HANDS_KEYCODE(*keycode) +# ifndef NO_ACTION_TAPPING + || !record->tap.count +# endif // NO_ACTION_TAPPING + ) { return false; } *keycode = QK_SWAP_HANDS_GET_TAP_KEYCODE(*keycode); diff --git a/quantum/process_keycode/process_caps_word.c b/quantum/process_keycode/process_caps_word.c index 4c0217eba7..94302b29ae 100644 --- a/quantum/process_keycode/process_caps_word.c +++ b/quantum/process_keycode/process_caps_word.c @@ -143,9 +143,13 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) { #ifdef SWAP_HANDS_ENABLE case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: - // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TG, SH_TT, ..., + // Note: IS_SWAP_HANDS_KEYCODE() actually tests for the special action keycodes like SH_TOGG, SH_TT, ..., // which currently overlap the SH_T(kc) range. - if (IS_SWAP_HANDS_KEYCODE(keycode) || record->tap.count == 0) { + if (IS_SWAP_HANDS_KEYCODE(keycode) +# ifndef NO_ACTION_TAPPING + || record->tap.count == 0 +# endif // NO_ACTION_TAPPING + ) { return true; } keycode = QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode); diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index d8b089db16..8597649c92 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c @@ -29,6 +29,12 @@ extern uint16_t COMBO_LEN; __attribute__((weak)) void process_combo_event(uint16_t combo_index, bool pressed) {} +#ifndef COMBO_ONLY_FROM_LAYER +__attribute__((weak)) uint8_t combo_ref_from_layer(uint8_t layer) { + return layer; +} +#endif + #ifdef COMBO_MUST_HOLD_PER_COMBO __attribute__((weak)) bool get_combo_must_hold(uint16_t index, combo_t *combo) { return false; @@ -304,7 +310,7 @@ void apply_combo(uint16_t combo_index, combo_t *combo) { #if defined(EXTRA_EXTRA_LONG_COMBOS) uint32_t state = 0; #elif defined(EXTRA_LONG_COMBOS) - uint16_t state = 0; + uint16_t state = 0; #else uint8_t state = 0; #endif @@ -549,6 +555,12 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) { #ifdef COMBO_ONLY_FROM_LAYER /* Only check keycodes from one layer. */ keycode = keymap_key_to_keycode(COMBO_ONLY_FROM_LAYER, record->event.key); +#else + uint8_t highest_layer = get_highest_layer(layer_state); + uint8_t ref_layer = combo_ref_from_layer(highest_layer); + if (ref_layer != highest_layer) { + keycode = keymap_key_to_keycode(ref_layer, record->event.key); + } #endif for (uint16_t idx = 0; idx < COMBO_LEN; ++idx) { diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h index 4c4e574e34..e430c4a5f7 100644 --- a/quantum/process_keycode/process_combo.h +++ b/quantum/process_keycode/process_combo.h @@ -69,7 +69,7 @@ typedef struct { #endif /* check if keycode is only modifiers */ -#define KEYCODE_IS_MOD(code) (IS_MOD(code) || (code >= QK_MODS && code <= QK_MODS_MAX && !(code & QK_BASIC_MAX))) +#define KEYCODE_IS_MOD(code) (IS_MODIFIER_KEYCODE(code) || (IS_QK_MODS(code) && !QK_MODS_GET_BASIC_KEYCODE(code))) bool process_combo(uint16_t keycode, keyrecord_t *record); void combo_task(void); diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c index 9c5abccd4f..17e490e67a 100644 --- a/quantum/process_keycode/process_key_override.c +++ b/quantum/process_keycode/process_key_override.c @@ -186,7 +186,7 @@ const key_override_t *clear_active_override(const bool allow_reregister) { // Then unregister the mod-free replacement key if desired if (unregister_replacement) { - if (IS_KEY(mod_free_replacement)) { + if (IS_BASIC_KEYCODE(mod_free_replacement)) { del_key(mod_free_replacement); } else { key_override_printf("NOT KEY 1\n"); @@ -329,7 +329,7 @@ static bool try_activating_override(const uint16_t keycode, const uint8_t layer, if (!trigger_down && !no_trigger) { // When activating a key override the trigger is is always unregistered. In the case where the key that newly pressed is not the trigger key, we have to explicitly remove the trigger key from the keyboard report. If the trigger was just pressed down we simply suppress the event which also has the effect of the trigger key not being registered in the keyboard report. - if (IS_KEY(override->trigger)) { + if (IS_BASIC_KEYCODE(override->trigger)) { del_key(override->trigger); } else { unregister_code(override->trigger); @@ -356,7 +356,7 @@ static bool try_activating_override(const uint16_t keycode, const uint8_t layer, schedule_deferred_register(mod_free_replacement); send_keyboard_report(); } else { - if (IS_KEY(mod_free_replacement)) { + if (IS_BASIC_KEYCODE(mod_free_replacement)) { add_key(mod_free_replacement); } else { key_override_printf("NOT KEY 2\n"); @@ -402,7 +402,7 @@ bool process_key_override(const uint16_t keycode, const keyrecord_t *const recor #endif const bool key_down = record->event.pressed; - const bool is_mod = IS_MOD(keycode); + const bool is_mod = IS_MODIFIER_KEYCODE(keycode); if (key_down) { switch (keycode) { diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index b74b4927a8..a9823b6285 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -14,72 +14,35 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef LEADER_ENABLE - -# include "process_leader.h" -# include <string.h> - -# ifndef LEADER_TIMEOUT -# define LEADER_TIMEOUT 300 -# endif - -__attribute__((weak)) void leader_start(void) {} - -__attribute__((weak)) void leader_end(void) {} - -// Leader key stuff -bool leading = false; -uint16_t leader_time = 0; - -uint16_t leader_sequence[5] = {0, 0, 0, 0, 0}; -uint8_t leader_sequence_size = 0; - -void qk_leader_start(void) { - if (leading) { - return; - } - leader_start(); - leading = true; - leader_time = timer_read(); - leader_sequence_size = 0; - memset(leader_sequence, 0, sizeof(leader_sequence)); -} +#include "process_leader.h" +#include "leader.h" bool process_leader(uint16_t keycode, keyrecord_t *record) { - // Leader key set-up if (record->event.pressed) { - if (leading) { -# ifndef LEADER_NO_TIMEOUT - if (timer_elapsed(leader_time) < LEADER_TIMEOUT) -# endif // LEADER_NO_TIMEOUT - { -# ifndef LEADER_KEY_STRICT_KEY_PROCESSING - if (IS_QK_MOD_TAP(keycode)) { - keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); - } else if (IS_QK_LAYER_TAP(keycode)) { - keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); - } -# endif // LEADER_KEY_STRICT_KEY_PROCESSING - if (leader_sequence_size < ARRAY_SIZE(leader_sequence)) { - leader_sequence[leader_sequence_size] = keycode; - leader_sequence_size++; - } else { - leading = false; - leader_end(); - return true; - } -# ifdef LEADER_PER_KEY_TIMING - leader_time = timer_read(); -# endif - return false; + if (leader_sequence_active() && !leader_sequence_timed_out()) { +#ifndef LEADER_KEY_STRICT_KEY_PROCESSING + if (IS_QK_MOD_TAP(keycode)) { + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + } else if (IS_QK_LAYER_TAP(keycode)) { + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); } - } else { - if (keycode == QK_LEADER) { - qk_leader_start(); +#endif + + if (!leader_sequence_add(keycode)) { + leader_end(); + + return true; } + +#ifdef LEADER_PER_KEY_TIMING + leader_reset_timer(); +#endif + + return false; + } else if (keycode == QK_LEADER) { + leader_start(); } } + return true; } - -#endif diff --git a/quantum/process_keycode/process_leader.h b/quantum/process_keycode/process_leader.h index f3fe14a432..eb0f721f60 100644 --- a/quantum/process_keycode/process_leader.h +++ b/quantum/process_keycode/process_leader.h @@ -19,25 +19,3 @@ #include "quantum.h" bool process_leader(uint16_t keycode, keyrecord_t *record); - -void leader_start(void); -void leader_end(void); -void qk_leader_start(void); - -#define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) -#define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) -#define SEQ_THREE_KEYS(key1, key2, key3) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == 0 && leader_sequence[4] == 0) -#define SEQ_FOUR_KEYS(key1, key2, key3, key4) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == (key4) && leader_sequence[4] == 0) -#define SEQ_FIVE_KEYS(key1, key2, key3, key4, key5) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == (key4) && leader_sequence[4] == (key5)) - -#define LEADER_EXTERNS() \ - extern bool leading; \ - extern uint16_t leader_time; \ - extern uint16_t leader_sequence[5]; \ - extern uint8_t leader_sequence_size - -#ifdef LEADER_NO_TIMEOUT -# define LEADER_DICTIONARY() if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT) -#else -# define LEADER_DICTIONARY() if (leading && timer_elapsed(leader_time) > LEADER_TIMEOUT) -#endif diff --git a/quantum/process_keycode/process_magic.c b/quantum/process_keycode/process_magic.c index 72332b20d7..5fafe8550f 100644 --- a/quantum/process_keycode/process_magic.c +++ b/quantum/process_keycode/process_magic.c @@ -44,99 +44,99 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { /* keymap config */ keymap_config.raw = eeconfig_read_keymap(); switch (keycode) { - case MAGIC_SWAP_CONTROL_CAPSLOCK: + case QK_MAGIC_SWAP_CONTROL_CAPS_LOCK: keymap_config.swap_control_capslock = true; break; - case MAGIC_SWAP_ESCAPE_CAPSLOCK: + case QK_MAGIC_SWAP_ESCAPE_CAPS_LOCK: keymap_config.swap_escape_capslock = true; break; - case MAGIC_CAPSLOCK_TO_CONTROL: + case QK_MAGIC_CAPS_LOCK_AS_CONTROL_ON: keymap_config.capslock_to_control = true; break; - case MAGIC_SWAP_LALT_LGUI: + case QK_MAGIC_SWAP_LALT_LGUI: keymap_config.swap_lalt_lgui = true; break; - case MAGIC_SWAP_RALT_RGUI: + case QK_MAGIC_SWAP_RALT_RGUI: keymap_config.swap_ralt_rgui = true; break; - case MAGIC_SWAP_LCTL_LGUI: + case QK_MAGIC_SWAP_LCTL_LGUI: keymap_config.swap_lctl_lgui = true; break; - case MAGIC_SWAP_RCTL_RGUI: + case QK_MAGIC_SWAP_RCTL_RGUI: keymap_config.swap_rctl_rgui = true; break; - case MAGIC_NO_GUI: + case QK_MAGIC_GUI_OFF: keymap_config.no_gui = true; break; - case MAGIC_SWAP_GRAVE_ESC: + case QK_MAGIC_SWAP_GRAVE_ESC: keymap_config.swap_grave_esc = true; break; - case MAGIC_SWAP_BACKSLASH_BACKSPACE: + case QK_MAGIC_SWAP_BACKSLASH_BACKSPACE: keymap_config.swap_backslash_backspace = true; break; - case MAGIC_HOST_NKRO: + case QK_MAGIC_NKRO_ON: clear_keyboard(); // clear first buffer to prevent stuck keys keymap_config.nkro = true; break; - case MAGIC_SWAP_ALT_GUI: + case QK_MAGIC_SWAP_ALT_GUI: keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = true; #ifdef AUDIO_ENABLE PLAY_SONG(ag_swap_song); #endif break; - case MAGIC_SWAP_CTL_GUI: + case QK_MAGIC_SWAP_CTL_GUI: keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = true; #ifdef AUDIO_ENABLE PLAY_SONG(cg_swap_song); #endif break; - case MAGIC_UNSWAP_CONTROL_CAPSLOCK: + case QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK: keymap_config.swap_control_capslock = false; break; - case MAGIC_UNSWAP_ESCAPE_CAPSLOCK: + case QK_MAGIC_UNSWAP_ESCAPE_CAPS_LOCK: keymap_config.swap_escape_capslock = false; break; - case MAGIC_UNCAPSLOCK_TO_CONTROL: + case QK_MAGIC_CAPS_LOCK_AS_CONTROL_OFF: keymap_config.capslock_to_control = false; break; - case MAGIC_UNSWAP_LALT_LGUI: + case QK_MAGIC_UNSWAP_LALT_LGUI: keymap_config.swap_lalt_lgui = false; break; - case MAGIC_UNSWAP_RALT_RGUI: + case QK_MAGIC_UNSWAP_RALT_RGUI: keymap_config.swap_ralt_rgui = false; break; - case MAGIC_UNSWAP_LCTL_LGUI: + case QK_MAGIC_UNSWAP_LCTL_LGUI: keymap_config.swap_lctl_lgui = false; break; - case MAGIC_UNSWAP_RCTL_RGUI: + case QK_MAGIC_UNSWAP_RCTL_RGUI: keymap_config.swap_rctl_rgui = false; break; - case MAGIC_UNNO_GUI: + case QK_MAGIC_GUI_ON: keymap_config.no_gui = false; break; - case MAGIC_UNSWAP_GRAVE_ESC: + case QK_MAGIC_UNSWAP_GRAVE_ESC: keymap_config.swap_grave_esc = false; break; - case MAGIC_UNSWAP_BACKSLASH_BACKSPACE: + case QK_MAGIC_UNSWAP_BACKSLASH_BACKSPACE: keymap_config.swap_backslash_backspace = false; break; - case MAGIC_UNHOST_NKRO: + case QK_MAGIC_NKRO_OFF: clear_keyboard(); // clear first buffer to prevent stuck keys keymap_config.nkro = false; break; - case MAGIC_UNSWAP_ALT_GUI: + case QK_MAGIC_UNSWAP_ALT_GUI: keymap_config.swap_lalt_lgui = keymap_config.swap_ralt_rgui = false; #ifdef AUDIO_ENABLE PLAY_SONG(ag_norm_song); #endif break; - case MAGIC_UNSWAP_CTL_GUI: + case QK_MAGIC_UNSWAP_CTL_GUI: keymap_config.swap_lctl_lgui = keymap_config.swap_rctl_rgui = false; #ifdef AUDIO_ENABLE PLAY_SONG(cg_norm_song); #endif break; - case MAGIC_TOGGLE_ALT_GUI: + case QK_MAGIC_TOGGLE_ALT_GUI: keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; keymap_config.swap_ralt_rgui = keymap_config.swap_lalt_lgui; #ifdef AUDIO_ENABLE @@ -147,7 +147,7 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { } #endif break; - case MAGIC_TOGGLE_CTL_GUI: + case QK_MAGIC_TOGGLE_CTL_GUI: keymap_config.swap_lctl_lgui = !keymap_config.swap_lctl_lgui; keymap_config.swap_rctl_rgui = keymap_config.swap_lctl_lgui; #ifdef AUDIO_ENABLE @@ -158,26 +158,26 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) { } #endif break; - case MAGIC_TOGGLE_BACKSLASH_BACKSPACE: + case QK_MAGIC_TOGGLE_BACKSLASH_BACKSPACE: keymap_config.swap_backslash_backspace = !keymap_config.swap_backslash_backspace; break; - case MAGIC_TOGGLE_NKRO: + case QK_MAGIC_TOGGLE_NKRO: clear_keyboard(); // clear first buffer to prevent stuck keys keymap_config.nkro = !keymap_config.nkro; break; - case MAGIC_EE_HANDS_LEFT: + case QK_MAGIC_EE_HANDS_LEFT: eeconfig_update_handedness(true); break; - case MAGIC_EE_HANDS_RIGHT: + case QK_MAGIC_EE_HANDS_RIGHT: eeconfig_update_handedness(false); break; - case MAGIC_TOGGLE_GUI: + case QK_MAGIC_TOGGLE_GUI: keymap_config.no_gui = !keymap_config.no_gui; break; - case MAGIC_TOGGLE_CONTROL_CAPSLOCK: + case QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK: keymap_config.swap_control_capslock = !keymap_config.swap_control_capslock; break; - case MAGIC_TOGGLE_ESCAPE_CAPSLOCK: + case QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK: keymap_config.swap_escape_capslock = !keymap_config.swap_escape_capslock; break; } diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index ee697a0cc6..7c572079a7 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -317,10 +317,10 @@ void music_task(void) { } } -__attribute__((weak)) void music_on_user() {} +__attribute__((weak)) void music_on_user(void) {} -__attribute__((weak)) void midi_on_user() {} +__attribute__((weak)) void midi_on_user(void) {} -__attribute__((weak)) void music_scale_user() {} +__attribute__((weak)) void music_scale_user(void) {} #endif // defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) diff --git a/quantum/process_keycode/process_sequencer.c b/quantum/process_keycode/process_sequencer.c index 334b4c0092..6391d1ba9d 100644 --- a/quantum/process_keycode/process_sequencer.c +++ b/quantum/process_keycode/process_sequencer.c @@ -19,39 +19,39 @@ bool process_sequencer(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { - case SQ_ON: + case QK_SEQUENCER_ON: sequencer_on(); return false; - case SQ_OFF: + case QK_SEQUENCER_OFF: sequencer_off(); return false; - case SQ_TOG: + case QK_SEQUENCER_TOGGLE: sequencer_toggle(); return false; - case SQ_TMPD: + case QK_SEQUENCER_TEMPO_DOWN: sequencer_decrease_tempo(); return false; - case SQ_TMPU: + case QK_SEQUENCER_TEMPO_UP: sequencer_increase_tempo(); return false; - case SEQUENCER_RESOLUTION_MIN ... SEQUENCER_RESOLUTION_MAX: - sequencer_set_resolution(keycode - SEQUENCER_RESOLUTION_MIN); - return false; - case SQ_RESD: + case QK_SEQUENCER_RESOLUTION_DOWN: sequencer_decrease_resolution(); return false; - case SQ_RESU: + case QK_SEQUENCER_RESOLUTION_UP: sequencer_increase_resolution(); return false; - case SQ_SALL: + case QK_SEQUENCER_STEPS_ALL: sequencer_set_all_steps_on(); return false; - case SQ_SCLR: + case QK_SEQUENCER_STEPS_CLEAR: sequencer_set_all_steps_off(); return false; case SEQUENCER_STEP_MIN ... SEQUENCER_STEP_MAX: sequencer_toggle_step(keycode - SEQUENCER_STEP_MIN); return false; + case SEQUENCER_RESOLUTION_MIN ... SEQUENCER_RESOLUTION_MAX: + sequencer_set_resolution(keycode - SEQUENCER_RESOLUTION_MIN); + return false; case SEQUENCER_TRACK_MIN ... SEQUENCER_TRACK_MAX: sequencer_toggle_single_active_track(keycode - SEQUENCER_TRACK_MIN); return false; diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c index a62cd60a70..3109ea1711 100644 --- a/quantum/process_keycode/process_space_cadet.c +++ b/quantum/process_keycode/process_space_cadet.c @@ -89,16 +89,16 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM #ifdef SPACE_CADET_MODIFIER_CARRYOVER sc_mods = get_mods(); #endif - if (IS_MOD(holdMod)) { + if (IS_MODIFIER_KEYCODE(holdMod)) { register_mods(MOD_BIT(holdMod)); } } else { if (sc_last == holdMod && timer_elapsed(sc_timer) < GET_TAPPING_TERM(sc_keycode, record)) { if (holdMod != tapMod) { - if (IS_MOD(holdMod)) { + if (IS_MODIFIER_KEYCODE(holdMod)) { unregister_mods(MOD_BIT(holdMod)); } - if (IS_MOD(tapMod)) { + if (IS_MODIFIER_KEYCODE(tapMod)) { register_mods(MOD_BIT(tapMod)); } } @@ -109,11 +109,11 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM #ifdef SPACE_CADET_MODIFIER_CARRYOVER clear_weak_mods(); #endif - if (IS_MOD(tapMod)) { + if (IS_MODIFIER_KEYCODE(tapMod)) { unregister_mods(MOD_BIT(tapMod)); } } else { - if (IS_MOD(holdMod)) { + if (IS_MODIFIER_KEYCODE(holdMod)) { unregister_mods(MOD_BIT(holdMod)); } } diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c index 30a0d4056f..8ba98bd4bb 100644 --- a/quantum/process_keycode/process_steno.c +++ b/quantum/process_keycode/process_steno.c @@ -127,7 +127,7 @@ static const uint16_t combinedmap_second[] PROGMEM = {STN_S2, STN_KL, STN_WL, ST #endif #ifdef STENO_ENABLE_ALL -void steno_init() { +void steno_init(void) { if (!eeconfig_is_enabled()) { eeconfig_init(); } diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 6e8e596673..706f5cddbb 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -18,8 +18,8 @@ static uint16_t active_td; static uint16_t last_tap_time; -void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; +void tap_dance_pair_on_each_tap(tap_dance_state_t *state, void *user_data) { + tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data; if (state->count == 2) { register_code16(pair->kc2); @@ -27,14 +27,14 @@ void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) } } -void qk_tap_dance_pair_finished(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; +void tap_dance_pair_finished(tap_dance_state_t *state, void *user_data) { + tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data; register_code16(pair->kc1); } -void qk_tap_dance_pair_reset(qk_tap_dance_state_t *state, v |