Aurora RT Flow Control 

Page:  IntroductionInstallationPage Objects I, Page Objects II  Flow Control, 

If you have examined the presentation file shipped with Aurora RT, you may have noticed that each page contains an XML flow control block. The various flags in this block determine which page in the presentation will be displayed next and what event triggers a page change. A simple control block can be seen below.

<flowcontrol>
 <default>
  <action>NEXT</action>
  <event>LMOUSE</event>
 </default>
</flowcontrol>

The control block above should always be included in any XML page definition. The values in both the action and event fields can be altered to suit your particular requirements. The action values, for the simple example above, can be NEXT, PREV, GOTO and STOP. The event values could be the numbers 0 to 9 and the letters A to Z. Also, there are mouse button values of LMOUSE, RMOUSE and MMOUSE. Special key values are RET, ESC, LEFT, UP, RIGHT and DOWN. The last value supported is TIMER.

The simple control block above, combined with the various event and action values, will allow forwards, backwards and circular movement through pages of a presentation. What about movement based on some sort of condition i.e. move to a specified page if a particular key is pressed. The control block below provides this facility.

<flowcontrol>
 <default>
  <action>NEXT</action>
  <event>LMOUSE</event>
 </default>
 <condition>
  <action>GOTO</action>
  <event>I</event>
  <targetpage>2</targetpage>
 </condition>
</flowcontrol>

The above control block will display the page which has an id of two if the I key is pressed. Alternatively, if the left mouse button is clicked, the next page in the presentation is displayed. The condition block is always evaluated before the default block. If these blocks had the same entries but different target pages, the page referred to in the condition block would always be displayed.

The above control block could be expanded to handle several key presses - an example can be seen below.

<flowcontrol>
 <default>
  <action>NEXT</action>
  <event>LMOUSE</event>
 </default>
 <condition>
  <action>GOTO</action>
  <event>I</event>
  <targetpage>2</targetpage>
 </condition>
 <condition>
  <action>GOTO</action>
  <event>P</event>
  <targetpage>8</targetpage>
 </condition>
</flowcontrol>

A control block can also be used to alter the presentation flow if a particular page object is clicked. The example below was again extracted from the presentation shipped with the application; Aurora RT will in this case wait until the object clicked has an id of five. The WAIT event value must be used in this case, otherwise the next page will be displayed after the first mouse click.

<flowcontrol>
 <default>
  <action>WAIT</action>
  <event>LMOUSE</event>
 </default>
 <condition>
  <action>NEXT</action>
  <event>LMOUSE</event>
  <targetobject>5</targetobject>
 </condition>
</flowcontrol>

The last example below details use of the TIMER event value. This should be used solely to display a page for a particular length of time, given by the duration field, in milliseconds. When the timer expires, a simulated key press (VK_TIMER in the log file) is sent which, in the example below, results in the next page being displayed. The TIMER event value should not be used along with a conditional control section.

<flowcontrol>
 <default>
  <action>NEXT</action>
  <event>TIMER</event>
  <duration>5000</duration>
 </default>
</flowcontrol>