diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 3eb931c..c3b7749 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -380,7 +380,11 @@ static void updateActiveUsbReports(void) keyState->suppressed = true; } - if (action->type == KeyActionType_Keystroke && action->keystroke.secondaryRole) { + // Trigger secondary role. + if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Pressed) { + secondaryRoleState = SecondaryRoleState_Triggered; + keyState->current = false; + } else if (action->type == KeyActionType_Keystroke && action->keystroke.secondaryRole) { // Press released secondary role key. if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Released) { secondaryRoleState = SecondaryRoleState_Pressed; @@ -390,13 +394,7 @@ static void updateActiveUsbReports(void) keyState->suppressed = true; } } else { - // Trigger secondary role. - if (!keyState->previous && secondaryRoleState == SecondaryRoleState_Pressed) { - secondaryRoleState = SecondaryRoleState_Triggered; - keyState->current = false; - } else { - applyKeyAction(keyState, action); - } + applyKeyAction(keyState, action); } } else { if (keyState->suppressed) {