diff --git a/right/src/event_scheduler.h b/right/src/event_scheduler.h index cc2b81c8..31a73f58 100644 --- a/right/src/event_scheduler.h +++ b/right/src/event_scheduler.h @@ -49,38 +49,39 @@ EventVector_MouseController = 1 << 4, EventVector_Postponer = 1 << 5, EventVector_LayerHolds = 1 << 6, - EventVector_EventScheduler = 1 << 7, + EventVector_SendUsbReports = 1 << 7, + EventVector_ResendUsbReports = 1 << 8, + EventVector_EventScheduler = 1 << 9, EventVector_MainTriggers = ((EventVector_EventScheduler << 1) - 1), // some other minor triggers - EventVector_KeyboardLedState = 1 << 9, - EventVector_UsbMacroCommandWaitingForExecution = 1 << 10, - EventVector_ProtocolChanged = 1 << 11, - EventVector_LedManagerFullUpdateNeeded = 1 << 12, - EventVector_KeymapReloadNeeded = 1 << 13, - EventVector_SegmentDisplayNeedsUpdate = 1 << 14, - EventVector_LedMapUpdateNeeded = 1 << 15, - EventVector_ApplyConfig = 1 << 16, - EventVector_NewMessage = 1 << 17, + EventVector_KeyboardLedState = 1 << 10, + EventVector_UsbMacroCommandWaitingForExecution = 1 << 11, + EventVector_ProtocolChanged = 1 << 12, + EventVector_LedManagerFullUpdateNeeded = 1 << 13, + EventVector_KeymapReloadNeeded = 1 << 14, + EventVector_SegmentDisplayNeedsUpdate = 1 << 15, + EventVector_LedMapUpdateNeeded = 1 << 16, + EventVector_ApplyConfig = 1 << 17, + EventVector_NewMessage = 1 << 18, EventVector_AuxiliaryTriggers = ((EventVector_NewMessage << 1) - 1), // events that are informational only - EventVector_NativeActionReportsUsed = 1 << 18, - EventVector_MacroReportsUsed = 1 << 19, - EventVector_MouseKeysReportsUsed = 1 << 20, - EventVector_MouseControllerMouseReportsUsed = 1 << 21, - EventVector_MouseControllerKeyboardReportsUsed = 1 << 22, - EventVector_SendUsbReports = 1 << 23, - EventVector_ResendUsbReports = 1 << 24, - EventVector_NativeActionsPostponing = 1 << 25, + EventVector_NativeActionReportsUsed = 1 << 19, + EventVector_MacroReportsUsed = 1 << 20, + EventVector_MouseKeysReportsUsed = 1 << 21, + EventVector_MouseControllerMouseReportsUsed = 1 << 22, + EventVector_MouseControllerKeyboardReportsUsed = 1 << 23, + EventVector_NativeActionsPostponing = 1 << 24, + EventVector_KeystrokeDelayPostponing = 1 << 25, EventVector_MacroEnginePostponing = 1 << 26, EventVector_MouseControllerPostponing = 1 << 27, // helper masks EventVector_ReportUpdateMask = EventVector_MainTriggers & ~EventVector_EventScheduler, EventVector_UserLogicUpdateMask = EventVector_AuxiliaryTriggers & ~EventVector_EventScheduler, - EventVector_SomeonePostponing = EventVector_NativeActionsPostponing | EventVector_MacroEnginePostponing | EventVector_MouseControllerPostponing, + EventVector_SomeonePostponing = EventVector_KeystrokeDelayPostponing | EventVector_NativeActionsPostponing | EventVector_MacroEnginePostponing | EventVector_MouseControllerPostponing, } event_vector_event_t; /** diff --git a/right/src/postponer.c b/right/src/postponer.c index 040f52cd..5f70f136 100644 --- a/right/src/postponer.c +++ b/right/src/postponer.c @@ -192,7 +192,7 @@ static void appendEvent(postponer_event_t event) bool PostponerCore_EventsShouldBeQueued(void) { - return runState.eventsShouldBeQueued || (EventScheduler_Vector & EventVector_NativeActionsPostponing) || (EventScheduler_Vector & EventVector_MacroEnginePostponing); + return runState.eventsShouldBeQueued || (EventScheduler_Vector & (EventVector_KeystrokeDelayPostponing | EventVector_NativeActionsPostponing | EventVector_MacroEnginePostponing /* should here be mouse controller too? */)); } bool PostponerCore_IsActive(void) diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 3a57ed68..e9560491 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -1,4 +1,5 @@ #include +#include "atomicity.h" #include "event_scheduler.h" #include "key_action.h" #include "led_display.h" @@ -656,9 +657,6 @@ static void updateActiveUsbReports(void) } void justPreprocessInput(void) { - // Make preprocessKeyState push new events into postponer queue. - EventVector_Set(EventVector_NativeActionsPostponing); - for (uint8_t slotId=0; slotId