device_mouse_check_button

Returns whether a given device button is currently down.

Syntax:

device_mouse_check_button(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 (1) or false (0) depending on whether the device that you specify is being used or not. Now, the device refers to the mouse number, which can be from 0 to 4 and this event is triggered when the touch screen of a mobile device is touched, so in this way you can test for up to n different screen touches (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 constantly updates every step, and the standard constants of mb_left and mb_right can be used to check for either button.

Example:

if device_mouse_check_button(0, mb_left) && device_mouse_check_button(1, mb_left)
{
room_goto(rm_Menu);
}

The above code checks to see if the two touches are being held down at the same time and if they then it goes to another room.


Back: Device Input
Next: device_mouse_check_button_pressed
© Copyright YoYo Games Ltd. 2017 All Rights Reserved