On Sat, 26 Oct 2002 07:29:30 -0400 David Megginson <[EMAIL PROTECTED]> wrote:
> Bernie Bright writes: > > > There was a discussion some months ago about adding "command > > properties", that is, tying a property to a command such that > > writing to the property triggers the command. Such commands then > > become available to external scripts as well as the binding > > interface. Should we investigate this further? > > The alternative is to make the commands available through the external > interface as well. Let's develop some examples and use cases and see > which works best -- I'm not strongly prejudiced either way. > I tried adding commands to the props/telnet interface but it was agreed it was better to add them as properties so they would be available to all external interfaces. As an example, I added the following to fgInitCommands(): typedef bool (*dummy)(); fgTie( "/command/view/next", dummy(0), do_view_next ); fgTie( "/command/view/prev", dummy(0), do_view_prev ); The implementation of void do_view_next(bool) and void do_view_prev(bool) is essentially the same as the existing do_view_cycle(). As a further test I added a new key binding to keyboard.xml: <key n="86"> <name>V</name> <desc>Prev View</desc> <binding> <command>property-assign</command> <property>/command/view/prev</property> <value type="bool">true</value> </binding> </key> So now V and Shift-V cycle forwards and backwards through the available views. Bernie _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
