_KEY keyword

Returns the key pressed on the KEYBOARD. To be used inside a SUB with the ON KEY event. Special values: "BACKSPACE" for backspace key, "ENTER" for enter key.

Syntax

_KEY

Example

ON KEY myFunction

SUB myFunction
IF _KEY = "a" OR _KEY = "1" THEN
myString = myString + _KEY 'Can be assigned to a string
END IF
IF _KEY = "BACKSPACE" THEN
'Backspace pressed
END IF
IF _KEY = "ENTER" THEN
'Enter pressed
END IF
END SUB

Go back to list of Keywords.