device_mouse_check_button_pressed

Returns whether a given device button has been pressed.

Syntax:

device_mouse_check_button_pressed(device, button);


Argument Description
device The device (from 0 - n) that is being checked.
button The button of the device that is being checked.


Returns: Boolean


Description

This function returns true or false depending on whether the device that you specify has been "touched" (clicked) or not. The device argument refers to the touch number, which can be from 0 to n (the maximum number of touches that can be detected will depend very much on the device being used and the OS it runs). This function is only triggered once by the actual pressing action, and the standard constants of mb_left and mb_right can be used to check for either button.

Example:

if device_mouse_check_button_pressed(0, mb_left)
{
press=true;
}

The above code checks to see if the device has been pressed and sets a variable to true if it has.


Back: Device Input
Next: device_mouse_check_button_released
© Copyright YoYo Games Ltd. 2018 All Rights Reserved