mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-05-07 11:59:00 +00:00
Merge remote-tracking branch 'upstream/master' into firmware23
This commit is contained in:
@@ -17,24 +17,60 @@
|
||||
#include <ctype.h>
|
||||
#include "quantum.h"
|
||||
|
||||
#if defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE)
|
||||
# include "process_backlight.h"
|
||||
#endif
|
||||
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
# include "outputselect.h"
|
||||
#endif
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
# include "backlight.h"
|
||||
#ifdef GRAVE_ESC_ENABLE
|
||||
# include "process_grave_esc.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAPTIC_ENABLE
|
||||
# include "process_haptic.h"
|
||||
#endif
|
||||
|
||||
#ifdef JOYSTICK_ENABLE
|
||||
# include "process_joystick.h"
|
||||
#endif
|
||||
|
||||
#ifdef LEADER_ENABLE
|
||||
# include "process_leader.h"
|
||||
#endif
|
||||
|
||||
#ifdef MAGIC_KEYCODE_ENABLE
|
||||
# include "process_magic.h"
|
||||
#endif
|
||||
|
||||
#ifdef MIDI_ENABLE
|
||||
# include "process_midi.h"
|
||||
#endif
|
||||
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
# include "velocikey.h"
|
||||
#ifdef PROGRAMMABLE_BUTTON_ENABLE
|
||||
# include "process_programmable_button.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAPTIC_ENABLE
|
||||
# include "haptic.h"
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
# include "process_rgb.h"
|
||||
#endif
|
||||
|
||||
#ifdef SECURE_ENABLE
|
||||
# include "process_secure.h"
|
||||
#endif
|
||||
|
||||
#ifdef TRI_LAYER_ENABLE
|
||||
# include "process_tri_layer.h"
|
||||
#endif
|
||||
|
||||
#ifdef UNICODE_COMMON_ENABLE
|
||||
# include "process_unicode_common.h"
|
||||
#endif
|
||||
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
# include "velocikey.h"
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
@@ -115,6 +151,14 @@ __attribute__((weak)) void tap_code16(uint16_t code) {
|
||||
tap_code16_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY);
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
return pre_process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool pre_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool process_action_kb(keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
@@ -169,7 +213,7 @@ void soft_reset_keyboard(void) {
|
||||
|
||||
/* Convert record into usable keycode via the contained event. */
|
||||
uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) {
|
||||
#ifdef COMBO_ENABLE
|
||||
#if defined(COMBO_ENABLE) || defined(REPEAT_KEY_ENABLE)
|
||||
if (record->keycode) {
|
||||
return record->keycode;
|
||||
}
|
||||
@@ -203,14 +247,12 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) {
|
||||
|
||||
/* Get keycode, and then process pre tapping functionality */
|
||||
bool pre_process_record_quantum(keyrecord_t *record) {
|
||||
if (!(
|
||||
uint16_t keycode = get_record_keycode(record, true);
|
||||
return pre_process_record_kb(keycode, record) &&
|
||||
#ifdef COMBO_ENABLE
|
||||
process_combo(get_record_keycode(record, true), record) &&
|
||||
process_combo(keycode, record) &&
|
||||
#endif
|
||||
true)) {
|
||||
return false;
|
||||
}
|
||||
return true; // continue processing
|
||||
true;
|
||||
}
|
||||
|
||||
/* Get keycode, and then call keyboard function */
|
||||
@@ -268,6 +310,9 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||
// Must run asap to ensure all keypresses are recorded.
|
||||
process_dynamic_macro(keycode, record) &&
|
||||
#endif
|
||||
#ifdef REPEAT_KEY_ENABLE
|
||||
process_last_key(keycode, record) && process_repeat_key(keycode, record) &&
|
||||
#endif
|
||||
#if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY)
|
||||
process_clicky(keycode, record) &&
|
||||
#endif
|
||||
@@ -305,15 +350,15 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||
#if (defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE)
|
||||
process_music(keycode, record) &&
|
||||
#endif
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
process_caps_word(keycode, record) &&
|
||||
#endif
|
||||
#ifdef KEY_OVERRIDE_ENABLE
|
||||
process_key_override(keycode, record) &&
|
||||
#endif
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
process_tap_dance(keycode, record) &&
|
||||
#endif
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
process_caps_word(keycode, record) &&
|
||||
#endif
|
||||
#if defined(UNICODE_COMMON_ENABLE)
|
||||
process_unicode_common(keycode, record) &&
|
||||
#endif
|
||||
@@ -463,7 +508,7 @@ void suspend_power_down_quantum(void) {
|
||||
#ifndef NO_SUSPEND_POWER_DOWN
|
||||
// Turn off backlight
|
||||
# ifdef BACKLIGHT_ENABLE
|
||||
backlight_set(0);
|
||||
backlight_level_noeeprom(0);
|
||||
# endif
|
||||
|
||||
# ifdef LED_MATRIX_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user