aboutsummaryrefslogtreecommitdiff
path: root/common/action.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/action.h')
-rw-r--r--common/action.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/common/action.h b/common/action.h
index ead917983..a6cb45384 100644
--- a/common/action.h
+++ b/common/action.h
@@ -17,25 +17,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef ACTION_H 17#ifndef ACTION_H
18#define ACTION_H 18#define ACTION_H
19 19
20#include <stdint.h>
21#include <stdbool.h>
20#include "keyboard.h" 22#include "keyboard.h"
21#include "keycode.h" 23#include "keycode.h"
22#include "action_macro.h" 24#include "action_macro.h"
23 25
24 26
25/* Struct to record event and tap count */ 27typedef struct {
26typedef union { 28 keyevent_t event;
29#ifndef NO_ACTION_TAPPING
30 /* tapping count and state */
27 struct { 31 struct {
28 bool interrupted :1; 32 bool interrupted :1;
29 bool reserved2 :1; 33 bool reserved2 :1;
30 bool reserved1 :1; 34 bool reserved1 :1;
31 bool reserved0 :1; 35 bool reserved0 :1;
32 uint8_t count :4; 36 uint8_t count :4;
33 }; 37 } tap;
34} tap_t; 38#endif
35
36typedef struct {
37 keyevent_t event;
38 tap_t tap;
39} keyrecord_t; 39} keyrecord_t;
40 40
41/* Action struct. 41/* Action struct.
@@ -99,9 +99,8 @@ const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t op
99/* user defined special function */ 99/* user defined special function */
100void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); 100void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
101 101
102/* 102/* Utilities for actions. */
103 * Utilities for actions. 103void process_action(keyrecord_t *record);
104 */
105void register_code(uint8_t code); 104void register_code(uint8_t code);
106void unregister_code(uint8_t code); 105void unregister_code(uint8_t code);
107void add_mods(uint8_t mods); 106void add_mods(uint8_t mods);
@@ -112,7 +111,11 @@ void clear_keyboard_but_mods(void);
112bool sending_anykey(void); 111bool sending_anykey(void);
113void layer_switch(uint8_t new_layer); 112void layer_switch(uint8_t new_layer);
114bool is_tap_key(key_t key); 113bool is_tap_key(key_t key);
115bool waiting_buffer_has_anykey_pressed(void); 114
115/* debug */
116void debug_event(keyevent_t event);
117void debug_record(keyrecord_t record);
118void debug_action(action_t action);
116 119
117 120
118 121