-
Notifications
You must be signed in to change notification settings - Fork 179
bugfix(input): Fix touchpad upward scrolling in UI list boxes #2586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -824,7 +824,9 @@ void Mouse::createStreamMessages() | |
| { | ||
| msg = TheMessageStream->appendMessage( GameMessage::MSG_RAW_MOUSE_WHEEL ); | ||
| msg->appendPixelArgument( m_currMouse.pos ); | ||
| msg->appendIntegerArgument( m_currMouse.wheelPos / 120 ); // wheel delta | ||
| // TheSuperHackers @bugfix Preserve wheel delta sign for touchpad scroll direction detection | ||
| const Int wheelTicks = m_currMouse.wheelPos / MOUSE_WHEEL_DELTA; | ||
| msg->appendIntegerArgument( m_currMouse.wheelPos > 0 ? max( 1, wheelTicks ) : min( -1, wheelTicks ) ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: could be written as. Int wheelTicks = m_currMouse.wheelPos / MOUSE_WHEEL_DELTA;
wheelTicks = m_currMouse.wheelPos > 0 ? max( 1, wheelTicks ) : min( -1, wheelTicks );
msg->appendIntegerArgument( wheelTicks );There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not clear to me that this fix proposal is the best approach. Perhaps it would be better to make this message argument a float type instead of integer? It looks like it would be possible. Follow all code at MSG_RAW_MOUSE_WHEEL. |
||
| msg->appendIntegerArgument( TheKeyboard->getModifierFlags() ); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is a bit incomplete. It would be better if it clarified that it now guarantees a non-zero value.