1 Binding New Commands in FlightGear
2 ----------------------------------
5 To add a new command to FlightGear, you first need to create a
6 function that takes a single SGPropertyNode const pointer as an
10 do_something (SGPropertyNode * arg)
15 Next, you need to register it with the command manager:
17 globals->get_commands()->addCommand("something", do_something);
19 Now, the command "something" is available to any mouse, joystick,
20 panel, or keyboard bindings. If the bindings pass any arguments, they
21 will be children of the SGPropertyNode passed in:
24 do_something (const SGPropertyNode * arg)
26 something(arg->getStringValue("foo"), arg->getDoubleValue("bar"));
29 That's pretty-much it. Apologies in advance for not making things any