forked from Ikcelaks/qmk_sequence_transform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsequence_transform.h
More file actions
48 lines (41 loc) · 1.58 KB
/
sequence_transform.h
File metadata and controls
48 lines (41 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2021 Google LLC
// Copyright 2021 @filterpaper
// Copyright 2023 Pablo Martinez (@elpekenin) <elpekenin@elpekenin.dev>
// Copyright 2024 Guillaume Stordeur <guillaume.stordeur@gmail.com>
// Copyright 2024 Matt Skalecki <ikcelaks@gmail.com>
// Copyright 2024 QKekos <q.kekos.q@gmail.com>
// SPDX-License-Identifier: Apache-2.0
// Original source/inspiration: https://getreuer.info/posts/keyboards/autocorrection
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "action.h"
#include "keybuffer.h"
#include "key_stack.h"
#include "trie.h"
#include "cursor.h"
//////////////////////////////////////////////////////////////////
// Public API
bool process_sequence_transform(uint16_t keycode, keyrecord_t *record, uint16_t special_key_start);
void sequence_transform_on_missed_rule_user(const st_trie_rule_t *rule);
void post_process_sequence_transform(void);
uint16_t sequence_transform_past_keycode(int index);
#if SEQUENCE_TRANSFORM_IDLE_TIMEOUT > 0
void sequence_transform_task(void);
#else
static inline void sequence_transform_task(void) {}
#endif
//////////////////////////////////////////////////////////////////
// Internal
bool st_process_check(uint16_t *keycode, keyrecord_t *record, uint8_t *mods);
void st_handle_repeat_key(void);
void st_handle_result(st_trie_t *trie, st_trie_search_result_t *res);
bool st_perform(void);
void st_find_missed_rule(void);
void st_handle_backspace(void);
uint8_t st_get_virtual_output(char *buf, uint8_t count);
#ifdef ST_TESTER
st_trie_t *st_get_trie(void);
st_key_buffer_t *st_get_key_buffer(void);
st_cursor_t *st_get_cursor(void);
#endif