natiny.input.get_mouse_button_pressed
natiny.input.get_mouse_button_pressed(button) -> boolean
Returns true only on the frame when the specified mouse button was first pressed down.
Parameters
| Name | Type | Description |
|---|---|---|
button |
number |
Mouse button - a natiny.input.MOUSE_BUTTON_* constant, e.g. natiny.input.MOUSE_BUTTON_LEFT |
Returns
| Type | Description |
|---|---|
boolean |
true on the frame the button was pressed, false otherwise |
Example
if natiny.input.get_mouse_button_pressed(natiny.input.MOUSE_BUTTON_LEFT) then
select_item()
end
Notes
- Returns
truefor the frame that consumes a released-to-pressed transition.