• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

pressed and released event with stick of gamepad

F

Freeflip

Guest
Hi, with the stick of gamepad, how can I simulate the pressed and released event?

for example:
k_left_p = keyboard_check_pressed(vk_left) or gamepad_button_check_pressed(0, gp_padl) or PUT CODE HERE;

or

k_left_r = keyboard_check_released(vk_left) or gamepad_button_check_released(0, gp_padl) or PUT CODE HERE;

some idea?

Thanks
 

Yal

šŸ§ *penguin noises*
GMC Elder
Have additional variables to store the button's state each step. Before updating the state, check if the button is pressed but wasn't the previous step - that's a Pressed event. On the other hand, if it's pressed the previous step but isn't pressed down this step, that's a Released event.
 
Top