Difference between revisions of "Key.pressed"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>key.pressed</c> detects whether a specific key or button input is currently pressed. See also: key.keyNames; key.axis === Arguments === {| class="wikitable" |-...")
 
Line 7: Line 7:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Parameter Name !! Default Value !! Meaning
+
! Parameter Name !! Type !! Default Value !! Meaning
 
|-
 
|-
| ''keyName'' || string, default "space" || key/button to press
+
| ''keyName'' || string || "space" || key/button to press
 
|}
 
|}
  

Revision as of 15:18, 24 March 2020

key.pressed detects whether a specific key or button input is currently pressed.

See also: key.keyNames; key.axis

Arguments

Parameter Name Type Default Value Meaning
keyName string "space" key/button to press

Usage Notes

These include modifier keys (e.g. "left shift", "right alt") as well as mouse buttons (e.g. "mouse 0") and joystick/gamepad buttons ("joystick 1 button 0", etc.). With regard to joystick buttons, if you don't specify a number (e.g. "joystick button 0"), then it will detect a press of button 0 on *any* joystick. See key.keyNames for all the possible names to use with this method.

Example

while not key.pressed("left"); end while   // waits until left arrow pressed