[UPDATE: Please see http://wiki.alioth.net/index.php/XBox360_Controller for Linux XBox360 Controller setup]
I've plugged away at this and come up with the following set up using the Xboxdrv http://pingus.seul.org/~grumbel/xboxdrv/xboxdrv.html.
My launcher for Oolite that sets up Xboxdrv with my button and axis mappings is:
#!/bin/sh
# Start xboxdrv and remember its PID in the variable XBOXPID
xboxdrv -s --trigger-as-button --dpad-as-button -l 0 --axis-sensitivity X1=-0.5,X2=-0.5,Y2=-0.5 --axismap -Y2=Y2 --ui-axismap Y1=XK_1:XK_2 --ui-buttonmap \
du=XK_Up,dd=XK_Down,\
dl=XK_Left,dr=XK_Right,\
lt=XK_w,\
rt=XK_z,\
lb=XK_r,\
rb=XK_i,\
X=XK_Return,\
A=XK_t,\
B=XK_e,\
Y=XK_u,\
start=XK_d,\
guide=XK_j,\
back=XK_p,\
lb+du=XK_3,\
lb+dd=XK_8,\
lb+dl=XK_6,\
lb+dr=XK_7,\
lb+back=XK_5,\
lb+start=XK_c,\
lb+X=XK_h,\
lb+A=XK_backslash,\
lb+B=XK_m &
#du=XK_Up,dd=XK_Down : speed
#dl=XK_Left,dr=XK_Right : previous, next target
#lt=XK_w : fire lasers
#rt=XK_z : scanner zoom
#lb=XK_r : identify object
#rb=XK_i : inject speed
#X=XK_Return : launch missile
#A=XK_t : target missile
#B=XK_e : ecm
#Y=XK_u : untarget missile
#start=XK_d : fast dock
#guide=XK_j : jumpdrive
#back=XK_p : pause
#lb+du=XK_3 : buy equipment/ships
#lb+dd=XK_8 : market prices
#lb+dl=XK_6 : local/galactic chart
#lb+dr=XK_7 : planet info
#lb+back=XK_5 : current status/manifest
#lb+start=XK_c : slow dock with target
#lb+X=XK_h : hyperspace
#lb+A=XK_backslash : advanced compass
#lb+B=XK_m : comms log
XBOXPID=$!
# Give xboxdrv a second to startup and create the device
sleep 1
# Launch your favorite game
/usr/bin/oolite
# Kill xboxdrv and wait for it to finish
kill $XBOXPID
wait $XBOXPID
# EOF #
This required changing some key configs:
{
key_roll_left = "a";
key_roll_right = "s";
key_pitch_forward = "[";
key_pitch_back = "'";
key_yaw_left = ",";
key_yaw_right = ".";
key_increase_speed = 255; // up arrow
key_decrease_speed = 254; // down arrow
key_inject_fuel = "i";
key_fire_lasers = "w";
key_launch_missile = 13;
key_next_missile = "y";
key_ecm = "e";
key_target_incoming_missile = "T";
key_target_missile = "t";
key_untarget_missile = "u";
key_ident_system = "r";
key_scanner_zoom = "z";
key_scanner_unzoom = "Z";
key_launch_escapepod = 27; // escape
key_energy_bomb = "\t"; // tab
key_galactic_hyperspace = "g";
key_hyperspace = "h";
key_jumpdrive = "j";
key_dump_cargo = "D";
key_rotate_cargo = "R";
key_autopilot = "C";
key_autopilot_target = "c";
key_autodock = "d";
key_docking_clearance_request = "L";
key_snapshot = "*";
key_docking_music = "s";
key_advanced_nav_array = "^";
key_map_home = 302; // Home
key_map_info = "i";
key_pausebutton = "p";
key_show_fps = "F";
key_mouse_control = "M";
key_comms_log = "m";
key_next_compass_mode = "\\";
key_cloaking_device = "0";
key_contract_info = "?";
key_next_target = 252; // right arrow
key_previous_target = 253; // left arrow
key_custom_view = "v";
key_dump_target_state = "H";
}
Virtually everything can be controlled from the gamepad. For menus, the dpad is mapped to arrow keys and X is Enter. The left shoulder button is treated as a shift key.
Forward on the left analog stick gives forward view and back gives aft view - ie. the stick fwd/back is mapped to buttons, but left/right is not mapped and should be mapped in the game to roll. The other analog stick is for pitch/yaw.
Optimal XBox 360 controller setup
Moderators: winston, another_commander
Optimal XBox 360 controller setup
Last edited by mcarans on Fri Aug 06, 2010 9:09 am, edited 1 time in total.
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Nice work!
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
[UPDATE: Please see http://wiki.alioth.net/index.php/XBox360_Controller for Linux XBox360 Controller setup]
I have slightly improved the setup and embedded the comments for ease of readability based on help from the XBoxDrv author. The key config in my first post is still needed. Here is my new launcher for Oolite:
#!/bin/sh
# Start xboxdrv and remember its PID in the variable XBOXPID
xboxdrv -s --trigger-as-button --dpad-as-button -l 0 --axis-sensitivity X1=-0.5,X2=-0.5,Y2=-0.5 --axismap -Y2=Y2 --ui-axismap Y1=XK_1:XK_2 --ui-buttonmap \
du=XK_Up,dd=XK_Down,`# speed`\
dl=XK_Left,dr=XK_Right,`# previous, next target`\
lt=XK_w,`# fire lasers`\
rt=XK_r,`# identify object`\
lb=XK_y,`# next missile`\
rb=XK_i,`# inject speed`\
X=XK_Return,`# launch missile`\
A=XK_t,`# target missile`\
B=XK_e,`# ecm`\
Y=XK_u,`# untarget missile`\
start=XK_z,`# scanner zoom`\
guide=XK_j,`# jumpdrive`\
back=XK_p,`# pause`\
lb+du=XK_3,`# buy equipment/ships`\
lb+dd=XK_8,`# market prices`\
lb+dl=XK_6,`# local/galactic chart`\
lb+dr=XK_7,`# planet info`\
lb+back=XK_5,`# current status/manifest`\
lb+guide=XK_h,`# hyperspace`\
lb+start=XK_c,`# slow dock with target`\
lb+X=XK_d,`# fast dock`\
lb+A=XK_backslash,`# advanced compass`\
lb+B=XK_m `# comms log` &
XBOXPID=$!
# Give xboxdrv a second to startup and create the device
sleep 1
# Launch your favorite game
/usr/bin/oolite
# Kill xboxdrv and wait for it to finish
kill $XBOXPID
wait $XBOXPID
# EOF #
I have slightly improved the setup and embedded the comments for ease of readability based on help from the XBoxDrv author. The key config in my first post is still needed. Here is my new launcher for Oolite:
#!/bin/sh
# Start xboxdrv and remember its PID in the variable XBOXPID
xboxdrv -s --trigger-as-button --dpad-as-button -l 0 --axis-sensitivity X1=-0.5,X2=-0.5,Y2=-0.5 --axismap -Y2=Y2 --ui-axismap Y1=XK_1:XK_2 --ui-buttonmap \
du=XK_Up,dd=XK_Down,`# speed`\
dl=XK_Left,dr=XK_Right,`# previous, next target`\
lt=XK_w,`# fire lasers`\
rt=XK_r,`# identify object`\
lb=XK_y,`# next missile`\
rb=XK_i,`# inject speed`\
X=XK_Return,`# launch missile`\
A=XK_t,`# target missile`\
B=XK_e,`# ecm`\
Y=XK_u,`# untarget missile`\
start=XK_z,`# scanner zoom`\
guide=XK_j,`# jumpdrive`\
back=XK_p,`# pause`\
lb+du=XK_3,`# buy equipment/ships`\
lb+dd=XK_8,`# market prices`\
lb+dl=XK_6,`# local/galactic chart`\
lb+dr=XK_7,`# planet info`\
lb+back=XK_5,`# current status/manifest`\
lb+guide=XK_h,`# hyperspace`\
lb+start=XK_c,`# slow dock with target`\
lb+X=XK_d,`# fast dock`\
lb+A=XK_backslash,`# advanced compass`\
lb+B=XK_m `# comms log` &
XBOXPID=$!
# Give xboxdrv a second to startup and create the device
sleep 1
# Launch your favorite game
/usr/bin/oolite
# Kill xboxdrv and wait for it to finish
kill $XBOXPID
wait $XBOXPID
# EOF #
Please see http://wiki.alioth.net/index.php/XBox360_Controller for Linux XBox360 Controller setup
I have made it a link off the FAQ.
I have made it a link off the FAQ.
Re: ..
I'm happy to add it there, but couldn't find where you mean. Can you post a link? [EDIT: Do you mean "Porting to other platforms" in the forums or some place on the wiki?]Lestradae wrote:Shouldn't this be in the "Porting to other platforms" section, too?
Just suggesting.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: ..
Its here at this BB.mcarans wrote:I'm happy to add it there, but couldn't find where you mean. Can you post a link? [EDIT: Do you mean "Porting to other platforms" in the forums or some place on the wiki?]Lestradae wrote:Shouldn't this be in the "Porting to other platforms" section, too?
Just suggesting.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
I had a post in the Oolite-Linux forum which is probably a more appropriate place than Porting to other platforms as the setup I described is for Linux. It is here:
https://bb.oolite.space/viewtopic.php?t=8199
https://bb.oolite.space/viewtopic.php?t=8199