Skip to content

Commit

Permalink
Merge pull request #16699 from hrydgard/smooth-touchpad-scrolling
Browse files Browse the repository at this point in the history
Fix smooth touchpad scrolling on Windows
  • Loading branch information
hrydgard authored Jan 4, 2023
2 parents 830f106 + 30c591e commit c3f8116
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Common/UI/ViewGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@ bool ScrollView::Key(const KeyInput &input) {
}

if (input.flags & KEY_DOWN) {
if ((input.keyCode == NKCODE_EXT_MOUSEWHEEL_UP || input.keyCode == NKCODE_EXT_MOUSEWHEEL_DOWN) &&
(input.flags & KEY_HASWHEELDELTA)) {
scrollSpeed = (float)(short)(input.flags >> 16) * 1.25f; // Fudge factor
}

switch (input.keyCode) {
case NKCODE_EXT_MOUSEWHEEL_UP:
ScrollRelative(-scrollSpeed);
Expand Down

0 comments on commit c3f8116

Please sign in to comment.