Skip to content

Instantly share code, notes, and snippets.

@tastytea
Last active September 11, 2017 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tastytea/5dcad9b29306433e553bae3f4f7b54cb to your computer and use it in GitHub Desktop.
Save tastytea/5dcad9b29306433e553bae3f4f7b54cb to your computer and use it in GitHub Desktop.
Use XBOX controller as mouse
# Use an XBOX controller as mouse in X.Org
Section "InputClass"
Identifier "Joystick"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "StartKeysEnabled" "True"
Option "StartMouseEnabled" "True"
Option "MapButton1" "key=36" # A – Return
Option "MapButton2" "key=22" # B – BackSpace
Option "MapButton3" "key=122" # X – XF86AudioLowerVolume
Option "MapButton4" "key=123" # Y – XF86AudioRaiseVolume
Option "MapButton5" "button=1" # LB – Mouse L
Option "MapButton6" "button=3" # RB – Mouse R
Option "MapButton7" "key=9" # Back – Escape
Option "MapButton8" "key=65" # Start – Space
Option "MapButton9" "button=2" # Home – Mouse M
Option "MapButton10" "key=24" # LStick – q
Option "MapButton11" "key=156" # RStick – XF86Launch1
Option "MapAxis1" "mode=relative axis=+1x deadzone=5000" # LStick H – Mousepointer X
Option "MapAxis2" "mode=relative axis=+1y deadzone=5000" # LStick V – Mousepointer Y
Option "MapAxis4" "mode=relative axis=+1zx deadzone=5000" # RStick H – Scroll X
Option "MapAxis5" "mode=relative axis=+1zy deadzone=5000" # RStick V – Scroll Y
Option "MapAxis3" "mode=accelerated keyhigh=37" # Trigger L – Control_L
Option "MapAxis6" "mode=accelerated keyhigh=64" # Trigger R – Alt_L
Option "MapAxis7" "mode=accelerated keylow=113 keyhigh=114" # DPAD H – Left Right
Option "MapAxis8" "mode=accelerated keylow=111 keyhigh=116" # DPAF V – Up Down
EndSection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment