Merge remote-tracking branch 'qmk/master' into merge-2023-03-12
This commit is contained in:
commit
06a2fdcc9c
19466 changed files with 296791 additions and 222541 deletions
|
|
@ -82,7 +82,7 @@ void do_code16(uint16_t code, void (*f)(uint8_t)) {
|
|||
}
|
||||
|
||||
__attribute__((weak)) void register_code16(uint16_t code) {
|
||||
if (IS_MOD(code) || code == KC_NO) {
|
||||
if (IS_MODIFIER_KEYCODE(code) || code == KC_NO) {
|
||||
do_code16(code, register_mods);
|
||||
} else {
|
||||
do_code16(code, register_weak_mods);
|
||||
|
|
@ -92,7 +92,7 @@ __attribute__((weak)) void register_code16(uint16_t code) {
|
|||
|
||||
__attribute__((weak)) void unregister_code16(uint16_t code) {
|
||||
unregister_code(code);
|
||||
if (IS_MOD(code) || code == KC_NO) {
|
||||
if (IS_MODIFIER_KEYCODE(code) || code == KC_NO) {
|
||||
do_code16(code, unregister_mods);
|
||||
} else {
|
||||
do_code16(code, unregister_weak_mods);
|
||||
|
|
@ -233,7 +233,7 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||
ACTIONs. */
|
||||
bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
||||
// This is how you use actions here
|
||||
// if (keycode == KC_LEAD) {
|
||||
// if (keycode == QK_LEADER) {
|
||||
// action_t action;
|
||||
// action.code = ACTION_DEFAULT_LAYER_SET(0);
|
||||
// process_action(record, action);
|
||||
|
|
@ -246,6 +246,14 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
if (preprocess_tap_dance(keycode, record)) {
|
||||
// The tap dance might have updated the layer state, therefore the
|
||||
// result of the keycode lookup might change.
|
||||
keycode = get_record_keycode(record, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
if (velocikey_enabled() && record->event.pressed) {
|
||||
velocikey_accelerate();
|
||||
|
|
@ -258,10 +266,6 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
preprocess_tap_dance(keycode, record);
|
||||
#endif
|
||||
|
||||
if (!(
|
||||
#if defined(KEY_LOCK_ENABLE)
|
||||
// Must run first to be able to mask key_up events.
|
||||
|
|
@ -282,6 +286,9 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
#endif
|
||||
#if defined(VIAL_ENABLE)
|
||||
process_record_vial(keycode, record) &&
|
||||
#endif
|
||||
#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE)
|
||||
process_auto_mouse(keycode, record) &&
|
||||
#endif
|
||||
process_record_kb(keycode, record) &&
|
||||
#if defined(SECURE_ENABLE)
|
||||
|
|
@ -320,9 +327,6 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
#ifdef LEADER_ENABLE
|
||||
process_leader(keycode, record) &&
|
||||
#endif
|
||||
#ifdef PRINTING_ENABLE
|
||||
process_printer(keycode, record) &&
|
||||
#endif
|
||||
#ifdef AUTO_SHIFT_ENABLE
|
||||
process_auto_shift(keycode, record) &&
|
||||
#endif
|
||||
|
|
@ -346,6 +350,12 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
#endif
|
||||
#ifdef PROGRAMMABLE_BUTTON_ENABLE
|
||||
process_programmable_button(keycode, record) &&
|
||||
#endif
|
||||
#ifdef AUTOCORRECT_ENABLE
|
||||
process_autocorrect(keycode, record) &&
|
||||
#endif
|
||||
#ifdef TRI_LAYER_ENABLE
|
||||
process_tri_layer(keycode, record) &&
|
||||
#endif
|
||||
true)) {
|
||||
return false;
|
||||
|
|
@ -372,35 +382,37 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
#endif
|
||||
return false;
|
||||
case QK_CLEAR_EEPROM:
|
||||
#ifdef NO_RESET
|
||||
eeconfig_init();
|
||||
#ifndef NO_RESET
|
||||
#else
|
||||
eeconfig_disable();
|
||||
soft_reset_keyboard();
|
||||
#endif
|
||||
return false;
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
case VLK_TOG:
|
||||
case QK_VELOCIKEY_TOGGLE:
|
||||
velocikey_toggle();
|
||||
return false;
|
||||
#endif
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
case OUT_AUTO:
|
||||
case QK_OUTPUT_AUTO:
|
||||
set_output(OUTPUT_AUTO);
|
||||
return false;
|
||||
case OUT_USB:
|
||||
case QK_OUTPUT_USB:
|
||||
set_output(OUTPUT_USB);
|
||||
return false;
|
||||
case OUT_BT:
|
||||
case QK_OUTPUT_BLUETOOTH:
|
||||
set_output(OUTPUT_BLUETOOTH);
|
||||
return false;
|
||||
#endif
|
||||
#ifndef NO_ACTION_ONESHOT
|
||||
case ONESHOT_TOGGLE:
|
||||
case QK_ONE_SHOT_TOGGLE:
|
||||
oneshot_toggle();
|
||||
break;
|
||||
case ONESHOT_ENABLE:
|
||||
case QK_ONE_SHOT_ON:
|
||||
oneshot_enable();
|
||||
break;
|
||||
case ONESHOT_DISABLE:
|
||||
case QK_ONE_SHOT_OFF:
|
||||
oneshot_disable();
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -421,7 +433,11 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
} else {
|
||||
SEND_STRING_DELAY(" compile ", TAP_CODE_DELAY);
|
||||
}
|
||||
# if defined(CONVERTER_ENABLED)
|
||||
SEND_STRING_DELAY("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP " -e CONVERT_TO=" CONVERTER_TARGET SS_TAP(X_ENTER), TAP_CODE_DELAY);
|
||||
# else
|
||||
SEND_STRING_DELAY("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP SS_TAP(X_ENTER), TAP_CODE_DELAY);
|
||||
# endif
|
||||
if (temp_mod & MOD_MASK_SHIFT && temp_mod & MOD_MASK_CTRL) {
|
||||
reset_keyboard();
|
||||
}
|
||||
|
|
@ -441,31 +457,13 @@ void set_single_persistent_default_layer(uint8_t default_layer) {
|
|||
default_layer_set((layer_state_t)1 << default_layer);
|
||||
}
|
||||
|
||||
layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3) {
|
||||
layer_state_t mask12 = ((layer_state_t)1 << layer1) | ((layer_state_t)1 << layer2);
|
||||
layer_state_t mask3 = (layer_state_t)1 << layer3;
|
||||
return (state & mask12) == mask12 ? (state | mask3) : (state & ~mask3);
|
||||
}
|
||||
|
||||
void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
|
||||
layer_state_set(update_tri_layer_state(layer_state, layer1, layer2, layer3));
|
||||
}
|
||||
|
||||
// TODO: remove legacy api
|
||||
void matrix_init_quantum() {
|
||||
matrix_init_kb();
|
||||
}
|
||||
void matrix_scan_quantum() {
|
||||
matrix_scan_kb();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Override these functions in your keymap file to play different tunes on
|
||||
// different events such as startup and bootloader jump
|
||||
|
||||
__attribute__((weak)) void startup_user() {}
|
||||
__attribute__((weak)) void startup_user(void) {}
|
||||
|
||||
__attribute__((weak)) void shutdown_user() {}
|
||||
__attribute__((weak)) void shutdown_user(void) {}
|
||||
|
||||
void suspend_power_down_quantum(void) {
|
||||
suspend_power_down_kb();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue