[SOLVED] Trying to use joystick to navigate File Manager aka Midnight Commander...
-
Greetings,
I have been trying to use the joystick to be able to operate mc by using the joystick.
Mapping the tab key, F5 and F10 should be enough to be able to copy files and exit.
I tried to add the additional keybindings to the joy2key invocation on runcommand.sh, however, it does not work for me.
Checking the
ps -ef | grep joy2key
output I can see that the options I am using are not being passed on to the execution, so my first assumption is that the runcommand.sh I am modifying is not the one that needs tweaking.
I modified the one in Retropie-Setup and the one in /opt/retropie/supplementary-something but when I run the File Manager option in ES, the execution of joy2key is done with the default settings.
Is there anything else I should be checking/doing? I am using one of those basic SNES USB controllers, and am trying to set the bindings by adding additional parameters to joy2key using the link mentioned in the documentation ( http://pubs.opengroup.org/onlinepubs/7908799/xcurses/terminfo.html )
Thanks!
-
OK, I sort of made it work.
Apparently, joy2key is already running when joy2key is invoked by the runcommand script. As such, the code after line 115 is never executed.
What I did was a very ugly hack that involves killing and immediately starting joy2key in the previous step, and then running it with my parameters.
I add this after line 114 of
/home/pi/RetroPie-Setup/scriptmodules/supplementary/runcommand/runcommand.sh
sudo pkill joy2key.py "$ROOTDIR/supplementary/runcommand/joy2key.py" "$JOY2KEY_DEV" kcub1 kcuf1 kcuu1 kcud1 0x0a 0x09 kf5 kf10 &
Since I only have 4 buttons to use, I ended up adding F5 (copy files) and F10 (exit).
I still was not able to find where joy2key is being invoked, but this hack should do.
I need to check if this does not screw up something else, and probably script updates will remove the hack, but for now I am OK.
Hope this helps anyone else out there.
-
@elrichard Is mc invoked via its own bash script? If so, rather than change the runcommand script which might have unintended consequences, could you not change mc's script to invoke joytokey instead?
-
@spud11 I am using the "Filemanager" menu option now. I created a bash script to test how runcommand worked.
But, if as you said, I can create a bash script to invoke joy2key and then mc, I might as well do that.
I did not expect that this kind of change would be so difficult to make :(
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.