Jump to content
The Dark Mod Forums

Linux users: control TDM any *any* game with a gamepad like this.


lost_soul

Recommended Posts

It has always seemed dumb to have to configure a gamepad/joystick for every single game you want to play. Why not make the right-stick control your mouse, and the left control WASD? You can also assign other keys on the joypad to whatever keys/mouse buttons you like. I accomplished this by installing the xserver-xorg-input-joystick package.

 

You'll get a default configuration that is less than optimal, so we'll customize it. Do not customize /etc/X11/xorg.conf! If you have a section in there that references /dev/input/js0 and your joystick is not plugged in when X starts, it will fail to start. Instead, look to /usr/share/X11/xorg.conf.d/50-joystick.conf. This file stores the configuration for the driver. Setting it up isn't as easy as it could be. You need to know the keycodes for the events you want to bind, along with the names of the buttons on your gamepad. You can find the names of the keys on your keyboard by looking in the keycode at /usr/share/X11/xkb/keycodes. To get the name of a given button when you press it on the gamepad, install and use jstest.

 

What follows is my /usr/share/X11/xorg.conf.d/50-joystick.conf file.

 

Section "InputClass"

Identifier "joystick catchall"

MatchIsJoystick "on"

MatchDevicePath "/dev/input/event*"

Driver "joystick"

Option "MapAxis1" "mode=accelerated keylow=38 keyhigh=40"

Option "MapAxis2" "mode=accelerated keylow=25 keyhigh=39"

Option "MapAxis3" "mode=relative axis=+1x deadzone=5000"

Option "MapAxis4" "mode=relative axis=+1y deadzone=5000"

Option "MapAxis5" "mode=accelerated keylow=34 keyhigh=35"

Option "MapAxis6" "mode=accelerated keylow=52 keyhigh=53"

Option "MapButton6" "button=1"

Option "MapButton8" "key=37"

Option "MapButton7" "key=41"

Option "MapButton5" "button=2"

Option "MapButton2" "key=26"

Option "MapButton1" "key=54"

Option "MapButton4" "button=3"

Option "MapButton11" "key=24"

Option "MapButton12" "key=27"

Option "MapButton9" "key=23"

Option "MapButton10" "key=9"

Option "MapButton3" "key=29"

EndSection

 

With this configuration: Your left stick is WASD, your D-pad is ,. and []. Your face buttons are mouse 1,2,c and e (I think). Your L3 and R3 are q and r for leaning. Your L1/2/R1/2 buttons are Control, F, Mouse 1, and something which I forgot. Your start and select are escape and tab, for showing the objectives and pausing the game.

 

It took me a few hours to get all this crap working well, so perhaps it will help someone.Now we have a tiny driver that runs in the background and enables all of this on the fly. No bloated software required!

Edited by lost_soul

--- War does not decide who is right, war decides who is left.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
    • nbohr1more

      Trying to be productive on my down-time before Capcom releases Akuma and my son is constantly on my PC playing Street Fighter...
      · 1 reply
    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 4 replies
×
×
  • Create New...