Skip to content

Commit

Permalink
Fix smooth touchpad scrolling on Windows
Browse files Browse the repository at this point in the history
Forgot that I had half-implemented it but not finished it up..
  • Loading branch information
hrydgard committed Jan 1, 2023
1 parent 9f85323 commit 30c591e
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 30c591e

Please sign in to comment.