Skip to content

GXDeviceInputTest

boxgaming edited this page Sep 29, 2026 · 2 revisions

Syntax

result% = GXDeviceInputTest (deviceInput As GXDeviceInput)

Description

Returns a true or false value indicating whether the device input identified by the deviceInput paramter is currently being activated.

Examples

Example1: Create a scene and start the game loop. Exit the game loop when the user presses the ESC key.

'$Include: 'gx.bi'

Dim Shared diQuit As GXDeviceInput
GXKeyInput GXKEY_ESC, diQuit

GXSceneCreate 320, 200
GXSceneStart
PRINT "Game Over"

Sub GXOnGameEvent (e As GXEvent)
    Select Case e.event
        Case GXEVENT_UPDATE
            If GXDeviceInputTest(diQuit) Then GXSceneStop
    End Select
End Sub

'$Include: 'gx.bm'

See Also

Key Codes
GXKeyDown
GXKeyInput
GXDeviceInputDetect

Clone this wiki locally