Skip to content

Commit

Permalink
fix: mouse calculations for multiple mice
Browse files Browse the repository at this point in the history
Calculate mouse axis movement distance by just summing all values from
different input axes. The existing implementation with minimum and
maximum causes strange mouse "stuttering"-like movement when multiple
controller inputs are mapped to mouse movement.
This happens if both sticks are mapped as mouse and will be a major
problem with the coming sensor implementation
  • Loading branch information
pktiuk authored Apr 30, 2022
2 parents 10dc25e + 7812ab0 commit 471d321
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/joybutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3731,9 +3731,7 @@ void JoyButton::moveMouseCursor(int &movedX, int &movedY, int &movedElapsed, QLi
void JoyButton::distanceForMovingAx(double &finalAx, mouseCursorInfo infoAx)
{
if (!qFuzzyIsNull(infoAx.code))
{
finalAx = (infoAx.code < 0) ? qMin(infoAx.code, finalAx) : qMax(infoAx.code, finalAx);
}
finalAx += infoAx.code;
}

void JoyButton::adjustAxForCursor(QList<double> *mouseHistoryList, double &adjustedAx, double &cursorRemainder,
Expand Down

0 comments on commit 471d321

Please sign in to comment.