diff --git a/hardware-specific/trackball.nix b/hardware-specific/trackball.nix index ba15369..b1344c0 100644 --- a/hardware-specific/trackball.nix +++ b/hardware-specific/trackball.nix @@ -7,6 +7,14 @@ } ]; + nixpkgs.overlays = [ + (final: prev: { + moonlight-qt = prev.moonlight-qt.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ ../misc/mouse-accel.patch ]; + }); + }) + ]; + hardware.logitech.wireless = { enable = true; enableGraphical = true; diff --git a/misc/mouse-accel.patch b/misc/mouse-accel.patch new file mode 100644 index 0000000..a6b7295 --- /dev/null +++ b/misc/mouse-accel.patch @@ -0,0 +1,15 @@ +diff --git a/app/streaming/input/input.cpp b/app/streaming/input/input.cpp +index 95db06e0..d1d34fd5 100644 +--- a/app/streaming/input/input.cpp ++++ b/app/streaming/input/input.cpp +@@ -39,6 +39,10 @@ SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, int streamWidth, i + m_CaptureSystemKeysMode = StreamingPreferences::CSK_ALWAYS; + } + ++ // This is used to always grab the OS-modified input for the mouse ++ // This is because I am using OS-level functionality for mouse acceleration ++ SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1"); ++ + // Allow gamepad input when the app doesn't have focus if requested + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, prefs.backgroundGamepad ? "1" : "0"); +