mouse_check_button_released

This function will return true if the mouse button being checked has been released or false if it has not.

This function will only return true once for any mouse button when it is released and in order for it to return true again the button will need to have been pressed and released again. Note that it will be considered released for the duration of the step, and for all instances that have any mouse events or that use this same function.

You supply the mouse button to check from one of the following constants:

Mouse Button Constant
ConstantDescription
mb_leftThe left mouse button
mb_middleThe middle mouse button (this may not be valid for all target platforms)
mb_rightThe right mouse button
mb_side1*Mouse side button 1
mb_side2*Mouse side button 2
mb_anyAny of the mouse buttons
mb_noneNo mouse button

* NOTE The mb_side1 and mb_side2 buttons are only for use on Windows, macOS, Ubuntu and HTML5.

Syntax:

mouse_check_button_released(numb);

ArgumentTypeDescription
numbMouse Button ConstantWhich mouse button constant to check for.

 

Returns:

Boolean

 

Example:

if mouse_check_button_released(mb_right)
{
    speed = point_distance(x, y, mouse_x, mouse_y) / 10;
}

The above code will check to see if the right mouse button has been released and if it has it will set the speed of the instance to a tenth of the distance between the current x/y position and the mouse x/y position.