This is an old revision of the document!
The optional 'controls.tmd' file adds 3D click spots to the virtual cockpit in the shape of a cylinder, box, sphere or rings. Each of the clickspots can have different messages assigned to it that allow the user to interact with the cockpit using the left and right mouse buttons as well as the mouse wheel or by dragging the mouse with the left mouse button held down or by pointing at it with VR controllers, flipping it, or grabbing and moving the VR hand controller.
A message that is sent from the 'controls.tmd' has a value and qualifier assigned to it that allows either direct assignment of a value, step (increment/decrement) or toggling. The messages are received by 'input_control', 'input_default', 'input_discrete', 'input_binary', 'input_switch', 'input_knob',… objects in dynamics section of the main in the aircraft tmd file.
The definition of a click spot is rather simple. After deciding on the best shape that fits best the position is adjusted in the R0 attribute, the orientation is set by the B0 matrix and then the size is adjusted. For VR hands and mouse dragging it is important to also define an 'Direction' axis. If another aircraft already uses a similar function, then its best to copy the message name from its 'controls.tmd' file. But it is also ok to use own custom names for the messages if desired, just note that some default key assignments may not work then.
Experience shows that it is good practice to sort the click spots within the 'controls.tmd' file similar to how a pilot would scan the cockpit. For example, most airliner overhead panels have columns which are gone through one by one, from top to bottom, starting with the left column. Sorting the click spots in a similar way will make it easier to find a click spot again later.
<[file] <[modelmanager] <[pointer_list_tmcontrol][ControlObjects] <[control_cylinder][SelectedAirspeed] <[vector3_float64][R0][ 11.5 0.1127 0.75 ]> <[matrix3_float64][B0][ 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 ]> <[control_message][OnRotate] <[string8][Message][Autopilot.SelectedSpeed]> <[string8][Qualifiers][step]> <[float64][Value][1.0]> > <[float64][Radius][0.008]> <[float64][Length][0.015]> > <[control_cylinder][SelectedAltitude] <[vector3_float64][R0][ 11.5 -0.017278 0.75 ]> <[matrix3_float64][B0][ 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 ]> <[control_message][OnRotate] <[string8][Message][Autopilot.SelectedAltitude]> <[string8][Qualifiers][step]> <[float64][Value][1.0]> > <[float64][Radius][0.008]> <[float64][Length][0.015]> > > > >