]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/common/action_layer.c
hhkb: Update README and remove makefiles
[max/tmk_keyboard.git] / tmk_core / common / action_layer.c
index 46401eba6248483bbf75e48408da12b3acc9da27..be316697190cc7b2a1533ca606a570872256967d 100644 (file)
@@ -122,9 +122,8 @@ void layer_debug(void)
 /* return layer effective for key at this time */
 static uint8_t current_layer_for_key(keypos_t key)
 {
-    action_t action = ACTION_TRANSPARENT;
-
 #ifndef NO_ACTION_LAYER
+    action_t action = ACTION_TRANSPARENT;
     uint32_t layers = layer_state | default_layer_state;
     /* check top layer first */
     for (int8_t i = 31; i >= 0; i--) {
@@ -149,6 +148,8 @@ static uint8_t layer_pressed[MATRIX_ROWS][MATRIX_COLS] = {};
 #endif
 action_t layer_switch_get_action(keyevent_t event)
 {
+    if (IS_NOEVENT(event)) return (action_t)ACTION_NO;
+
     uint8_t layer = 0;
 #ifndef NO_TRACK_KEY_PRESS
     if (event.pressed) {