Skip to content

mouse_check_button_pressed

drewmccluskey edited this page Feb 12, 2019 · 4 revisions

mouse_check_button_pressed

Returns if mouse is being currently pressed

Syntax:

mouse_check_button_pressed(button)
Argument Description
MouseButtons button The mouse button checked if it is being pressed

Returns: bool

Description:

This function is like mouse_check_button() but this will run code only once when you press the mouse button and not all the steps after that the button is still held down.

Example:

if (mouse_check_button_pressed(MouseButtons.mb_left))
{
    instance_create(Position, typeof(oBullet), "Object layer 1");
}

This code will run when you press your left mouse button and will create a bullet object.

Back to Mouse

Clone this wiki locally