Howto:Port I/O from Nasal: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 45: Line 45:


The same concept could also be used to come up with an "input property" to process results from your device.
The same concept could also be used to come up with an "input property" to process results from your device.
You could then register a listener that is automatically invoked whenever the "input property" is modified, this will automatically invoke your Nasal callback (i.e. a Nasal function) so that you can process the input.
<syntaxhighlight lang="php">
var processMessage = func() {
  print("Info: Message received!");
}
_setlistener("/sim/cockpit/eufd-input", processMessage);
</syntaxhighlight>




Navigation menu