4

I'm trying to configure my new Dualshock 4 controller using xboxdrv.

It shows up as a generic gamepad and I'd like to map the events to the corresponding 360 events.

I've managed to map the axis correctly, but the button presses are not working. I used the example DS3 configuration from xboxdrv's repo, pointing the /dev/ to the correct device.

#!/bin/sh

# Example configuration for the Playstation 3 controller
#
# Note this only works when connected with USB, when using Bluetooth a
# different configuration is required.

xboxdrv \
  --evdev /dev/input/by-id/usb-Sony_Computer_Entertainment_Wireless_Controller-event-joystick \
  \
  --evdev-absmap ABS_X=x1,ABS_Y=y1 \
  --evdev-absmap ABS_Z=x2,ABS_RZ=y2 \
  --evdev-absmap ABS_#48=lt,ABS_#49=rt \
  \
  --evdev-keymap BTN_THUMB=tl,BTN_THUMB2=tr \
  --evdev-keymap BTN_BASE5=lb,BTN_BASE6=rb \
  --evdev-keymap KEY_#1=a,KEY_#0=b,KEY_#2=x,KEY_#3=y \
  --evdev-keymap BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start \
  --evdev-keymap BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
  \
  --axismap -y1=y1,-y2=y2 \
  "$@"

# EOF #

Any advice?

2 Answers 2

2
# Playstation 4 Controller
# ========================

[xboxdrv]
# Using the 'by-id' name is recomment, as it is static, while an
# /dev/input/eventX name can change depending on what other USB
# devices you use.
evdev = /dev/input/by-id/usb-Sony_Computer_Entertainment_Wireless_Controller-event-joystick

# This displays events received from the controller, if you are
# working on a configuration you want to set this to true:
evdev-debug = true

# Grabbing the device prevents other applications from accessing it,
# this is needed most of the time te prevent applications from
# receiving events twice.
evdev-grab = true

[evdev-absmap]
ABS_HAT0X = dpad_x
ABS_HAT0Y = dpad_y

ABS_X = X1
ABS_Y = Y1

ABS_Z = X2
ABS_RZ = Y2

ABS_RX = LT
ABS_RY = RT

[evdev-keymap]
BTN_TL = LT
BTN_TR = RT
BTN_A = X
BTN_X = Y
BTN_B = A
BTN_C = B

BTN_Y = LB
BTN_Z = RB

BTN_SELECT = TL
BTN_START = TR

BTN_TR2 = start

BTN_TL2 = back

BTN_MODE = guide

The above is what i use. Seems to work great when used with --mimic-xpad. It also works great for SteamOS and a few games. But then there are a bunch of games which will not use the new mappings at all, such as Teleglitch or Proteus.

I very much hope that Valve forces an input standard library on developers for linux so that they all use the same input libs.

0

After so many years, I found myself with the same issue, but now it can be solved easily.

There are more options, it is worth to have a look at the README, but this solved it for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .