Issue using Xbox 360 controller and keyboard
  • Hi, I have received my raspberry pi 2 yesterday and I have installed piplay on it, work great! But I can't play with my friend, one with the controller and the other with the keyboard, because we are together 1 player.
    Any idea how to resolve this issue ? 1 player with the keyboard and 2 player with the Xbox 360 controller (Logitech ChillStream) ?
  • I have this same issue with PiFBA, both keyboard (X-Arcade which emulates keyboard) and Joystick 1 control player one. However in Mame4All-Pi this is not a issue at all.

    mholgatem has said it's possibly a issue with the config file.
    " You should be able to manually configure your controls by editing /home/pi/pimame/arcade.cfg "
    http://pimame.org/forum/discussion/1578/pifba-help-2-controllers-registering-as-player-1#Item_2
  • Thanks @gamerdad09. I'll check that after work.
  • I'm trying right now but which version of PiPlay did you have ? I've the latest version available but I don't find the "arcade.cfg".

    But I found in folder "/home/pi/pimame/controller-setup/output" a file called "snes.json" which contains key mapping for the keyboard and the joystick (an array of object).

    [
    {
    "A": { "keyname": "d", "type": 2, "key": 100, "mod": 0 },
    ...
    ...
    },
    {
    "A": { "joy": 0, "button": 1, "joystickID": null, "type": 10 }
    ...
    ...
    }
    ]
  • @fluxb0x - what emulator are you trying to get working with with 2 players?
  • @mholgatem I trying to use the SNES emulator
  • You need to go into /home/pi/pimame/emulators/pisnes/snes9x.cfg and manually change the settings
  • I don't understand the file at all. Please can you help me more with this?
  • The first 2 sections are player 1 and player 2 keyboard controls (each key is mapped to a number, check this page to see what is what, 999 means don't use)

    the next 2 sections are player 1 and player 2 joystick controls. These are the buttons and axis mapped to your controller.

    If you ran the controller config, then player 1 keyboard and player 1 joystick should both have the correct mappings, you just need to swap the mapping numbers from a player 1 to a player 2.

    For example, if you want keyboard to be player 2, swap all of the keyboard player 1 mappings with the keyboard player 2 mappings

    if player 1 keyboard looks like this:
    A_1=13
    B_1=117
    X_1=98
    Y_1=104
    L_1=107
    R_1=108
    START_1=110
    SELECT_1=111
    LEFT_1=276
    RIGHT_1=275
    UP_1=273
    DOWN_1=274

    and player 2 keyboard looks like this:
    A_2=101
    B_2=120
    X_2=116
    Y_2=105
    L_2=109
    R_2=110
    START_2=106
    SELECT_2=112
    LEFT_2=97
    RIGHT_2=100
    UP_2=119
    DOWN_2=115

    then you need to swap:
    A_1 = 101 and A_2 = 13
    B_1 = 120 and B_2 = 117
    etc.

  • Hi, thank you very much for your help, but I just saw that this configuration file "snes9x.cfg" is always rewritten when you start a game. Any idea to avoid this ?
  • More info:

    + boot raspberry + piplay
    + tab button to update SNES controller (1-keyboard, 2-Xbox 360 controller)
    + exit piplay
    + edit configuration file snes9x.cfg in folder "pimame/emulators/pisnes"
    + sudo reboot
    + launch a 2 players game (Final Fight 3)
    + both controller still the 1 player (configuration file has been overwrite I think)
  • no, the config file only ever gets overwritten if you run the controller config. Running a game or restarting your pi won't overwrite it.
  • I'm really confused. I did what you told but the keyboard and the xbox 360 controller are one player.
    I have a fresh install of PiPlay 0.8.0 Beta 7 with Xbox 360 controllers activated (PiPlay menu) on my Raspberry Pi 2 Model B and here is my snes9x.cfg file for the controllers.

    [Keyboard]
    # Get codes from /usr/includes/SDL/SDL_keysym.h
    A_1=999
    B_1=999
    X_1=999
    Y_1=999
    L_1=999
    R_1=999
    START_1=999
    SELECT_1=999
    LEFT_1=999
    RIGHT_1=999
    UP_1=999
    DOWN_1=999
    QUIT=999
    ACCEL=999

    # player 2 keyboard controls
    A_2=107
    B_2=106
    X_2=105
    Y_2=117
    L_2=121
    R_2=111
    START_2=109
    SELECT_2=112
    LEFT_2=113
    RIGHT_2=100
    UP_2=122
    DOWN_2=115

    [Joystick]
    # Get codes from "jstest /dev/input/js0"
    # from package "joystick"
    # player 1 joystick controls
    A_1=1
    B_1=0
    X_1=3
    Y_1=2
    L_1=4
    R_1=5
    START_1=7
    SELECT_1=6
    #Joystick axis
    JA_LR_1=0
    JA_UD_1=1

    # player 2 joystick controls
    A_1=0
    B_1=1
    X_1=2
    Y_1=3
    L_1=4
    R_1=6
    START_1=9
    SELECT_1=8
    #Joystick axis
    JA_LR_1=0
    JA_UD_1=1

    ...
    ...
  • Still can't get both keyboard and Xbox 360 wired controller to be distinct player. I have tried multiple configuration with the snes9x.cfg (https://gist.github.com/igorissen/2ba54c7c82d9355f74ca#file-snes9x-cfg) player 1 as joystick and player 2 as keyboard, player 1 as keyboard and player 2 as joystick. I'm using PiPlay v0.8.0b8.
  • The emulator might not be able to handle that sort of setup. If you have tried all of that, I would suspect that it needs both players to be on the same sort of setup. It's been a while since I looked at it's source code, but that's all that I can think.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!