Conversation
SDL precise scrolling can sometimes produce values greater than 1 or less than -1. On the wire, the value is encoded as a 16-bit fixed-point number. Previously, the range was interpreted as [-1, 1], using 1 bit for the integral part (the sign) and 15 bits for the fractional part. To support larger values, interpret the range as [-16, 16] instead, using 5 bits for the integral part and 11 bits for the fractional part (which is more than enough). PR #6172 <#6172>
Over HID, only integral scroll values can be sent. When SDL precise scrolling is active, scroll events may include fractional values (e.g., 0.05), which are truncated to 0 in the HID event. To fix the problem, use the integral scroll value reported by SDL, which internally accumulates fractional deltas. Fixes #6156 <#6156> PR #6172 <#6172>
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
Over HID, only integral scroll values can be sent. When SDL precise scrolling is active, scroll events may include fractional values (e.g., 0.05), which are truncated to 0 in the HID event. To fix the problem, use the integral scroll value reported by SDL, which internally accumulates fractional deltas. Fixes #6156 <#6156> PR #6172 <#6172>
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
Collaborator
Author
|
(rebased/pushed-force to fix a unit test and edit a commit message) |
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
SDL precise scrolling can sometimes produce values greater than 1 or less than -1. On the wire, the value is encoded as a 16-bit fixed-point number. Previously, the range was interpreted as [-1, 1], using 1 bit for the integral part (the sign) and 15 bits for the fractional part. To support larger values, interpret the range as [-16, 16] instead, using 5 bits for the integral part and 11 bits for the fractional part (which is more than enough). PR #6172 <#6172>
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
Over HID, only integral scroll values can be sent. When SDL precise scrolling is active, scroll events may include fractional values (e.g., 0.05), which are truncated to 0 in the HID event. To fix the problem, use the integral scroll value reported by SDL, which internally accumulates fractional deltas. Fixes #6156 <#6156> PR #6172 <#6172>
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
SDL precise scrolling can sometimes produce values greater than 1 or less than -1. On the wire, the value is encoded as a 16-bit fixed-point number. Previously, the range was interpreted as [-1, 1], using 1 bit for the integral part (the sign) and 15 bits for the fractional part. To support larger values, interpret the range as [-16, 16] instead, using 5 bits for the integral part and 11 bits for the fractional part (which is more than enough). PR #6172 <#6172>
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
Over HID, only integral scroll values can be sent. When SDL precise scrolling is active, scroll events may include fractional values (e.g., 0.05), which are truncated to 0 in the HID event. To fix the problem, use the integral scroll value reported by SDL, which internally accumulates fractional deltas. Fixes #6156 <#6156> PR #6172 <#6172>
rom1v
added a commit
that referenced
this pull request
Jun 20, 2025
Linux4
added a commit
to Linux4/scrcpy
that referenced
this pull request
Sep 5, 2025
scrcpy v3.3.1 Changes since v3.3: - Fix --power-off-on-close (Genymobile#6146) - Fix clipboard with --no-clipboard-autosync (Genymobile#6151) - Fix --list-apps and --list-cameras (Genymobile#6165, Genymobile#6167) - Fix HID mouse support with SDL precise scrolling (Genymobile#6156, Genymobile#6172) - Add horizontal scrolling support for HID mouse (Genymobile#6172)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scrolling values reported by SDL can produce fractional values (like 0.05, when precise scrolling is enabled), and also values greater than 1 or less than -1.
Currently, the reported value was clamped to [-1, 1]. To support larger values, extend the range to [-16, 16] for SDK mouse (the default mode).
Over HID, only integral scroll values can be sent. When receiving fractional values from SDL, scrolling was broken (#6156). To fix the problem, use the integral scroll value reported by SDL, which internally accumulates fractional deltas.
While I was at it, I also added horizontal scrolling support for HID (it was only implemented for SDK mouse).
Fixes #6156.