From eb5ebb056cebbf19501fd6edf691df9a3e600432 Mon Sep 17 00:00:00 2001 From: Toast Date: Fri, 5 Dec 2025 23:59:26 +0100 Subject: [PATCH] Gaming: patch sdl to ignore keychron things --- roles/gaming/default.nix | 12 +++++++++++- roles/gaming/sdl-keychron-blacklist.patch | 13 +++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 roles/gaming/sdl-keychron-blacklist.patch diff --git a/roles/gaming/default.nix b/roles/gaming/default.nix index 2d8f4ab..4845419 100644 --- a/roles/gaming/default.nix +++ b/roles/gaming/default.nix @@ -1,6 +1,16 @@ -{...}: { +{pkgs, ...}: { imports = [ ./programs ./services ]; + system.replaceDependencies.replacements = [ + { + oldDependency = pkgs.sdl3; + newDependency = pkgs.sdl3.overrideAttrs { + patches = [ + ./sdl-keychron-blacklist.patch + ]; + }; + } + ]; } diff --git a/roles/gaming/sdl-keychron-blacklist.patch b/roles/gaming/sdl-keychron-blacklist.patch new file mode 100644 index 0000000..ef73b54 --- /dev/null +++ b/roles/gaming/sdl-keychron-blacklist.patch @@ -0,0 +1,13 @@ +diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c +index 5ce36de86..37bf5ca85 100644 +--- a/src/joystick/SDL_joystick.c ++++ b/src/joystick/SDL_joystick.c +@@ -281,6 +281,8 @@ static Uint32 initial_blacklist_devices[] = { + MAKE_VIDPID(0x3297, 0x1969), // Moonlander MK1 Keyboard + MAKE_VIDPID(0x3434, 0x0211), // Keychron K1 Pro System Control + MAKE_VIDPID(0x04f2, 0xa13c), // HP Deluxe Webcam KQ246AA ++ MAKE_VIDPID(0x3434, 0x0353), // Keychron V5 System Control ++ MAKE_VIDPID(0x3434, 0xd030), // Keychron Link + }; + static SDL_vidpid_list blacklist_devices = { + SDL_HINT_JOYSTICK_BLACKLIST_DEVICES, 0, 0, NULL,