Skip to content

Commit

Permalink
fix: update wheelEventHorizontal code to match wheelEventVertical
Browse files Browse the repository at this point in the history
  • Loading branch information
rhendric committed Sep 8, 2024
1 parent 28d1056 commit 1fba0ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/joybuttontypes/joygradientbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ void JoyGradientButton::wheelEventHorizontal()

tempInterval = qMin(tempInterval, 5);

if (!mouseWheelHorizontalEventTimer.isActive() || (mouseWheelVerticalEventTimer.interval() != tempInterval))
if (!mouseWheelHorizontalEventTimer.isActive() || (mouseWheelHorizontalEventTimer.interval() != tempInterval))
{
mouseWheelHorizontalEventTimer.start(tempInterval);
}
Expand All @@ -469,11 +469,14 @@ void JoyGradientButton::wheelEventHorizontal()
buttonslot = mouseWheelHorizontalEventQueue.dequeue();
bool isActive = getActiveSlots().contains(buttonslot);

if (isActive)
if (isActive && activateEvent)
{
sendevent(buttonslot, true);
sendevent(buttonslot, false);
tempQueue.enqueue(buttonslot);
} else if (isActive)
{
tempQueue.enqueue(buttonslot);
}
}

Expand All @@ -492,7 +495,7 @@ void JoyGradientButton::wheelEventHorizontal()

tempInterval = qMin(tempInterval, 5);

if (!mouseWheelHorizontalEventTimer.isActive() || (mouseWheelVerticalEventTimer.interval() != tempInterval))
if (!mouseWheelHorizontalEventTimer.isActive() || (mouseWheelHorizontalEventTimer.interval() != tempInterval))
{
mouseWheelHorizontalEventTimer.start(tempInterval);
}
Expand Down

0 comments on commit 1fba0ca

Please sign in to comment.