InputDevice Class
Look at the Input reference pages before reading these docs.
https://p5play.org/learn/input_devices.html
Root class for storing the state of inputs (mouse, keyboard, gamepads).
-3 means input was released after being held, pressed for 12 frames -2 means input was pressed and released on the same frame -1 means input was released 0 means input is not pressed 1 means input was pressed
1 means input is still being pressed 12 means input was held 12 means input is being held
Item Index
Properties
Methods
dragging
-
inp
Parameters:
-
inp
String
Returns:
the amount of frames the user has been dragging the input
held
-
inp
Parameters:
-
inp
String
Returns:
true on the first frame that the user released a held input
holding
-
inp
Parameters:
-
inp
String
Returns:
the amount of frames the user has been holding the input
holds
-
inp
Parameters:
-
inp
String
Returns:
true on the first frame that the user holds the input
hovered
()
Boolean
Returns:
true on the first frame that the mouse is no longer over the sprite
hovering
()
Number
Returns:
the amount of frames the mouse has been over the sprite
hovers
()
Boolean
Returns:
true on the first frame that the mouse is over the sprite
pressed
-
inp
Parameters:
-
inp
String
Returns:
true on the first frame that the user released the input
presses
-
inp
Parameters:
-
inp
String
Returns:
true on the first frame that the user presses the input
pressing
-
inp
Parameters:
-
inp
String
Returns:
the amount of frames the user has been pressing the input
released
-
inp
Parameters:
-
inp
String
Returns:
true on the first frame that the user released the input
Properties
holdThreshold
Number
The amount of frames an input must be pressed to be considered held. Default is 12.
pos
Unknown
The mouse's position.
position
Unknown
The mouse's position. Alias for pos.
x
Number
The mouse's x position.
y
Number
The mouse's y position.