diff options
Diffstat (limited to 'common/action.h')
| -rw-r--r-- | common/action.h | 27 |
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 */ | 27 | typedef struct { |
| 26 | typedef 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 | |||
| 36 | typedef 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 */ |
| 100 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); | 100 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); |
| 101 | 101 | ||
| 102 | /* | 102 | /* Utilities for actions. */ |
| 103 | * Utilities for actions. | 103 | void process_action(keyrecord_t *record); |
| 104 | */ | ||
| 105 | void register_code(uint8_t code); | 104 | void register_code(uint8_t code); |
| 106 | void unregister_code(uint8_t code); | 105 | void unregister_code(uint8_t code); |
| 107 | void add_mods(uint8_t mods); | 106 | void add_mods(uint8_t mods); |
| @@ -112,7 +111,11 @@ void clear_keyboard_but_mods(void); | |||
| 112 | bool sending_anykey(void); | 111 | bool sending_anykey(void); |
| 113 | void layer_switch(uint8_t new_layer); | 112 | void layer_switch(uint8_t new_layer); |
| 114 | bool is_tap_key(key_t key); | 113 | bool is_tap_key(key_t key); |
| 115 | bool waiting_buffer_has_anykey_pressed(void); | 114 | |
| 115 | /* debug */ | ||
| 116 | void debug_event(keyevent_t event); | ||
| 117 | void debug_record(keyrecord_t record); | ||
| 118 | void debug_action(action_t action); | ||
| 116 | 119 | ||
| 117 | 120 | ||
| 118 | 121 | ||
