From b18cb651ce3f107089f5a3bc6232c88be7f44caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 3 Nov 2017 12:49:55 +0100 Subject: [PATCH] Leave the active layer active even if another layer switcher key gets pressed while holding it. --- right/src/usb_report_updater.c | 41 ++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index fe860c3..e09c92d 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -74,19 +74,42 @@ void processMouseAction(key_action_t action) wasPreviousMouseActionWheelAction = isWheelAction; } -uint8_t getActiveLayer(void) +static bool pressedLayers[LAYER_COUNT]; + +void updatePressedLayers(void) { - uint8_t activeLayer = LayerId_Base; + memset(pressedLayers, false, LAYER_COUNT); + for (uint8_t slotId=0; slotIdmodifiers |= previousModifiers; } - previousLayer = activeLayer; previousModifiers = ActiveUsbBasicKeyboardReport->modifiers; }