Make secondary role layer switching work.
This commit is contained in:
@@ -132,7 +132,13 @@ void UpdateActiveUsbReports(void)
|
|||||||
KeyStates[SlotId_RightKeyboardHalf][keyId].current = RightKeyMatrix.keyStates[keyId];
|
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);
|
LedDisplay_SetLayer(activeLayer);
|
||||||
|
|
||||||
if (MacroPlaying) {
|
if (MacroPlaying) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#define IS_SECONDARY_ROLE_MODIFIER(secondaryRole) (SecondaryRole_LeftCtrl <= (secondaryRole) && (secondaryRole) <= SecondaryRole_RightSuper)
|
#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 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_MODIFIER_TO_HID_MODIFIER(secondaryRoleModifier) (1 << ((secondaryRoleModifier) - 1))
|
||||||
|
#define SECONDARY_ROLE_LAYER_TO_LAYER_ID(secondaryRoleLayer) ((secondaryRoleLayer) - SecondaryRole_RightSuper)
|
||||||
|
|
||||||
// Typedefs:
|
// Typedefs:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user