summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-15 05:02:15 +0700
committerPriyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-15 05:02:15 +0700
commitd369bfb83a74d94ed0fbb13f8ee3a8a1146da770 (patch)
treeeb8cd798cdc1df228f08c3585caf27e2af20880d
parent4010360912125c120904e2d5294963db2d4ded65 (diff)
Add layer_state_set_kb hook
-rw-r--r--tmk_core/common/action_layer.c6
-rw-r--r--tmk_core/common/action_layer.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index a3c7579642..3363a2e532 100644
--- a/tmk_core/common/action_layer.c
+++ b/tmk_core/common/action_layer.c
@@ -57,8 +57,14 @@ void default_layer_xor(uint32_t state)
*/
uint32_t layer_state = 0;
+__attribute__((weak))
+uint32_t layer_state_set_kb(uint32_t state) {
+ return state;
+}
+
static void layer_state_set(uint32_t state)
{
+ state = layer_state_set_kb(state);
dprint("layer_state: ");
layer_debug(); dprint(" to ");
layer_state = state;
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h
index 025cf5420f..fc714700da 100644
--- a/tmk_core/common/action_layer.h
+++ b/tmk_core/common/action_layer.h
@@ -69,6 +69,8 @@ void layer_xor(uint32_t state);
#define layer_xor(state)
#define layer_debug()
+__attribute__((weak))
+void layer_state_set_kb(uint32_t oldstate, uint32_t newstate);
#endif
/* pressed actions cache */