summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action.c7
-rw-r--r--tmk_core/common/action.h1
-rw-r--r--tmk_core/common/action_code.h14
3 files changed, 21 insertions, 1 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 77ea39e942..7a47100a54 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -70,6 +70,12 @@ void process_action(keyrecord_t *record)
#endif
dprintln();
+ // if (action.code >= 0x80000000) {
+ // action_custom(record, action.custom.id);
+ // return;
+ // }
+ dprintf("%X", action.custom.kind);
+
switch (action.kind.id) {
/* Key and Mods */
case ACT_LMODS:
@@ -337,6 +343,7 @@ void process_action(keyrecord_t *record)
default:
break;
}
+
}
diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h
index 8a4736d7bc..16f38926ca 100644
--- a/tmk_core/common/action.h
+++ b/tmk_core/common/action.h
@@ -57,6 +57,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
/* user defined special function */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
+void action_custom(keyrecord_t *record, uint32_t code);
/* Utilities for actions. */
void process_action(keyrecord_t *record);
diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h
index 4fe9c1d581..94f215a41b 100644
--- a/tmk_core/common/action_code.h
+++ b/tmk_core/common/action_code.h
@@ -134,15 +134,17 @@ enum action_kind_id {
* 0x12 0x34 0x34 0x12
*/
typedef union {
- uint16_t code;
+ uint32_t code;
struct action_kind {
uint16_t param :12;
uint8_t id :4;
+ uint16_t other :16;
} kind;
struct action_key {
uint8_t code :8;
uint8_t mods :4;
uint8_t kind :4;
+ uint16_t other :16;
} key;
struct action_layer_bitop {
uint8_t bits :4;
@@ -151,32 +153,42 @@ typedef union {
uint8_t on :2;
uint8_t op :2;
uint8_t kind :4;
+ uint16_t other :16;
} layer_bitop;
struct action_layer_tap {
uint8_t code :8;
uint8_t val :5;
uint8_t kind :3;
+ uint16_t other :16;
} layer_tap;
struct action_usage {
uint16_t code :10;
uint8_t page :2;
uint8_t kind :4;
+ uint16_t other :16;
} usage;
struct action_backlight {
uint8_t level :8;
uint8_t opt :4;
uint8_t kind :4;
+ uint16_t other :16;
} backlight;
struct action_command {
uint8_t id :8;
uint8_t opt :4;
uint8_t kind :4;
+ uint16_t other :16;
} command;
struct action_function {
uint8_t id :8;
uint8_t opt :4;
uint8_t kind :4;
+ uint16_t other :16;
} func;
+ struct action_custom {
+ uint32_t id :28;
+ uint8_t kind :4;
+ } custom;
} action_t;