Please do not post a support request without first reading and following the advice in

Looking to use simulate keypress/keyrelease from remote machine (Raspian Jessie)

  • Sorry this will likely be a noob question (this is day 2 working with either linux/Raspian Jessie or RetroPie), I'm trying to have a python script running in the background that is a client talking to another machine that acts as player 2. Other machine 'presses a' and I match that to my binding for input_player2_a. So far I haven't had much success getting a keystroke to happen. The closest I got was xdotool which would have worked great if it worked without the PIXEL UI, or if RetroPie would work in PIXEL. This appears to be the last part of the puzzle for me and I'm sort of beating my head against the wall, unless of course I run into something after this.

    If anyone has ideas or knows where to start that would be much appreciated. Thanks.

  • Just to clarify a few things, there are a couple avenues that would provide a solution for my use case:

    1. There is something I can do from command line / python that would emulate a keypress that doesn't require X
    2. RetroPie can work as the same time as X
    3. RetroPie has some sort of API for outside multiplayer
      4*. It's actually wired to a Crestron control system and another PC is also in the system. I can use a discontinued Crestron wedge if I can find one on ebay or if there's something I can do from Windows PC to Raspbian. I don't know much about wedges but I guess there's no better time to learn. I don't want to do this but if I have to I guess I can
      5* I can certainly use another emulator for a windows machine whether or not it's Retro. I just have a Pi that I did nothing with since I got it years ago, it's wired and dressed in. I also spent a couple days working on getting it up from Weezy to Jessie and figuring out how to work the thing and figuring out how Retro works to manipulate the config files to add other player controllers etc.
  • Global Moderator

    may help:

    i think your plan wouldn’t work as both systems would need to remain in sync somehow. you need a proper netplay system for that.

  • Thanks for the resource, this will definitely be something I'm looking into for another possible project. You are absolutely right about the syncing of two being a problem. As weird as my use case is, I only need one Raspberry (from a kooky angle, the video is being distributed to one/both players). After looking into wedges I think that's the route I'm going to go as I easily have access to USB HID injectors at work/off ebay I can utilize that I didn't realize I could use. Thanks for the link though, I'll definitely be using it.

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.