Merge remote-tracking branch 'qmk/master' into merge-2023-03-12
This commit is contained in:
@ -17,7 +17,6 @@
|
||||
#ifdef AUTO_SHIFT_ENABLE
|
||||
|
||||
# include <stdbool.h>
|
||||
# include <stdio.h>
|
||||
# include "process_auto_shift.h"
|
||||
# include "qmk_settings.h"
|
||||
|
||||
@ -332,11 +331,12 @@ void autoshift_disable(void) {
|
||||
# ifndef AUTO_SHIFT_NO_SETUP
|
||||
void autoshift_timer_report(void) {
|
||||
# ifdef SEND_STRING_ENABLE
|
||||
char display[8];
|
||||
|
||||
snprintf(display, 8, "\n%d\n", autoshift_timeout);
|
||||
|
||||
send_string((const char *)display);
|
||||
const char *autoshift_timeout_str = get_u16_str(autoshift_timeout, ' ');
|
||||
// Skip padding spaces
|
||||
while (*autoshift_timeout_str == ' ') {
|
||||
autoshift_timeout_str++;
|
||||
}
|
||||
send_string(autoshift_timeout_str);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
@ -345,7 +345,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) {
|
||||
@ -377,30 +377,39 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
case KC_ASTG:
|
||||
case AS_TOGG:
|
||||
autoshift_toggle();
|
||||
break;
|
||||
case KC_ASON:
|
||||
case AS_ON:
|
||||
autoshift_enable();
|
||||
break;
|
||||
case KC_ASOFF:
|
||||
case AS_OFF:
|
||||
autoshift_disable();
|
||||
break;
|
||||
|
||||
# ifndef AUTO_SHIFT_NO_SETUP
|
||||
case KC_ASUP:
|
||||
case AS_UP:
|
||||
autoshift_timeout += 5;
|
||||
break;
|
||||
case KC_ASDN:
|
||||
case AS_DOWN:
|
||||
autoshift_timeout -= 5;
|
||||
break;
|
||||
case KC_ASRP:
|
||||
case AS_RPT:
|
||||
autoshift_timer_report();
|
||||
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.
|
||||
@ -409,27 +418,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
|
||||
@ -456,10 +445,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);
|
||||
@ -497,7 +486,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;
|
||||
|
Reference in New Issue
Block a user