diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 4b1b4d7..4159b3a 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -132,7 +132,13 @@ void UpdateActiveUsbReports(void) KeyStates[SlotId_RightKeyboardHalf][keyId].current = RightKeyMatrix.keyStates[keyId]; } - layer_id_t activeLayer = GetActiveLayer(); + layer_id_t activeLayer = LayerId_Base; + if (secondaryRoleState == SecondaryRoleState_Triggered && IS_SECONDARY_ROLE_LAYER_SWITCHER(secondaryRole)) { + activeLayer = SECONDARY_ROLE_LAYER_TO_LAYER_ID(secondaryRole); + } + if (activeLayer == LayerId_Base) { + activeLayer = GetActiveLayer(); + } LedDisplay_SetLayer(activeLayer); if (MacroPlaying) { diff --git a/right/src/usb_report_updater.h b/right/src/usb_report_updater.h index e70c63f..7edabe6 100644 --- a/right/src/usb_report_updater.h +++ b/right/src/usb_report_updater.h @@ -6,6 +6,7 @@ #define IS_SECONDARY_ROLE_MODIFIER(secondaryRole) (SecondaryRole_LeftCtrl <= (secondaryRole) && (secondaryRole) <= SecondaryRole_RightSuper) #define IS_SECONDARY_ROLE_LAYER_SWITCHER(secondaryRole) (SecondaryRole_Mod <= (secondaryRole) && (secondaryRole) <= SecondaryRole_Mouse) #define SECONDARY_ROLE_MODIFIER_TO_HID_MODIFIER(secondaryRoleModifier) (1 << ((secondaryRoleModifier) - 1)) + #define SECONDARY_ROLE_LAYER_TO_LAYER_ID(secondaryRoleLayer) ((secondaryRoleLayer) - SecondaryRole_RightSuper) // Typedefs: