How can I make the controller send keypresses?
-
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?
-
@WesleyBidsnipes Probably using
xboxdrv
- https://retropie.org.uk/docs/Universal-Controller-Calibration-%26-Mapping-Using-xboxdrv/ -
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?
-
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 withXINIT:
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 thexboxdrv
command to$HOME/.xesssionrc
and make sure you're adding a&
at the end (background execution). -
@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.
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.