Have been trying to get xboxdrv running xbox360 controller in ubuntu 12.04.
The way i get xbox 360 controller running is by
Code:
sudo xboxdrv -s --ui-clear --deadzone 9000 --dpad-as-button --trigger-as-button --deadzone-trigger 15% --ui-axismap x1^resp:-32768:-4000:0:4000:32767 --ui-axismap "x2=REL_X:25:25,y2=REL_Y:25:25,x1=KEY_A:KEY_D,y1=KEY_W:KEY_S" --ui-buttonmap "tl=KEY_LEFTSHIFT" --ui-buttonmap "b=KEY_C:KEY_LEFTCTRL:500" --ui-buttonmap "a=KEY_SPACE,x=KEY_1,y=KEY_R" --ui-buttonmap "lb=KEY_Q,rb=KEY_E" --ui-buttonmap "lt=BTN_RIGHT,rt=BTN_LEFT" --ui-buttonmap "dl=KEY_4,dr=KEY_F,du=BTN_MIDDLE,dd=KEY_TAB" --ui-buttonmap "back=KEY_ESC,start=KEY_ENTER"
The game that xboxdrv is mapped for is run through Steam. Steam on this system is run through PlayOnLinux which uses wine.
Steam client is latest version.
PloyOnLinux is 4.1.7 version.
Wine is 1.5.13 version.
The game was installed through playonlinux by installing steam and then the game through Steam. A desktop shortcut for the game was then made from the steam virtual drive.
If the destop shortcut for game is launched get -"no steam found error". So using playonlinux to launch game opens steam as expected from there the game can be launched successfully.
So xboxdrv is controlling xbox 360 controller mapped the way i wish for working with game.
Xboxdrv manual has proven to contain everything needed to run xboxdrv just my lack of knowledge and understanding has been more than a hinderence
xboxdrv man says
Quote:
When you want full game specific configurability and automatic launching of xboxdrv, it is easiest to write little startup scripts for your games that will launch xboxdrv, launch your game and then when the game is finished tear down xboxdrv:
Code:
#!/bin/sh exec xboxdrv \ --trigger-as-button -s \ -- \ your_favorite_game # EOF #
Here your_favorite_game is the executable of your game and is passed to xboxdrv as last argument. This will cause xboxdrv to start the game and keep running as long as the game is running, when the game is done, xboxdrv will quit automatically.
If you want to pass parameters to the game you have to add a -- separator, as otherwise your options to the game would be eaten up by xboxdrv.
Having a script to 1) unload xpad 2) load uinput and joydev 3) launch xboxdrv 4) launch application 5) shutdown xboxdrv when application closed - all automagically would be awesome.
but if
Code:
#!/bin/sh
exec sudo xboxdrv -s --ui-clear --deadzone 9000 --dpad-as-button --trigger-as-button --deadzone-trigger 15% --ui-axismap "x1^resp:-32768:-4000:0:4000:32767" --ui-axismap "x2=REL_X:25:25,y2=REL_Y:25:25,x1=KEY_A:KEY_D,y1=KEY_W:KEY_S" --ui-buttonmap "tl=KEY_LEFTSHIFT" --ui-buttonmap "b=KEY_C:KEY_LEFTCTRL:500" --ui-buttonmap "a=KEY_SPACE,x=KEY_1,y=KEY_R" --ui-buttonmap "lb=KEY_Q,rb=KEY_E" --ui-buttonmap "lt=BTN_RIGHT,rt=BTN_LEFT" --ui-buttonmap "dl=KEY_4,dr=KEY_F,du=BTN_MIDDLE,dd=KEY_TAB" --ui-buttonmap "back=KEY_ESC,start=KEY_ENTER" \
-- \
playonlinux
# EOF #
is run will return -" playonlinux can not be run as root"
Ultimately all i want to achieve is making a script to 1) unload xpad 2) load uinput and joydev 3) launch xboxdrv 4) launch application 5) shutdown xboxdrv when application closed.
Any advice on where i should start in educating myself in order to do this would be great.
Thanks in advance.
Bookmarks