Controlling Whiptail with Controller Input 2019
-
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,
-
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 ?
-
@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
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.