Skip to content

keyPressed

stevepaget edited this page Feb 16, 2016 · 1 revision

Checks for a particular key press (or any key)


Syntax:

keyPressed(key)

Where:

key is a string containing the name of a key (see key names). Alternatively, this can be left out and it will check any key.

'Note:' Returns True if the key is pressed at the time the function is called. False otherwise.

eg.

 if keyPressed("Space"):
       #jump, or something cool!
 
Clone this wiki locally