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

    [SOLVED] Trying to use joystick to navigate File Manager aka Midnight Commander...

    Scheduled Pinned Locked Moved Help and Support
    helpruncommandjoy2key.py
    4 Posts 2 Posters 4.0k 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.
    • elrichardE
      elrichard
      last edited by elrichard

      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!

      1 Reply Last reply Reply Quote 0
      • elrichardE
        elrichard
        last edited by elrichard

        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.

        S 1 Reply Last reply Reply Quote 1
        • S
          spud11 @elrichard
          last edited by

          @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?

          RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

          elrichardE 1 Reply Last reply Reply Quote 0
          • elrichardE
            elrichard @spud11
            last edited by

            @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 :(

            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.