diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 7692db7..304f3cd 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -30,7 +30,7 @@ static float mouseScrollSpeed = 0.1; static bool isMouseMoving; static bool wasMouseMoving; -static bool activeMouseStates[SerializedMouseAction_Last]; +static bool activeMouseStates[ACTIVE_MOUSE_STATES_COUNT]; void processMouseActions() { @@ -178,7 +178,7 @@ static secondary_role_t secondaryRole; void updateActiveUsbReports(void) { - memset(activeMouseStates, 0, SerializedMouseAction_Last); + memset(activeMouseStates, 0, ACTIVE_MOUSE_STATES_COUNT); wasMouseMoving = isMouseMoving; isMouseMoving = false; diff --git a/right/src/usb_report_updater.h b/right/src/usb_report_updater.h index 6be26fe..2bc8ba0 100644 --- a/right/src/usb_report_updater.h +++ b/right/src/usb_report_updater.h @@ -3,6 +3,8 @@ // Macros: + #define ACTIVE_MOUSE_STATES_COUNT (SerializedMouseAction_Last + 1) + #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))