Skip to content

Instantly share code, notes, and snippets.

@Gnurou
Created September 16, 2013 04:48
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 Gnurou/6576773 to your computer and use it in GitHub Desktop.
Save Gnurou/6576773 to your computer and use it in GitHub Desktop.
X11 Joystick mappings for NVIDIA SHIELD. Allow to control mouse, scroll wheel, and main keyboard keys using the controller.
# JS config for NVIDIA SHIELD
# Axes:
# -----
# 1 Left stick H
# 2 Left stick V
# 3 Left trigger
# 4 Right stick H
# 5 Right stick V
# 6 Right trigger
# 7 Pad H
# 8 Pad V
#
# Buttons:
# --------
# 1 A
# 2 B
# 3 X
# 4 Y
# 5 L
# 6 R
# 7 Volume
# 8 Start
# 9 Left stick
# 10 Right stick
#
# Other buttons (Back, Home and NVIDIA central) are a GPIO keys device and are
# not handled by the JS driver.
Section "InputClass"
Identifier "NVIDIA SHIELD Gaming Controller"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "DebugLevel" "0"
Option "StartKeysEnabled" "True"
Option "StartMouseEnabled" "True"
# A is left click
Option "MapButton1" "button=1"
# B is right click
Option "MapButton2" "button=3"
# Y is middle-click
Option "MapButton4" "button=2"
# X is enter
Option "MapButton3" "key=36"
# L is escape
Option "MapButton5" "key=9"
# R is backspace
Option "MapButton6" "key=22"
# Left stick is cursor
Option "MapAxis1" "mode=relative axis=+1x deadzone=5000"
Option "MapAxis2" "mode=relative axis=+1y deadzone=5000"
# Left trigger does nothing
Option "MapAxis3" "mode=none"
# Right stick is scroll wheel
Option "MapAxis4" "mode=relative axis=+1zx deadzone=5000"
Option "MapAxis5" "mode=relative axis=+1zy deadzone=5000"
# Right trigger does nothing
Option "MapAxis6" "mode=none"
# Pad is keyboard left/right/up/down
Option "MapAxis7" "mode=accelerated keylow=113 keyhigh=114"
Option "MapAxis8" "mode=accelerated keylow=111 keyhigh=116"
EndSection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment