Skip to content

Instantly share code, notes, and snippets.

@bergamote
Last active June 1, 2016 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bergamote/6767367 to your computer and use it in GitHub Desktop.
Save bergamote/6767367 to your computer and use it in GitHub Desktop.
DirectInput to XInput for one or more Logitech Cordless Precision gamepad(s), using xboxdrv as suggested here: http://redd.it/1k1xe9
#!/bin/bash
CONFIG=" --evdev-absmap \
ABS_X=x1,ABS_Y=y1,ABS_RZ=y2,ABS_Z=x2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
--axismap -Y1=Y1,-Y2=Y2 \
--evdev-keymap \
BTN_X=y,BTN_C=b,BTN_A=x,BTN_B=a,BTN_TL2=back,BTN_TR2=start,BTN_MODE=guide,BTN_Y=lb,BTN_Z=rb,BTN_TL=lt,BTN_TR=rt,BTN_SELECT=tl,BTN_START=tr \
--mimic-xpad --silent"
ls /dev/input/by-path | grep event-joystick | while read -r line ; do
xboxdrv --evdev /dev/input/by-path/$line $CONFIG &
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment