Unable to control shell script with controller if the script is in "Ports"
-
RetroPie 4.3.4
Raspberry Pi 3So whenever I have a shell script with a dialog menu (multiple options to choose from) it works just fine with my controller when I have it in the /home/pi/RetroPie/retropimenu folder, but when I move the same shell script to the /home/pi/RetroPie/roms/ports folder I am only able to navigate the dialog using the keyboard.
What I have tried:
creating a symlink from the working script to the ports folder (ln -s source_file destination_file)
messing with permissions/ownership
"resetromdirs" from retropie script
trying different scripts
creating a blank script with only the menu in itIs this some kind of "security feature"? Is there any way I can fix this? I don't want to have to move all my shell scripts that require input into the retropiemenu section.
Thanks guys!
-
@madmodder123 I think the RP dialog scripts are called after a 'joystick to keyboard' wrapper so that the controller can navigate/give input.
See https://github.com/RetroPie/RetroPie-Setup/blob/08f9fc026a1d6718aba15d2f2a5b70be0195336b/scriptmodules/helpers.sh#L1003 -
@mitu That would make sense. Now I am trying to figure out how to use that code with my script. I tried copying the functions and then calling them in my script but the controller remained unresponsive. If anyone has any ideas I would love some help.
~ Thanks again
-
@psyke83
I saw that you have done some stuff on GitHub on the code listed above, could you please help me with this? I tried using using:source "/home/pi/RetroPie-Setup/scriptmodules/helpers.sh" and then calling "joy2keyStart" & "joy2keyStop" functions within my script.
I also tried copying both the joy2key functions from the helpers.sh file and calling then calling the functions but neither of these methods worked for me.
Just to reiterate the script works fine when in the retropiemenu folder, but the same working script does not work in the RetroPie/roms/ports folder.Thanks!
-
@madmodder123 Can you post your script to github or pastebin?
-
@madmodder123 said in Unable to control shell script with controller if the script is in "Ports":
@psyke83
I saw that you have done some stuff on GitHub on the code listed above, could you please help me with this? I tried using using:source "/home/pi/RetroPie-Setup/scriptmodules/helpers.sh" and then calling "joy2keyStart" & "joy2keyStop" functions within my script.
I also tried copying both the joy2key functions from the helpers.sh file and calling then calling the functions but neither of these methods worked for me.
Just to reiterate the script works fine when in the retropiemenu folder, but the same working script does not work in the RetroPie/roms/ports folder.Thanks!
Unfortunately, the joy2key functions aren't available when launching a "port" script. I recently identified a few scripts that display dialog messages (that require input to dismiss), and worked around the issue by adding a timeout: https://github.com/RetroPie/RetroPie-Setup/pull/2183
Take a look at my comment here to see what's necessary to get joy2key working in an external script: https://github.com/RetroPie/RetroPie-Setup/pull/2183#issue-270510263
It's vital that the $scriptdir variable is correctly set (by default, it should be "/home/pi/RetroPie-Setup"), otherwise joy2KeyStart will not work as expected.
As for the "retropiemenu", the reason why joy2key works is because your script is launched from here: https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/supplementary/retropiemenu.sh#L163
As you can see, joy2key will be running at this stage.
-
@psyke83 You are awesome, thanks a lot :)
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.