diff --git a/game.sh b/game.sh index 439bffe7efe8aa1becad6e777283bf364fc17bf4..46c072f8e299c22087526c89bd7954bc47f19b79 100755 --- a/game.sh +++ b/game.sh @@ -8,11 +8,14 @@ export workingDirectory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" #(thanks http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in) cd $workingDirectory . ./config.sh +echo "Proove you are root…" +sudo sleep 0.1 if [ -e "$killProcessesScript" ] then - echo "There seems to be (a) running instance(s) of the game controller, do you want to brutally kill the processes? (Y/n)\nI'm not sure what it does if you don't…" + echo "There seems to be (a) running instance(s) of the game controller, do you want to brutally kill the processes? (Y/n)" + echo "I'm not sure what it does if you don't…" read userinput - if [ "$userinput" = "Y" ] + if [ "$userinput" = "Y" -o "$userinput" = "y" ] then sh $killProcessesScript rm $killProcessesScript @@ -51,6 +54,9 @@ else echo 1\) vvvvvv echo 2\) Braid echo 3\) Eggnogg + echo 4\) Metal Slug + echo 5\) Dustforce + echo 6\) Hotline Miami 2: Wrong Number echo 93\) Limbo echo 94\) Lone Survivor echo 95\) Minecraft @@ -80,6 +86,27 @@ then echo cd modules ./eggnogg.sh +elif [ "$userinput" = 4 -o "$userinput" = "MetalSlug" -o "$userinput" = "metalslug" -o "$userinput" = "metal" -o "$userinput" = "Metal" -o "$userinput" = "m" -o "$userinput" = "M" ] +then + echo "Your controllerS will now be configured for Metal Slug." +#Different types of controllers could be configured, but it's not my case so I won't do it ;) + echo + cd modules + ./metalslug.sh +elif [ "$userinput" = 5 -o "$userinput" = "Dustforce" -o "$userinput" = "dustforce" -o "$userinput" = "dust" -o "$userinput" = "Dust" -o "$userinput" = "d" -o "$userinput" = "D" ] +then + echo "Your controllerS will now be configured for Dust Force." +#Different types of controllers could be configured, but it's not my case so I won't do it ;) + echo + cd modules + ./dustforce.sh +elif [ "$userinput" = 6 -o "$userinput" = "Hotline" -o "$userinput" = "Miami" -o "$userinput" = "hotline" -o "$userinput" = "miami" -o "$userinput" = "hm2" -o "$userinput" = "HM2" ] +then + echo "Your controller will now be configured for Hotline Miami 2: Wrong Number." +#Different types of controllers could be configured, but it's not my case so I won't do it ;) + echo + cd modules + ./hotlinemiami2.sh elif [ "$userinput" = 93 -o "$userinput" = "Limbo" -o "$userinput" = "limbo" ] then echo "Your controller will now be configured for Limbo." diff --git a/modules/dustforce.sh b/modules/dustforce.sh new file mode 100755 index 0000000000000000000000000000000000000000..43e5e4d21764b8b06d165f729639f0231dfb6b34 --- /dev/null +++ b/modules/dustforce.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Define the default gamepad module name +module=xpad + +# Check if the module is already loaded, if so, remove it and run the xboxdrv module +if lsmod | grep -q "^$module " +then sudo rmmod xpad +fi + +if [ ! -e "$workingDirectory$killProcessesScript" ] +then + touch "$workingDirectory$killProcessesScript" +fi + +sudo xboxdrv -i 0 $pad -s -c dustforce1.xboxdrv --led 2 & +echo "controller1 is being handled by process number $!" +if [ -f "$workingDirectory$killProcessesScript" ] +then + echo "sudo kill $!" > "$workingDirectory$killProcessesScript" +fi +sudo xboxdrv -i 1 $pad -s -c dustforce2.xboxdrv --led 3 & +echo "controller2 is being handled by process number $!" +if [ -f "$workingDirectory$killProcessesScript" ] +then + echo "sudo kill $!" >> "$workingDirectory$killProcessesScript" +fi +sudo xboxdrv -i 2 $pad -s -c dustforce3.xboxdrv --led 4 & +echo "controller3 is being handled by process number $!" +if [ -f "$workingDirectory$killProcessesScript" ] +then + echo "sudo kill $!" >> "$workingDirectory$killProcessesScript" +fi \ No newline at end of file diff --git a/modules/dustforce1.xboxdrv b/modules/dustforce1.xboxdrv new file mode 100644 index 0000000000000000000000000000000000000000..638ef63d4947d8b34c373635eefbc9f3888e2aac --- /dev/null +++ b/modules/dustforce1.xboxdrv @@ -0,0 +1,29 @@ +[xboxdrv] +ui-clear=true +trigger-as-button = true + +[ui-axismap] +x1=KEY_LEFT:KEY_RIGHT +y1=KEY_UP:KEY_DOWN +x2^dead:6000 = REL_X:750:-1 +y2^dead:6000 = REL_Y:750:-1 + +# trigger^invert = rel-repeat:REL_WHEEL:1:50 + +[ui-buttonmap] +a = KEY_Z +x = KEY_X +rb = KEY_RIGHTCTRL +b = KEY_C +y = KEY_V + +[ui-buttonmap] +du = KEY_UP +dr = KEY_RIGHT +dd = KEY_DOWN +dl = KEY_LEFT + +[ui-buttonmap] +back = KEY_R + +# EOF # diff --git a/modules/dustforce2.xboxdrv b/modules/dustforce2.xboxdrv new file mode 100644 index 0000000000000000000000000000000000000000..77b3a253118b676ba3f217665a924374ab29132c --- /dev/null +++ b/modules/dustforce2.xboxdrv @@ -0,0 +1,29 @@ +[xboxdrv] +ui-clear=true +trigger-as-button = true + +[ui-axismap] +x1=KEY_K:KEY_SEMICOLON +y1=KEY_O:KEY_L +x2^dead:6000 = REL_X:750:-1 +y2^dead:6000 = REL_Y:750:-1 + +# trigger^invert = rel-repeat:REL_WHEEL:1:50 + +[ui-buttonmap] +a = KEY_U +x = KEY_G +rb = KEY_G +b = KEY_T +y = KEY_H + +[ui-buttonmap] +du = KEY_O +dr = KEY_SEMICOLON +dd = KEY_L +dl = KEY_K + +[ui-buttonmap] +back = KEY_R + +# EOF # diff --git a/modules/dustforce3.xboxdrv b/modules/dustforce3.xboxdrv new file mode 100644 index 0000000000000000000000000000000000000000..125c0e03fda0792a9790536fbbd66f8487ba48f3 --- /dev/null +++ b/modules/dustforce3.xboxdrv @@ -0,0 +1,29 @@ +[xboxdrv] +ui-clear=true +trigger-as-button = true + +[ui-axismap] +x1=KEY_F:KEY_D +y1=KEY_A:KEY_S +x2^dead:6000 = REL_X:750:-1 +y2^dead:6000 = REL_Y:750:-1 + +# trigger^invert = rel-repeat:REL_WHEEL:1:50 + +[ui-buttonmap] +a = KEY_Q +x = KEY_W +rb = KEY_1 +b = KEY_E +y = KEY_2 + +[ui-buttonmap] +du = KEY_A +dr = KEY_D +dd = KEY_S +dl = KEY_F + +[ui-buttonmap] +back = KEY_R + +# EOF # diff --git a/modules/dustforce_Controls/Dustforce qwerty 1.png b/modules/dustforce_Controls/Dustforce qwerty 1.png new file mode 100644 index 0000000000000000000000000000000000000000..9195fba538e0c0eba025a66c7fe6bac3134a35e6 Binary files /dev/null and b/modules/dustforce_Controls/Dustforce qwerty 1.png differ diff --git a/modules/dustforce_Controls/Dustforce qwerty 2.png b/modules/dustforce_Controls/Dustforce qwerty 2.png new file mode 100644 index 0000000000000000000000000000000000000000..9eacf9074a6186c160f19ace6a10a53f86817b3f Binary files /dev/null and b/modules/dustforce_Controls/Dustforce qwerty 2.png differ diff --git a/modules/dustforce_Controls/Dustforce qwerty3.png b/modules/dustforce_Controls/Dustforce qwerty3.png new file mode 100644 index 0000000000000000000000000000000000000000..0969c876c21643adc76e705a2ec0cce9ee7ee2d7 Binary files /dev/null and b/modules/dustforce_Controls/Dustforce qwerty3.png differ diff --git a/modules/eggnogg.sh b/modules/eggnogg.sh index 276891c8fa97d7659e2eb789754fc912adea3a0b..e44dc7aa121628c33531097ac64e0709fa2066c0 100755 --- a/modules/eggnogg.sh +++ b/modules/eggnogg.sh @@ -12,15 +12,22 @@ if [ ! -e "$workingDirectory$killProcessesScript" ] then touch "$workingDirectory$killProcessesScript" fi -sudo xboxdrv$pad -s -i 0 --led 2 & + +sudo xboxdrv -i 0 $pad -s --led 2 & echo "controller1 is being handled by process number $!" if [ -f "$workingDirectory$killProcessesScript" ] then echo "sudo kill $!" > "$workingDirectory$killProcessesScript" fi -sudo xboxdrv$pad -s -i 1 --led 3 & +sudo xboxdrv -i 1 $pad -s --led 3 & echo "controller2 is being handled by process number $!" if [ -f "$workingDirectory$killProcessesScript" ] +then + echo "sudo kill $!" >> "$workingDirectory$killProcessesScript" +fi +sudo xboxdrv -i 2 $pad -s --led 4 & +echo "controller3 is being handled by process number $!" +if [ -f "$workingDirectory$killProcessesScript" ] then echo "sudo kill $!" >> "$workingDirectory$killProcessesScript" fi \ No newline at end of file diff --git a/modules/hotline_miami_2_Controls/Capture du 2015-08-11 12:51:36.png b/modules/hotline_miami_2_Controls/Capture du 2015-08-11 12:51:36.png new file mode 100644 index 0000000000000000000000000000000000000000..3c0b226f32603aacfb33910b679054a0d26e6653 Binary files /dev/null and b/modules/hotline_miami_2_Controls/Capture du 2015-08-11 12:51:36.png differ diff --git a/modules/hotlinemiami2.sh b/modules/hotlinemiami2.sh new file mode 100755 index 0000000000000000000000000000000000000000..6d83ae02b6e251edae9d1b98e5a1a76e57340cad --- /dev/null +++ b/modules/hotlinemiami2.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Define the default gamepad module name +module=xpad + +# Check if the module is already loaded, if so, remove it and run the xboxdrv module +if lsmod | grep -q "^$module " +then sudo rmmod xpad +fi + +sudo xboxdrv$pad -c hotlinemiami2.xboxdrv -s --led 2 \ No newline at end of file diff --git a/modules/hotlinemiami2.xboxdrv b/modules/hotlinemiami2.xboxdrv new file mode 100644 index 0000000000000000000000000000000000000000..8c19acfb08ea4590274d124bc11c8ecd3c777830 --- /dev/null +++ b/modules/hotlinemiami2.xboxdrv @@ -0,0 +1,30 @@ +[xboxdrv] +ui-clear=true +trigger-as-button = true + +[ui-axismap] +x1=KEY_A:KEY_D +y1=KEY_W:KEY_S +x2^dead:6000 = REL_X:750:-1 +y2^dead:6000 = REL_Y:750:-1 + +# trigger^invert = rel-repeat:REL_WHEEL:1:50 + +#TODO mettre les autres contrôles ici… +[ui-buttonmap] +a = KEY_SPACE +x = KEY_RIGHTSHIFT +rb = KEY_RIGHTCTRL +lb = KEY_LEFTCTRL +rt = KEY_LEFTSHIFT + +[ui-buttonmap] +du = KEY_D +dr = KEY_RIGHT +dd = KEY_S +dl = KEY_A + +[ui-buttonmap] +back = KEY_ESC + +# EOF # \ No newline at end of file diff --git a/modules/metalslug.sh b/modules/metalslug.sh new file mode 100755 index 0000000000000000000000000000000000000000..76df3f6b75590e9eb19b682585ee5edde3fb9cd5 --- /dev/null +++ b/modules/metalslug.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Define the default gamepad module name +module=xpad + +# Check if the module is already loaded, if so, remove it and run the xboxdrv module +if lsmod | grep -q "^$module " +then sudo rmmod xpad +fi + +if [ ! -e "$workingDirectory$killProcessesScript" ] +then + touch "$workingDirectory$killProcessesScript" +fi + +sudo xboxdrv -i 0 $pad -s -c metalslug1.xboxdrv --led 2 & +echo "controller1 is being handled by process number $!" +if [ -f "$workingDirectory$killProcessesScript" ] +then + echo "sudo kill $!" > "$workingDirectory$killProcessesScript" +fi +sudo xboxdrv -i 1 $pad -s -c metalslug2.xboxdrv --led 3 & +echo "controller2 is being handled by process number $!" +if [ -f "$workingDirectory$killProcessesScript" ] +then + echo "sudo kill $!" >> "$workingDirectory$killProcessesScript" +fi \ No newline at end of file diff --git a/modules/metalslug1.xboxdrv b/modules/metalslug1.xboxdrv new file mode 100644 index 0000000000000000000000000000000000000000..4b348ddf96c57010d9ef8e52cadb3bf9849642c6 --- /dev/null +++ b/modules/metalslug1.xboxdrv @@ -0,0 +1,28 @@ +[xboxdrv] +ui-clear=true +trigger-as-button = true + +[ui-axismap] +x1=KEY_LEFT:KEY_RIGHT +y1=KEY_UP:KEY_DOWN +x2^dead:6000 = REL_X:750:-1 +y2^dead:6000 = REL_Y:750:-1 + +# trigger^invert = rel-repeat:REL_WHEEL:1:50 + +[ui-buttonmap] +a = KEY_RIGHTSHIFT +x = KEY_SPACE +rb = KEY_RIGHTCTRL +y = KEY_ENTER + +[ui-buttonmap] +du = KEY_UP +dr = KEY_RIGHT +dd = KEY_DOWN +dl = KEY_LEFT + +[ui-buttonmap] +back = KEY_ESC + +# EOF # diff --git a/modules/metalslug2.xboxdrv b/modules/metalslug2.xboxdrv new file mode 100644 index 0000000000000000000000000000000000000000..17fed2f99086f46ad470271190a471668dd89618 --- /dev/null +++ b/modules/metalslug2.xboxdrv @@ -0,0 +1,28 @@ +[xboxdrv] +ui-clear=true +trigger-as-button = true + +[ui-axismap] +x1=KEY_S:KEY_F +y1=KEY_E:KEY_D +x2^dead:6000 = REL_X:750:-1 +y2^dead:6000 = REL_Y:750:-1 + +# trigger^invert = rel-repeat:REL_WHEEL:1:50 + +[ui-buttonmap] +a = KEY_N +x = KEY_B +rb = KEY_V +y = KEY_G + +[ui-buttonmap] +du = KEY_E +dr = KEY_F +dd = KEY_D +dl = KEY_E + +[ui-buttonmap] +start = KEY_ESC + +# EOF #