From Xojo Documentation

Revision as of 22:06, 24 February 2021 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)

Manages an element of a GameInputDevice. Not supported on Linux.

Device fa-lock-32.png Name fa-lock-32.png Value fa-lock-32.png


A GameInputElement is a control on an input device used for gaming (or general user input via the keyboard and mouse). For example, the Fire button on a joystick control is an element, as are the standard mouse button and each of the keys on a keyboard. The Element method of the GameInputDevice class give you access to the elements of a specified device. You use the WaitForElement method of the GameInputManager class to detect input from an element.


This example loads the list of elements belonging to the selected device into a PopupMenu named ElementPop. The connected devices are shown in a ListBox.

Var i, maxi As Integer
Var device As GameInputDevice

device = mManager.Device(Listbox1.SelectedIndex) // selected device in Device ListBox
If device <> Nil Then
maxi = device.ElementCount
For i = 0 To maxi - 1
End If

See also the examples for GameInputManager.

See Also

GameInputDevice, GameInputManager classes.