RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Configuring own joystick input with python-uinput

    Scheduled Pinned Locked Moved Help and Support
    python-uinputcontrollerarcadearduinonano
    2 Posts 2 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      charlydj95
      last edited by

      Hi everyone

      I'm using Raspberry Pi 3 to make an arcade gaming console. I want to make it as modular as possible, which means I want to make the joystick separately, using an arduino nano v3. I don't want to use the GPIOs to send the button signals. What I want to do is create an USB controller with that arduino, send the signals through the serial port and receive them with a python program running in background, which will be the responsible of 'pressing' the correct keys in a virtual keyboard.

      I'm just at the beginning of the project. I have implemented a working program which successfully 'presses' the right arrow into the EmulationStation menu.

      The code I've been using is here, and I execute it in the /usr/bin/emulationstation script (python program &):

      https://pastebin.com/N5GNjuv4

      It's simple, it was just a test to make sure everything was correct. But to my surprise, when I start a game, the button 'pressed' is not recognised by the game. I know the python program is still running because when I exit from the game, it keeps changing the emulationstation menu. I've tryed to execute the program again at the runcommand-onstart script, but it didn't work.

      So here is my question: Is there any way to send that keypress to the emulator? What am I doing wrong?

      Thanks in advance

      PD: I'm using Raspberry pi 3, my psu is the official one (2 Amp), the os is the premade sd image from the web, and I have tryed it with several emulators. I load the uinput module before running the program, and as I have said before, the program works fine in emulationstation menu. I have been searching for a while and I couldn't find any useful information about that

      1 Reply Last reply Reply Quote 0
      • G
        GAMELASTER
        last edited by

        Hello, are you sure that emulator have binded "right key" ? I mean, if emulator doing something when you press right arrow on keyboard?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.