joystick_get_button
/*
** Usage:
** joystick_get_button(id)
**
** Arguments:
** id joystick id
**
** Returns:
** the number of the button pressed on the given
** joystick, or zero if no button is pressed
**
** Notes:
** If more than one button is pressed, the button
** with the lowest number will be returned.
**
** GMLscripts.com
*/
{
var i;
for (i=1; i<=joystick_buttons(argument0); i+=1) {
if (joystick_check_button(argument0,i)) return i;
}
return false;
}
** Usage:
** joystick_get_button(id)
**
** Arguments:
** id joystick id
**
** Returns:
** the number of the button pressed on the given
** joystick, or zero if no button is pressed
**
** Notes:
** If more than one button is pressed, the button
** with the lowest number will be returned.
**
** GMLscripts.com
*/
{
var i;
for (i=1; i<=joystick_buttons(argument0); i+=1) {
if (joystick_check_button(argument0,i)) return i;
}
return false;
}
[Please Login]
Projects: 12
Contributor: BenRK
comments powered by Disqus

Related: joystick_get_button