ON KEY keyword

Executes a SUB when a key is pressed using KEYBOARD. To check which key was pressed, use _KEY.

Syntax

ON KEY sub

Parameters

  • sub: subroutine to execute (required)

Example

ON KEY myFunction

SUB myFunction
IF _KEY = "a" THEN
'key 'a' was pressed, do something
END IF
END SUB

Go back to list of Keywords.