Skip to content

mouse_check_button

drewmccluskey edited this page Feb 12, 2019 · 4 revisions

mouse_check_button

Returns if a mouse button is currently being pressed and held down

Syntax:

mouse_check_button(button)
Argument Description
MouseButtons button The mouse button to being checked if is held down

Returns: bool

Description:

This function will check if a mouse button is being held down, it will return true or false. It is useful for many features such as shooting, clicking, dragging, etc.

Example:

if (mouse_check_button(MouseButtons.mb_left))
{
    score++;
}

This code increases the score every step that you hold down the left mouse button.

Back to Mouse

Clone this wiki locally