ThisCalculator

Everyday

Linux HID Support: Controllers & Gaming Mice

Updated · Standard formula, shown below

Linux HID Support: Controllers & Gaming Mice

Linux HID (Human Interface Device) support determines how well controllers and gaming mice work. For most modern controllers (Xbox, PlayStation, Nintendo) and gaming mice, plug-and-play works via the generic HID driver, but advanced features like remapping buttons, adjusting DPI, or using gyroscopes require extra software or kernel modules. This article explains what works out of the box, what needs configuration, and how to get the most out of your devices.

How Linux HID Input Works

The Linux kernel includes a set of HID drivers that handle the basic communication between the OS and input devices. When you plug in a controller or mouse, the kernel’s HID subsystem reads the device’s report descriptor—a data structure that tells the system what buttons, axes, and features the device has. For standard devices, this works automatically, and the device appears as a joystick or mouse in /dev/input/.

For game controllers, the kernel has specific drivers for Xbox (xpad), PlayStation (hid-playstation), and Nintendo Switch (hid-nintendo) controllers. These drivers handle the proprietary protocols and expose the device as a standard gamepad via the evdev interface. Gaming mice usually use the generic HID mouse driver, which supports basic movement, buttons, and scroll wheel out of the box.

Advanced features—like RGB lighting, macro keys, or adjustable DPI—often require vendor-specific HID feature reports. The kernel may ignore these if the driver doesn’t implement them, which is why third-party tools exist.

Controller Support: What Works Out of the Box

Most mainstream controllers work with Linux using the built-in kernel drivers. Here’s a breakdown of common controllers and their default support:

  • Xbox Wireless Controller (Xbox One, Series X/S): Works via USB and Bluetooth using the xpad driver. All buttons, triggers, and rumble work. The Share button may not be mapped by default.
  • PlayStation DualShock 4 / DualSense: Works via USB and Bluetooth using hid-playstation. Touchpad, gyroscope, and adaptive triggers (DualSense) have partial support—some features need Steam Input or a tool like ds4drv.
  • Nintendo Switch Pro Controller: Works via USB and Bluetooth using hid-nintendo. Gyro and rumble work, but the capture button is not functional.
  • 8BitDo controllers: These are HID-compliant and work as generic gamepads in both XInput and DInput modes. Most buttons work, but some modes may require switching the controller’s mode switch.
  • Generic USB controllers: Most cheap USB gamepads use the standard HID protocol and work as a generic joystick with all buttons and axes recognized.

For Bluetooth controllers, the kernel uses the standard Bluetooth HID profile. Pairing is done via the system’s Bluetooth settings, and the controller appears as an input device. Some controllers (like the DualShock 4) need the hid-playstation module to be loaded, which is usually automatic.

Gaming Mice: Basic and Advanced Support

Gaming mice generally work as standard HID mice, meaning pointer movement, left/right/middle click, and scroll wheel function immediately. However, extra buttons (side buttons, DPI switch) may not work unless the mouse uses standard HID consumer controls. Many gaming mice have additional buttons that send vendor-specific usage codes, which the generic driver ignores.

For advanced features, you need tools that talk to the mouse’s HID interface directly:

  • DPI and polling rate: Some mice store these settings on the device and can be changed via the mouse’s onboard buttons. Others require software like libratbag and piper (for Logitech, Razer, etc.) or vendor-specific tools.
  • RGB lighting: This is controlled via HID feature reports. Tools like openrgb support many devices, but not all.
  • Macro keys: Some mice have programmable buttons that can be remapped via software. Generic tools like input-remapper can remap any button to any key or action at the system level.

For mice with onboard memory, you can often configure them once on another OS and the settings persist. For mice without onboard memory, you’ll need a Linux tool that can send the appropriate HID commands each time you plug in the mouse.

How to Choose and Configure Your Devices

When choosing a controller or gaming mouse for Linux, consider the following:

  • Controller: Xbox controllers have the most mature support. PlayStation controllers work well but may need extra steps for advanced features. Nintendo controllers are also supported but with fewer features.
  • Mouse: Look for mice that use standard HID buttons (not proprietary). Many gaming mice from Logitech, Razer, and SteelSeries have Linux support via open-source tools, but some budget mice may not.
  • Check compatibility: Search the Arch Wiki or the Linux Hardware Database for your specific model.

Configuration steps vary by device:

  1. Plug in the device and check if it’s recognized with lsusb or dmesg.
  2. For controllers, test with jstest or evtest to see if all buttons are mapped.
  3. If buttons are missing, consider using Steam Input (if you use Steam) or a tool like input-remapper to remap.
  4. For mice, install libratbag and piper to configure DPI and buttons. If your mouse isn’t supported, try openrgb for lighting or use the mouse’s onboard controls.

Common Problems and Fixes

Here are typical issues and how to resolve them:

  • Controller not detected: Try a different USB port, check if the kernel module is loaded (lsmod | grep xpad), or re-pair Bluetooth.
  • Buttons not working: Use evtest to see if the kernel receives the events. If not, the device may need a specific driver or a mode switch (e.g., Xbox controller in Bluetooth vs. USB).
  • Mouse DPI changes not saved: If your mouse has onboard memory, configure it on another OS. If not, use a tool like piper and set it to apply at login.
  • Gyro not working on DualSense: The kernel driver supports gyro, but many games don’t use it unless you use Steam Input or a custom mapping tool.
  • Rumble not working: Check if the driver supports force feedback. For Xbox controllers, the xpad driver does, but for some third-party controllers it may not.

Advanced Tools and Software

Beyond kernel drivers, several user-space tools extend HID functionality:

  • Steam Input: Provides per-game button mapping, gyro aiming, and controller profiles for most controllers. It works with Steam games and non-Steam games via the overlay.
  • input-remapper: A GUI tool to remap any input device (keyboard, mouse, gamepad) to other keys or macros at the system level.
  • libratbag/piper: A library and GUI for configuring gaming mice (DPI, buttons, lighting) for supported models.
  • OpenRGB: Controls RGB lighting on many devices, including mice and keyboards.
  • ds4drv: A userspace driver for DualShock 4 that enables extra features like touchpad emulation and custom mapping.

Frequently Asked Questions

Do Xbox controllers work on Linux?

Yes, Xbox One and Series X/S controllers work out of the box via USB and Bluetooth using the xpad kernel driver. All standard buttons, triggers, and rumble work. The Share button may not be mapped, but you can remap it with tools like input-remapper.

Why doesn’t my gaming mouse’s DPI button work?

The DPI button often sends a vendor-specific HID usage that the generic driver ignores. You need a tool like libratbag/piper if your mouse is supported, or use the mouse’s onboard controls if it has them. Some mice store DPI settings on the device, so you can change them on another OS and they persist.

Can I use a PlayStation controller on Linux?

Yes, DualShock 4 and DualSense work via USB and Bluetooth. The kernel driver supports basic input, rumble, and gyro. Advanced features like adaptive triggers on DualSense require Steam Input or a custom tool.

How do I remap buttons on a controller?

You can use Steam Input if you play through Steam, or use input-remapper to create system-wide remaps. For simple remapping, you can edit the device’s evdev mapping, but tools are easier.

Is there a way to make any mouse work on Linux?

Any standard HID mouse will work for basic movement and clicks. For extra buttons and DPI, you need vendor support or generic tools. If your mouse is not supported by libratbag, you may be able to use the mouse’s onboard software on another OS to configure it, then use it on Linux.

Why does my controller work in Steam but not in other games?

Steam Input intercepts the controller and provides its own mapping. For non-Steam games, you need to enable Steam Input for that game or use a system-level tool like input-remapper to create a virtual gamepad.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.