C
ChrisMG12
Guest
I need it for setting an alarm in my game. Its similar to how Release any key event is like keyboadr_check_released(vk_anykey), but I need a gamepad alternative for making something likegamepad_button_released(alternative).
You should be able to use / modify code from here:IK its not there in GMS 1.4 but is there like a script or something i can make for it
I did see this one before but I don't know how to use it properly, I'm kinda new to GML.You should be able to use / modify code from here:
https://forum.yoyogames.com/index.p...etect-any-button-pressed-on-the-gamepad.7268/
I do need that multi-button release but idk how to keep that in the script.bear in mind that the co the guy came up with at the end only work for one button at a time. It will not allow you to have two buttons pressed at a time. But he should have done is had each button set a unique bit in a variable which would be returned at the end of that script. If that variable was anything other than zero, then you know any button was pressed.
Not sure what the button values are, but
var n= 0;
...
n|=pow(2,i)
...
return n;
should suffice.
any help?i am
anykey
No, sorry, thought you where looking for the any key.any help?
/// gamepad_button_released_any_key(device);
var device_=argument0;
var show_debug=true;
// Loop all gamepad keys
for (i=gp_face1; i<gp_axisrv+1; i+=1)
{
if gamepad_button_check_released(device_,i)
{
// Show debug
if show_debug
{
// Check constants
var pressed_key="";
switch (i)
{
case gp_face1: pressed_key="gp_face1"; break;
case gp_face2: pressed_key="gp_face2"; break;
case gp_face3: pressed_key="gp_face3"; break;
case gp_face4: pressed_key="gp_face4"; break;
case gp_shoulderl: pressed_key="gp_shoulderl"; break;
case gp_shoulderlb: pressed_key="gp_shoulderlb"; break;
case gp_shoulderr: pressed_key="gp_shoulderr"; break;
case gp_shoulderrb: pressed_key="gp_shoulderrb"; break;
case gp_select: pressed_key="gp_select"; break;
case gp_start: pressed_key="gp_start"; break;
case gp_stickl: pressed_key="gp_stickl"; break;
case gp_stickr: pressed_key="gp_stickr"; break;
case gp_padu: pressed_key="gp_padu"; break;
case gp_padd: pressed_key="gp_padd"; break;
case gp_padl: pressed_key="gp_padl"; break;
case gp_padr: pressed_key="gp_padr"; break;
case gp_axislh: pressed_key="gp_axislh"; break;
case gp_axislv: pressed_key="gp_axislv"; break;
case gp_axisrh: pressed_key="gp_axisrh"; break;
case gp_axisrv: pressed_key="gp_axisrv"; break;
default: pressed_key="un-mapped key";
}
show_debug_message("Released gamepad button:" + pressed_key);
}
// Return released button
return true;
}
}