summaryrefslogtreecommitdiff
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2023-04-03 10:33:45 +0200
committerGitHub <noreply@github.com>2023-04-03 18:33:45 +1000
commitfcf8b804ed95a98561bd4c1d6c85604be0f7cc7b (patch)
tree6b6917d99ced027d614e7b461e1cd1939833a9cd /quantum/process_keycode
parent2d9140af53e4e5bbc5cd50a2b6f3eda20ed8f71e (diff)
[Core] Refactor `keyevent_t` for 1ms timing resolution (#15847)
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_combo.c10
-rw-r--r--quantum/process_keycode/process_steno.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c
index ce6725c402..b1b49d3019 100644
--- a/quantum/process_keycode/process_combo.c
+++ b/quantum/process_keycode/process_combo.c
@@ -145,7 +145,7 @@ static queued_combo_t combo_buffer[COMBO_BUFFER_LENGTH];
static inline void release_combo(uint16_t combo_index, combo_t *combo) {
if (combo->keycode) {
keyrecord_t record = {
- .event = MAKE_KEYEVENT(KEYLOC_COMBO, KEYLOC_COMBO, false),
+ .event = MAKE_COMBOEVENT(false),
.keycode = combo->keycode,
};
#ifndef NO_ACTION_TAPPING
@@ -233,7 +233,7 @@ static inline void dump_key_buffer(void) {
process_record(record);
#endif
}
- record->event.time = 0;
+ record->event.type = TICK_EVENT;
#if defined(CAPS_WORD_ENABLE) && defined(AUTO_SHIFT_ENABLE)
// Edge case: preserve the weak Left Shift mod if both Caps Word and
@@ -333,8 +333,8 @@ void apply_combo(uint16_t combo_index, combo_t *combo) {
KEY_STATE_DOWN(state, key_index);
if (ALL_COMBO_KEYS_ARE_DOWN(state, key_count)) {
// this in the end executes the combo when the key_buffer is dumped.
- record->keycode = combo->keycode;
- record->event.key = MAKE_KEYPOS(KEYLOC_COMBO, KEYLOC_COMBO);
+ record->keycode = combo->keycode;
+ record->event.type = COMBO_EVENT;
qrecord->combo_index = combo_index;
ACTIVATE_COMBO(combo);
@@ -343,7 +343,7 @@ void apply_combo(uint16_t combo_index, combo_t *combo) {
} else {
// key was part of the combo but not the last one, "disable" it
// by making it a TICK event.
- record->event.time = 0;
+ record->event.type = TICK_EVENT;
}
}
drop_combo_from_buffer(combo_index);
diff --git a/quantum/process_keycode/process_steno.c b/quantum/process_keycode/process_steno.c
index 8ba98bd4bb..d5ad61ba85 100644
--- a/quantum/process_keycode/process_steno.c
+++ b/quantum/process_keycode/process_steno.c
@@ -173,13 +173,13 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef STENO_ENABLE_ALL
case QK_STENO_BOLT:
- if (IS_PRESSED(record->event)) {
+ if (record->event.pressed) {
steno_set_mode(STENO_MODE_BOLT);
}
return false;
case QK_STENO_GEMINI:
- if (IS_PRESSED(record->event)) {
+ if (record->event.pressed) {
steno_set_mode(STENO_MODE_GEMINI);
}
return false;
@@ -193,7 +193,7 @@ bool process_steno(uint16_t keycode, keyrecord_t *record) {
}
#endif // STENO_COMBINEDMAP
case STN__MIN ... STN__MAX:
- if (IS_PRESSED(record->event)) {
+ if (record->event.pressed) {
n_pressed_keys++;
switch (mode) {
#ifdef STENO_ENABLE_BOLT