RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Controlling Whiptail with Controller Input 2019

    Scheduled Pinned Locked Moved General Discussion and Gaming
    retro pie
    3 Posts 3 Posters 73 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.
    • D
      Dembered
      last edited by

      Hello everyone,,
      I'm creating a online radio shell script using Whiptail for the GUI but I can not figure out how to get controller input working.

      I've had a look at the source code for the Retropie-Setup but I'm having no luck.

      Could someone please point me in the right direction?

      Current progress: radio.sh
      (Also please scrutinize my bash code, first time writing it)

      Cheers,

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        There's no code attached ? Did you mean to provide a link to it ?

        RetroPie uses a separate Python script that deals with gamepad handling (see here), but it relies on the mapping set-up already for RetroArch so it's not just a drop-in to be used in any script.

        Do you already have RetroPie installed ?

        1 Reply Last reply Reply Quote 1
        • cyperghostC
          cyperghost
          last edited by cyperghost

          @mitu Good point.

          @Dembered I've created a small script that enables the control for Midnight Commander with joypads... --> Midnight Joy!
          There you see the script invoked that mitu talked about.

          Edit:

          #Code Snipplet
          #Path to script
          readonly JOY2KEY_SCRIPTLOC="$HOME/RetroPie-Setup/scriptmodules/helpers.sh"
          #Key Config, 4xdpad, enter,F10,space,F9) --> change layout here
          readonly CONFIG=(kcub1 kcuf1 kcuu1 kcud1 0x0a kf10 0x20 kf9)
          
          # --------- JOYS ---------
          # Import from RetroPie setup, uses joy2keyStart and joy2keyStop
          # scriptdir is  used by joy2key
          if [[ -f $JOY2KEY_SCRIPTLOC ]]; then
              source "$JOY2KEY_SCRIPTLOC"
              scriptdir="$HOME/RetroPie-Setup"
              joy2keyStart ${CONFIG[@]}
          else
              echo "Can't import Joy2Key Script! Error!"
              echo "Script not found in: $JOY2KEY_SCRIPTLOC"
              sleep 5; exit 1
          fi
          
          -
          - YOUR CODE
          -
          
          #Important stop that devil!
          joy2keyStop
          
          
          1 Reply Last reply Reply Quote 2
          • 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.