Skip to content

mouse_clear

drewmccluskey edited this page Feb 12, 2019 · 2 revisions

mouse_clear

This will delete state of current used mouse buttons

Syntax:

mouse_clear(button)
Argument Description
mouse_clear button Which button to check if is in current state

Returns: bool

Description:

This function will clear the state of any mouse buttons currently being used, so when you are using mouse_check_button(button); and held your selected button and then use mouse_clear(button); for that button, mouse_check_button(button); should return false, for returning true again the button must be released and then pressed again.

Example:

if (keyboard_check(Keys.R))
{
    mouse_clear(MouseButtons.mb_right);
}

if (mouse_check_button(MouseButtons.mb_right))
{
    Position.X += 5;
}

This code will move your object to the right when you hold down the right mouse button but when you press R on the keyboard the moving object will stop until you release the right mouse button and press it again.

Back to Mouse

Clone this wiki locally