Sunday, 6 January 2008

FlightGear Keyboard Shortcut Reference

I just wanted to have a list of keys can be used in FlightGear but found only the short Reference.
I realized that key shortcuts is an xml file so easy to change and not good to publish a static one on the net while anybody can change it anytime easily. So here is a command to get it under linux anytime on your own machine.

First please change directory to the one contains keyboard.xml. Gutsy have it under /usr/share/games/FlightGear

$ awk 'BEGIN {name="";desc="";spec="";} \
/.*<\/name>/{ name=$0; spec="";desc="";} \
/.*<\/desc>/ { desc=$0 ; line=spec " " name " = " desc; print gensub("<[^>]*>([^<>]*)<\/[^>]*>","\\1","g",gensub("\ \ +","\ ","g", line)) ;} \
/<mod-.*>/ { spec=gensub("<mod-(.*)>","\\1 + ","g",$0); } \
' keyboard.xml

Output is something like:
Ctrl-A = Toggle autopilot altitude lock.
Ctrl-B = Toggle speedbrake.
Ctrl-C = Toggle clickable panel hotspots
Ctrl-G = Toggle autopilot glide slope lock.
Ctrl-H = Toggle autopilot heading lock.
Ctrl-I = Show instrument setting dialog.

Than format print, learn and enjoy the game. :)