GXKeyDown - boxgaming/gx Wiki

Syntax

keyIsDown% = GXKeyDown (keyCode%)

Description

Returns a true or false value indicating whether the key identified by the keyCode% paramter is currently being pressed. Key codes constants are defined with the prefix "GXKEY_".

Examples

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

'$INCLUDE: 'gx.bi'

GXSceneCreate 320, 200
GXSceneStart
PRINT "Game Over"

SUB GXOnGameEvent (e AS GXEvent)
    SELECT CASE e.event
        CASE GXEVENT_UPDATE
            IF GXKeyDown(GXKEY_ESC) THEN GXSceneStop
    END SELECT
END SUB

'$INCLUDE: 'gx.bm'

See Also

Key Codes
GXDeviceInputTest