]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add layer_state_set_kb hook
authorPriyadi Iman Nurcahyo <priyadi@priyadi.net>
Tue, 14 Feb 2017 22:02:15 +0000 (05:02 +0700)
committerPriyadi Iman Nurcahyo <priyadi@priyadi.net>
Tue, 14 Feb 2017 22:02:15 +0000 (05:02 +0700)
tmk_core/common/action_layer.c
tmk_core/common/action_layer.h

index a3c7579642770620542924557072f3ffbf5acd50..3363a2e53270acf5e5232cbca8c74f8c54351d9e 100644 (file)
@@ -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;
index 025cf5420f7d821098d1d991e77a16e6868694ba..fc714700da560d6dd7409e0575dbd1a91e929018 100644 (file)
@@ -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 */