Prevent a Keychron keyboard from showing up as a game controller system-wide
Stop SDL from detecting a Keychron (or any QMK/VIA) keyboard as a game controller in Prism Launcher with one environment variable.
I set up Prism Launcher and Fabulously Optimized for Minecraft, but my Keychron Q2 Max kept being detected as a game controller by the Controlify mod. This is a known quirk of QMK/VIA-based keyboards: they expose several HID interfaces over USB, and SDL sometimes mistakes one of them for a gamepad.
I originally fixed this with an environment variable inside Prism Launcher, but that only patches one app. The better fix is a udev rule that tells the whole system the device isn't a joystick, which covers Prism, Steam, and every native game at once.
Step 1: Find the device ID
Open a terminal and run:
lsusb
Look for your Keychron (or QMK) device and note the ID. It looks something like this:
Bus 003 Device 003: ID 3434:0810 Keychron Keychron Q1 Max
Here, 3434 is the vendor ID and 0810 is the product ID.
Step 2: Add the environment variable in Prism Launcher
Create the file /etc/udev/rules.d/80-keychron-nojoystick.rules (as root):
SUBSYSTEM=="input", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0810", ENV{ID_INPUT_JOYSTICK}=""
Substitute your own IDs. The rule matches the keyboard's input device and clears the ID_INPUT_JOYSTICK property that udev sets on it, so nothing downstream treats it as a controller.
If you have multiple Keychron devices (keyboard, mouse, dongle), you can leave out ATTRS{idProduct}==... entirely and the rule will cover everything from that vendor.
Step 3: Reload the rules
sudo udevadm control --reload-rules && sudo udevadm triggerThen unplug and replug the keyboard (or reboot). Verify it worked with:
udevadm info /dev/input/event* | grep -B20 ID_INPUT_JOYSTICK
Your keyboard's entry should no longer carry ID_INPUT_JOYSTICK=1.
Alternative: per-application (SDL only)
If you'd rather scope the fix to a single SDL-based app, you can set an environment variable instead of touching udev. In Prism Launcher, under Settings > Minecraft > Environment Variables, add:
- Name:
SDL_GAMECONTROLLER_IGNORE_DEVICES - Value:
0x3434/0x0810(substitute your IDs)
This only affects apps that use SDL for controller input, which is why I prefer the udev rule.
Notes
- The connection method matters. Over Bluetooth the keyboard may report a different device ID than over USB, and Bluetooth devices won't appear in
lsusbat all. Check the IDs while connected the way you actually play.udevadm info --export-dbwill show the properties of whichever interface udev is currently flagging as a joystick. - Games that were already misbehaving may cache controller state; restart the game (not just the mod) after applying the rule.
- Some Hall-effect Keychron models have a separate issue where the
xpadkernel driver claims the board as an Xbox controller. If the udev rule doesn't take on your model, checkdmesg | grep -i xpad. That's a different bug with a different fix.