< Real time control Index Mathematics >

Input

Usually, a game is controlled simply by the actions caused by mouse movements and clicks as specified in the Scene and Region items. Additional control may be realised by processing mouse and keyboard input directly. These items are valid only for scenes.

MouseInput

Item typeMouseInput
Descriptiontracks mouse events
Actionstarts / ends mouse tracking
Conditiontrue, if active

KeyTypeDefaultDescription
actionActionsaction to perform
xpositionvarx coordinate of mouse
ypositionvary coordinate of mouse
moveboolfif true, mouse movement is tracked instead of clicks

The action is performed each time, the mouse is clicked or moved respectively. The coordinates of the mouse are assigned to the variables for xposition and yposition.

KeyInput

Item typeKeyInput
Descriptiontracks keyboard events
Actionstarts / ends keyboard tracking
Conditiontrue, if active

KeyTypeDefaultDescription
actionActionsaction to perform
keyvaluevirtual key code
downboolfif true, pressing the key instead of releasing is tracked

Note: If down is true, multiple events are caused as long as the key is pressed. If key is a variable, the code of the pressed key is assigned to it.

Note: The keys F1 to F12 and ESC are already used as menu shortcuts.

Virtual Key Codes

KeyCode
backspace8
tab9
return13
shift16
control17
caps20
escape27
space32
page up33
page down34
home35
end36
left37
up38
right39
down40
insert45
delete46
0-948-57
A-Z65-90
F1-F12112-123

Character Position

Item typeCharacterPosition
Descriptiontracks the current position of the character
Actionstarts / ends position tracking
Condition-

KeyTypeDefaultDescription
actionActionsaction to perform

The action of this item is performed, when tracking starts and each time the position or orientation of the character changes. The position, orientation, and scaling factor of the character may be accessed by the according variables (s. definitions)