jam007 wrote in Thu May 02, 2013 9:12 am:Maybe it would be possible to create a Nasal script that reads the key bindings currently used and displays it in a list like the "common aircraft keys" in the help menu.
Displaying all keys is easy, but hard to fit nicely in some logical groups; especially on smaller screens. Just displaying a giant list of keys isn't very nice IMO (
see image). They'd have to be grouped like "flight controls", "autopilot", "simulator" etc. Basically what we do manually now with the various dialogs.
Just displaying the custom aircraft keys is also difficult (as far as my Nasal skills go), because the sim does not make any distinction on that. There's just one big list of keys under /input/keyboard. We could look at just the keys in -set.xml, but some developers like to nest them in seperate files etc....
EDIT: Thinking out loud: we can tag the default keys with something like <default>true</default> (that only involves editing the keyboard.xml file). We can then probably have that set to false whenever it is overwritten. That way we don't need to edit all the aircraft... Or we can leave the editing completely out and compare the /input/keyboard tree with the keyboard.xml file...
EDIT2: Here's some ugly code that does the latter:
http://pastebin.com/hnFQ3aEk Overwrite the contents of $FG_ROOT/Nasal/gui.nas with this (make a backup first!) and launch FlightGear with an aircraft that has some custom keys (eg. UFO, C172P, 747-400). Nasal experts, feel free to improve. You'll find the interesting stuff from line 1187 onwards.