aboutsummaryrefslogtreecommitdiff
path: root/common/action.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/action.h')
-rw-r--r--common/action.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/common/action.h b/common/action.h
index 9dea4b0aa..39e0ae328 100644
--- a/common/action.h
+++ b/common/action.h
@@ -23,9 +23,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23 23
24 24
25/* Struct to record event and tap count */ 25/* Struct to record event and tap count */
26typedef union {
27 struct {
28 bool interrupted :1;
29 bool reserved2 :1;
30 bool reserved1 :1;
31 bool reserved0 :1;
32 uint8_t count :4;
33 };
34} tap_t;
35
26typedef struct { 36typedef struct {
27 keyevent_t event; 37 keyevent_t event;
28 uint8_t tap_count; 38 tap_t tap;
29} keyrecord_t; 39} keyrecord_t;
30 40
31/* Action struct. 41/* Action struct.
@@ -377,6 +387,7 @@ enum layer_params {
377 */ 387 */
378/* Macro */ 388/* Macro */
379#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) 389#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id))
390#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id))
380#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id)) 391#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id))
381 392
382/* Command */ 393/* Command */
@@ -386,7 +397,8 @@ enum layer_params {
386enum function_opts { 397enum function_opts {
387 FUNC_TAP = 0x8, /* indciates function is tappable */ 398 FUNC_TAP = 0x8, /* indciates function is tappable */
388}; 399};
389#define ACTION_FUNCTION(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | id) 400#define ACTION_FUNCTION(id) ACTION(ACT_FUNCTION, (id))
390#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | id) 401#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | (id))
402#define ACTION_FUNCTION_OPT(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | (id))
391 403
392#endif /* ACTION_H */ 404#endif /* ACTION_H */