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

    How can I make the controller send keypresses?

    Scheduled Pinned Locked Moved Help and Support
    gnashflashswfkeyboardkeystroke
    5 Posts 2 Posters 522 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.
    • W
      WesleyBidsnipes
      last edited by

      I followed instructions on how to set up gnash to play Flash games. And I was a little surprised when I got it to work... Trogdor comes up and I see the opening screen and hear the music.

      However, it was always a keyboard-based game (as many of the Flash games are, the rest probably being mouse-based).

      Is there a way to have the controller send key presses? I'd need to have the d-pad send arrow keys, and maybe the start button to send the space keystroke.

      Also (and I don't know if this is a related problem), but when I try to exit out by pressing the start+select, it will not exit out of gnash (unlike with the other emulators). What should I check for that?

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @WesleyBidsnipes
        last edited by

        @WesleyBidsnipes Probably using xboxdrv - https://retropie.org.uk/docs/Universal-Controller-Calibration-%26-Mapping-Using-xboxdrv/

        1 Reply Last reply Reply Quote 0
        • W
          WesleyBidsnipes
          last edited by

          I've been able to get xboxdrv installed... and I think I understand which command line switches I need for this.

          But it can only run once X is up and running (not a problem, gnash needs it too). My emulators.cfg looks like this:

          gnash = "sudo xinit -e 'gnash %ROM% -j 640 -k 480 --hide-menubar' -- :0"
          default = "gnash"
          

          But I don't know how to have this run after X has already started. Simply appending it to the command with a semicolon fails (X probably hasn't initialized yet, and it flunks out). What would be the best way to do this?

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            Running sudo with a X is a bad idea - you certainly don't need it in order to make it work. With a recent version of RetroPie, prefix the command with XINIT: and runcommand will take care of launching the game properly, starting X beforehand.

            gnash = "XINIT:gnash %ROM% -j 640 -k 480 --hide-menubar"
            default = "gnash"
            

            But I don't know how to have this run after X has already started.

            How are you running xboxdrv ? Is it running as service/demon or via onstart/onend ?
            Try adding the xboxdrv command to $HOME/.xesssionrc and make sure you're adding a & at the end (background execution).

            W 1 Reply Last reply Reply Quote 0
            • W
              WesleyBidsnipes @mitu
              last edited by

              @mitu .xsessionrc doesn't seem to execute. Does it need to be chmod +x? I've got the game up on the screen now, and when I do ps ax I don't see the xboxdrv process... and it's not showing in the /dev/shm files either.

              The XINIT: prefix seems to work though, it will still bring up the game at least as well as it did before.

              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.