summaryrefslogtreecommitdiff
path: root/common/action.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-02-26 16:27:09 +0900
committertmk <nobody@nowhere>2013-02-26 16:27:09 +0900
commita207e848b3b308406263576c1e0d066067888416 (patch)
tree1e2ac59d8350a8f5a56b645954cae948841e17c9 /common/action.h
parent6778324de2f8cbdf4eeada7b2be05937dc833e9b (diff)
Add tap flags on record_t
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 9dea4b0aa7..39e0ae3283 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/>.
/* 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 */