From 30c591e813ef5befceac5e8cdafbf9aee502edc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 1 Jan 2023 22:23:14 +0100 Subject: [PATCH] Fix smooth touchpad scrolling on Windows Forgot that I had half-implemented it but not finished it up.. --- Common/UI/ViewGroup.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Common/UI/ViewGroup.cpp b/Common/UI/ViewGroup.cpp index f8405fbb97dd..3288eedd1f3b 100644 --- a/Common/UI/ViewGroup.cpp +++ b/Common/UI/ViewGroup.cpp @@ -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);