From Xojo Documentation


GameInputManager.WaitForElement(timeout as Single) As GameInputElement

Supported for all project types and targets.

Returns the GameInputElement the user pressed. It waits for an element to change on any input device. Timeout is in seconds.


The following example determines which element the user is using as the Fire key. It assumes that there is a global property, mManager as GameInputManager, and mFireButton as a GameInputElement.

If mManager =Nil Then
mManager=New GameInputManager
End if

mFireButton = mManager.WaitForElement(3)
If mFireButton <> Nil Then
MessageBox("You're using " + mFireButton.Name + " as the Fire button.")
End If