From a207e848b3b308406263576c1e0d066067888416 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 26 Feb 2013 16:27:09 +0900 Subject: Add tap flags on record_t --- common/action.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'common/action.h') 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 . /* Struct to record event and tap count */ +typedef union { + struct { + bool interrupted :1; + bool reserved2 :1; + bool reserved1 :1; + bool reserved0 :1; + uint8_t count :4; + }; +} tap_t; + typedef struct { keyevent_t event; - uint8_t tap_count; + tap_t tap; } keyrecord_t; /* Action struct. @@ -377,6 +387,7 @@ enum layer_params { */ /* Macro */ #define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) +#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) #define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id)) /* Command */ @@ -386,7 +397,8 @@ enum layer_params { enum function_opts { FUNC_TAP = 0x8, /* indciates function is tappable */ }; -#define ACTION_FUNCTION(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | id) -#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | id) +#define ACTION_FUNCTION(id) ACTION(ACT_FUNCTION, (id)) +#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | (id)) +#define ACTION_FUNCTION_OPT(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | (id)) #endif /* ACTION_H */ -- cgit v1.2.3