S
Shy Lev-Ari
Guest
So I want my game to be able to detect a gamepad, and switch the graphic from keyboard hnts to gamepad hints, and vice versa.
I have this code:
When I test it, the first top works. global.keyboard is set to true by default, and after pressing a gamepad btn it is set to false.
When I add the second part (if... anykey) then the global.keyboard is always true. Does GMS detect the gamepad press as "vk_anykey"?
How else would you guys write this code?
I have this code:
Code:
for ( var i = gp_face1; i < gp_axisrv; i++ )
{
if ( gamepad_button_check( 0, i ) )
{
global.keyboard = false;
}
}
if (keyboard_check(vk_anykey))
{
global.keyboard = true;
}
When I add the second part (if... anykey) then the global.keyboard is always true. Does GMS detect the gamepad press as "vk_anykey"?
How else would you guys write this code?