aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/action_util.h
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-08-18 00:18:58 +0100
committerGitHub <noreply@github.com>2021-08-18 00:18:58 +0100
commitb8e913c8db73ebf890e4604ee41991a34354a600 (patch)
tree258035f8fda9f83f08a309f6cd608b9c61476678 /tmk_core/common/action_util.h
parent96e2b13d1de227cdc2b918fb0292bd832d346a25 (diff)
downloadqmk_firmware-b8e913c8db73ebf890e4604ee41991a34354a600.tar.gz
qmk_firmware-b8e913c8db73ebf890e4604ee41991a34354a600.zip
Migrate platform independent code from tmk_core -> quantum (#13673)
* Migrate action|keyboard|keycode|eeconfig from tmk_core -> quantum
Diffstat (limited to 'tmk_core/common/action_util.h')
-rw-r--r--tmk_core/common/action_util.h105
1 files changed, 0 insertions, 105 deletions
diff --git a/tmk_core/common/action_util.h b/tmk_core/common/action_util.h
deleted file mode 100644
index f2b3897ae..000000000
--- a/tmk_core/common/action_util.h
+++ /dev/null
@@ -1,105 +0,0 @@
1/*
2Copyright 2013 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include <stdint.h>
21#include "report.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27extern report_keyboard_t *keyboard_report;
28
29void send_keyboard_report(void);
30
31/* key */
32inline void add_key(uint8_t key) { add_key_to_report(keyboard_report, key); }
33
34inline void del_key(uint8_t key) { del_key_from_report(keyboard_report, key); }
35
36inline void clear_keys(void) { clear_keys_from_report(keyboard_report); }
37
38/* modifier */
39uint8_t get_mods(void);
40void add_mods(uint8_t mods);
41void del_mods(uint8_t mods);
42void set_mods(uint8_t mods);
43void clear_mods(void);
44
45/* weak modifier */
46uint8_t get_weak_mods(void);
47void add_weak_mods(uint8_t mods);
48void del_weak_mods(uint8_t mods);
49void set_weak_mods(uint8_t mods);
50void clear_weak_mods(void);
51
52/* macro modifier */
53uint8_t get_macro_mods(void);
54void add_macro_mods(uint8_t mods);
55void del_macro_mods(uint8_t mods);
56void set_macro_mods(uint8_t mods);
57void clear_macro_mods(void);
58
59/* oneshot modifier */
60uint8_t get_oneshot_mods(void);
61void add_oneshot_mods(uint8_t mods);
62void del_oneshot_mods(uint8_t mods);
63void set_oneshot_mods(uint8_t mods);
64void clear_oneshot_mods(void);
65bool has_oneshot_mods_timed_out(void);
66
67uint8_t get_oneshot_locked_mods(void);
68void set_oneshot_locked_mods(uint8_t mods);
69void clear_oneshot_locked_mods(void);
70
71typedef enum { ONESHOT_PRESSED = 0b01, ONESHOT_OTHER_KEY_PRESSED = 0b10, ONESHOT_START = 0b11, ONESHOT_TOGGLED = 0b100 } oneshot_fullfillment_t;
72void set_oneshot_layer(uint8_t layer, uint8_t state);
73uint8_t get_oneshot_layer(void);
74void clear_oneshot_layer_state(oneshot_fullfillment_t state);
75void reset_oneshot_layer(void);
76bool is_oneshot_layer_active(void);
77uint8_t get_oneshot_layer_state(void);
78bool has_oneshot_layer_timed_out(void);
79bool has_oneshot_swaphands_timed_out(void);
80
81void oneshot_locked_mods_changed_user(uint8_t mods);
82void oneshot_locked_mods_changed_kb(uint8_t mods);
83void oneshot_mods_changed_user(uint8_t mods);
84void oneshot_mods_changed_kb(uint8_t mods);
85void oneshot_layer_changed_user(uint8_t layer);
86void oneshot_layer_changed_kb(uint8_t layer);
87
88void oneshot_toggle(void);
89void oneshot_enable(void);
90void oneshot_disable(void);
91bool is_oneshot_enabled(void);
92
93/* inspect */
94uint8_t has_anymod(void);
95
96#ifdef SWAP_HANDS_ENABLE
97void set_oneshot_swaphands(void);
98void release_oneshot_swaphands(void);
99void use_oneshot_swaphands(void);
100void clear_oneshot_swaphands(void);
101#endif
102
103#ifdef __cplusplus
104}
105#endif