Required PS3 Controller Button Mapping

I'm trying to use a PS4 controller with Monsterborg. The button mapping for the PS4 controller (based on jstest /dev/input/js0) is: Button 1 is Circle, B2 is Triangle, B3 is Square, B4 is L1, B5 is R1, B6 is L2, B7 is R2, B8 is Share, B9 is Options, B10 is PS Button, B11 is Left Joystick Enter, B12 is Right Joystick Enter, Left Joystick uses Axes 0 and 1, Right Joystick uses Axes 3 and 4, Left and Right Arrows use Axis 6, Up and Down Arrows use Axis 7. How should I remap the PS4 controller to look like a PS3 controller so it properly controls the Monsterborg?

piborg's picture

The good news is that most of the mappings are the same, there are just a couple of numbers to change to make everything work correctly :)

These are the settings we use when controlling MonsterBorg from a standard PS4 controller:

# Settings for the joystick
axisUpDown = 1                          # Joystick axis to read for up / down position
axisUpDownInverted = False              # Set this to True if up and down appear to be swapped
axisLeftRight = 2                       # Joystick axis to read for left / right position
axisLeftRightInverted = False           # Set this to True if left and right appear to be swapped
buttonSlow = 6                          # Joystick button number for driving slowly whilst held (PS4 L2)
slowFactor = 0.5                        # Speed to slow to when the drive slowly button...
buttonFastTurn = 7                      # Joystick button number for turning fast (PS4 R2)
interval = 0.00                         # Time between updates in seconds...

Only the L2 and R2 values are changed, the two axes have the same values as a PS3 controller.

Based on your answers it sounds like your right joystick may be mapped differently to ours. If the steering does not work, for example left stick up and right stick to the left goes forward, you may need to change the axisLeftRight number as well. If so the value to use will be 3.

Subscribe to Comments for "Required PS3 Controller Button Mapping"