DARK SOULS™ II: Scholar of the First Sin

DARK SOULS™ II: Scholar of the First Sin

26 ratings
Fix Controller Not Working on Linux with Keychron Keyboards / Mice
By Pixelguin
A quick test and an easy fix for a niche incompatibility with Keychron keyboards and mice that causes controllers not to work with Dark Souls II on Linux. Updated with an even easier fix!
5
3
3
2
2
2
4
   
Award
Favorite
Favorited
Unfavorite
It's My Keyboard/Mouse!?
If you:
  • Are playing Dark Souls II on Linux
  • Are unable to get your controller recognized by the game
  • Are using a Keychron keyboard and/or mouse
it very well might be your Keychron device causing the controller issue!

For some reason, Keychron's udev rules in Linux cause their devices to be viewed as joysticks by the OS. DS2 might be recognizing your keyboard and/or mouse as a gamepad, and it only responds to the first controller it sees.

So what can I do?
We'll run a quick test to see if this is the fix you're looking for.
If it is, this guide will provide an easy fix for it.

Will I have to use the terminal to fix it?
Yes, but don't worry! This guide has been updated with a new fix, and now you only need to run a single easy command in the terminal.

Do I need sudo (administrator) access to apply the fix?
Not anymore! The new fix does not require creating any files in system directories.
A Quick Test
I want you to try something a little silly:
  • If Dark Souls II is open, close it.
  • Start Dark Souls II with your controller connected.
  • Once the game window appears, but before you reach the title screen ("DARK SOULS II" text), unplug all of your Keychron devices: keyboards, mice, and wireless dongles.
If your controller works now, with your Keychron devices disconnected, Linux is treating your Keychron devices as joysticks (and once Dark Souls II finds a joystick, it stops looking).

You could just unplug your keyboard like this every time you wanted to play Dark Souls II, but that would really stink. For a permanent fix, read on…
A Permanent Fix
We're going to add a libsdl hint[wiki.libsdl.org] that tells Dark Souls II not to treat your Keychron device(s) as a controller, no matter what.

Get Your ID Values
Every USB device has a vendor ID and a product ID. You need both to create a libsdl hint.
  • Reconnect your keyboard and open a terminal window.
  • List all connected Keychron USB devices by running this joint command:
lsusb | grep Keychron
  • lsusb: List connected USB devices
  • | (pipe): Pass the output of the previous command to the next command
  • grep Keychron: Filter the output: only print lines that have "Keychron"

You should get an output with one or more lines like this:
Bus 001 Device 015: ID 3434:d030 Keychron Keychron Link Bus 003 Device 002: ID 3434:0361 Keychron Keychron V6
  • Look for the ID values separated by a colon.
In my example, there are two ID values:
  • The vendor ID of the Keychron Link adapter is 3434 and the product ID is d030.
  • The vendor ID of the V6 keyboard is 3434 and the product ID is 0361.
You might see only one entry or even more than two, depending on how many Keychron devices you use or whether they're wireless.
  • Make a note of all your vendor + product ID pairs.

Create a libsdl Hint
  • Open the Properties window for Dark Souls II by right-clicking the entry in your Steam library and selecting Properties...
  • Under Launch Options, add this text:
    • List every Keychron vendor + product ID pair, separated by commas.
    • Add 0x before each ID value.
    • Make sure to use your ID values, not mine!
SDL_GAMECONTROLLER_IGNORE_DEVICES=0x3434/0xd030,0x3434/0x0361 %command%
If you already have other launch options, put this one right before %command% at the end.
For example, if you're using the Blue Acolyte mod, your Launch Options might look like this:
WINEDLLOVERRIDES="DINPUT8=n,b" SDL_GAMECONTROLLER_IGNORE_DEVICES=0x3434/0xd030,0x3434/0x0361 %command%

All done!
You should now be able to play DS2 with a controller, without having to disconnect your Keychron keyboard or mouse.