Mapping java games in Retropie with joy2key
-
Hi,
I play to java games in Retropie.
I would like mapping a GamePad to a KeyBoard, I have tried use joy2key but don't work.
I have this:
- emulators.cfg:
java = "/opt/retropie/configs/java/joy2key_init.sh; sudo xinit -e 'java -Xms384M -Xmx384M -jar %ROM%' -- :0" default = "java"
- joy2key_init.sh
echo "Init joy2key_init.sh" >> /dev/shm/runcommand.log sudo pkill -f joy2key echo "Kill possible running joy2key processes" >> /dev/shm/runcommand.log sleep 5 readonly JOY2KEY_SCRIPTLOC="/home/pi/RetroPie-Setup/scriptmodules/helpers.sh" # Config: # DPAD = Cursors (kcub1 kcuf1 kcuu1 kcud1) # A = Space (ASCII 32 -> HEXADECIMAL 0x20) # B = Enter (ASCII 10 -> HEXADECIMAL 0x0a) # X = Escape (ASCII 27 -> HEXADECIMAL 0x1b) # Y = F1 (kf1) readonly CONFIG=(kcub1 kcuf1 kcuu1 kcud1 0x20 0x0a 0x1b kf1) if [[ -f $JOY2KEY_SCRIPTLOC ]]; then echo "Script $JOY2KEY_SCRIPTLOC found" >> /dev/shm/runcommand.log source "$JOY2KEY_SCRIPTLOC" scriptdir="/home/pi/RetroPie-Setup" joy2keyStart ${CONFIG[@]} echo "joy2key throw" >> /dev/shm/runcommand.log else echo "Script $JOY2KEY_SCRIPTLOC NOT found" >> /dev/shm/runcommand.log fi echo "Exit joy2key_init.sh" >> /dev/shm/runcommand.log
I know that the script runs correctly, because I have threw Midnight Commander after of joy2key_init.sh and works with GamePad, but java games no.
Any idea??
Thanks
-
joy2key
is working with the console terminal, not with X11 applications.
Also, don't usesudo
to run any emulators orxinit
, it's not necessary and it will cause permissions issues. -
@mitu thanks a lot.
Oks, I will remove sudo.
Do you know any application to mapping keys that works with X11??
-
Hi,
I have read this in the Joy2key official documentation:
"joy2key monitors the joystick (normally /dev/input/js0) and sends keyboard events to an X window, terminal, or raw console. In the case of X, xwininfo(1) is used to retrive the window ID, which should not be a problem as this is a standard utility in most X11 distributions."
Then, does Joy2key must works with xinit??
-
@elias Which documentation are you referring to ?
-
Hi @mitu ,
I have tried with joy2key python script (joy2key.py) and with joy2key application (apt-get install joy2key).
The documentation where I have seen X window is the application documentation:
http://manpages.ubuntu.com/manpages/xenial/man1/joy2key.1.html -
@elias said in Mapping java games in Retropie with joy2key:
http://manpages.ubuntu.com/manpages/xenial/man1/joy2key.1.html
This is a different application, same name though, than the one shipped with RetroPie.
-
Hi @mitu ,
Yes, I know.
First, I tried with joy2key python script (joy2key.py) shipped with RetroPie, doesn't works.
Second, I tried with joy2key application (apt-get install joy2key), neither works.
What do you advise me?
-
Hi,
This is my configuration to joy2key application:
- emulators.cfg (like in python script ):
java = "/opt/retropie/configs/java/joy2key_init.sh; sudo xinit -e 'java -Xms384M -Xmx384M -jar %ROM%' -- :0" default = "java"
- joy2key_init.sh
echo "Init joy2key_init.sh" >> /dev/shm/runcommand.log sudo pkill -f joy2key echo "Kill possible running joy2key processes" >> /dev/shm/runcommand.log sleep 5 joy2key -rcfile /opt/retropie/configs/java/joy2keyrc -config java echo "Exit joy2key_init.sh" >> /dev/shm/runcommand.log
- joy2keyrc:
COMMON -thresh -32767 32767 -32767 32767 START java -X -dev /dev/input/js0 -buttons Space Escape Return -axis Left Right Up Down
Like in python script , if I throw Midnight Commander after of joy2key_init.sh then works with GamePad, but if I throw java games no.
-
I'm going to try with rejoystick (http://rejoystick.sourceforge.net/)
Do we know 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.