User Tools

Site Tools


crpl:docs:getkey

<- CRPL reference <- Input Commands

GetKey

ArgumentsResultNotation
Key to check 0 or 1 depending if Key is held down s1 – b1

Description

Checks the specified keyboard key to see if it is held down. Returns true only while the key is held down. For a list of possible key strings, look here: http://docs.unity3d.com/Documentation/ScriptReference/KeyCode.html

Examples

if (GetKey("LeftArrow"))
   #Move unit left
endif
if (GetKey("RightArrow"))
   #Move unit right
endif
crpl/docs/getkey.txt · Last modified: 2015/03/19 05:59 by warren