Fix the stuck state of the decelerate key that triggered once it was pressed.

This commit is contained in:
László Monda
2017-11-24 17:39:45 +01:00
parent 210ef31f27
commit 368c724e6a
2 changed files with 4 additions and 2 deletions

View File

@@ -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;

View File

@@ -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))