@aditkrator said in Changing Xbox driver based off game:
Parsec for Raspberry Pi
I hadn't heard of Parsec, but it looks like something similar to Moonlight, which I use (or did use, but ever since I updated to RetroPie 4.4 I can't seem to get it to work). I have quite a few individual bash scripts that invoke xboxdrv and then start moonlight and then individual games, so it can be done:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
--silent \
--detach-kernel-driver \
--deadzone=4000 \
--deadzone-trigger 15% \
--force-feedback \
--mimic-xpad \
--trigger-as-button \
--ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
--evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.2:1.0-event-joystick \
--device-name "Player_1" \
--evdev-absmap ABS_X=x1,ABS_Y=y1 \
--evdev-keymap BTN_THUMB=a,BTN_TOP=b,BTN_PINKIE=x,BTN_TRIGGER=y,BTN_THUMB2=back,BTN_TOP2=start \
--ui-axismap X1=KEY_DOWN:KEY_UP,Y1=KEY_RIGHT:KEY_LEFT \
--ui-buttonmap a=KEY_Z,b=KEY_E,x=KEY_X,y=KEY_Q,back=KEY_SPACE,start=KEY_ENTER \
--ui-buttonmap back+start=cycle-key:KEY_ESC:KEY_LEFTCTRL+KEY_LEFTSHIFT+KEY_LEFTALT+KEY_Q \
&
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
--silent \
--detach-kernel-driver \
--deadzone=4000 \
--deadzone-trigger 15% \
--force-feedback \
--mimic-xpad \
--trigger-as-button \
--ui-buttonmap rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
--evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.4:1.0-event-joystick \
--device-name "Player_2" \
--evdev-absmap ABS_X=x1,ABS_Y=y1 \
--evdev-keymap BTN_THUMB=a,BTN_TOP=b,BTN_PINKIE=x,BTN_TRIGGER=y,BTN_BASE=lb,BTN_THUMB2=back,BTN_TOP2=start \
--ui-axismap X1=KEY_F:KEY_R,Y1=KEY_G:KEY_D \
--ui-buttonmap a=KEY_S,b=KEY_P,x=KEY_A,y=KEY_W,back=KEY_J,start=KEY_H \
--ui-buttonmap back+start=cycle-key:KEY_ESC:KEY_LEFTCTRL+KEY_LEFTSHIFT+KEY_LEFTALT+KEY_Q \
&
sudo /opt/retropie/emulators/moonlight/moonlight stream -bitrate 5000 -audio local -720 -fps 30 192.168.0.5 -app "UnderDefeat"
moonlight quit 192.168.0.5
sudo killall > /dev/null 2>&1 xboxdrv
The above script invokes xboxdrv, maps out 2 of my joysticks as against keyboard inputs and then starts moonlight and, ultimately, the game Under Defeat via an emulator on my Windows 7 based PC.