mouse_check_button_pressed

Returns whether a given mouse button has just been pressed.

Syntax:

mouse_check_button_pressed(numb);


Argument Description
numb Which mouse button constant to check for.


Returns: Boolean


Description

This function will return true if the mouse button being checked has been pressed or false if it has not. This function will only be triggered once for any mouse button when it is first pressed and to trigger it again the button will need to have been released and pressed again.


Example:

if mouse_check_button_pressed(mb_left)
   {
   score += 50;
   }

The above code will check to see if the left mouse button has been pressed and if it has it will add 50 to the score.


Back: Mouse Input
Next: mouse_check_button_released
© Copyright YoYo Games Ltd. 2018 All Rights Reserved