Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #105715
    deepdivered
    Participant

    hi i am making a handheld unit. i want to be able to also hook it up to a tv and have it be like a console. the handheld controls i am hooking up to the gpio. when i use it as a console i wanted to be able to hook in my xbox 360 wireless controller usb receiver and have it run up to 4 players.

    is there away to setup 2 sets of inputs for player 1? 1 for the gpio and another set for the xbox360 wireless controller? then when i plug in the wireless p1 will still work without having to reconfigure?

    if not what would be the best way to do this to make reconfiguring quick and easy.

    #105904
    DavidBowman
    Participant

    I would think you could do this with a script that detects the receiver has been plugged in (maybe polls lsusb?) and then in turn swaps (i.e. renames) controller config files (and maybe does the reverse upon disconnect).

    I’m not enough of a linux guru to give you all the commands you’d need, but I know this is doable. There are probably more elegant ways of doing this than constantly polling something (memory, CPU use), but unfortunately I have to defer to the real experts that know how. Perhaps you could add it to the Emulation Station menu the way kodi has been added and just run it manually when you need to switch. Not as automated, but much easier, I’m sure.

    Edit: Here’s a copy-paste for you:

    This explains how you could run a script made by you (say /usr/local/my_script) when you plug a specific USB device.

    1. First run lsusb to identify your device. Example:
    $lsusb
    Bus 004 Device 001: ID 0000:0000
    Bus 003 Device 001: ID 040a:0576 Kodak Co.
    Bus 002 Device 001: ID 0000:0000
    Bus 001 Device 001: ID 0000:0000

    2. After doing this you know that
    – the vendor ID of your device is 040a
    – the product ID of your device is 0576

    3. Now is time to create your UDEV rule:

    sudo nano /etc/udev/rules.d/85-my_rule.rules

    4. And add the text

    ACTION==”add”, SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”040a”, SYSFS{idProduct}==”0576″, RUN+=”/usr/local/my_script”

    Explanation:
    When the usb_device product identified as 0576 of vendor 040a is added, run /usr/local/my_script
    Note that ‘==’ and “!=” are comparators, while = and += are assingments

    ^ That will probably work, I would think.

    #115583
    deepdivered
    Participant

    thanks! i decided having a hand held with a controller going to it would be kinda silly , so i made a controller with enough buttons (16) to handle most games , wont be able to do any psx games that need 2 analog sticks…..oh well haha

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.