Maximite 2: How to make switch trigger only once when pressed


Author Message
Decoy
Senior Member

Joined: 02/08/2019
Location: Denmark
Posts: 109
Posted: 05:10pm 01 Dec 2020      

  JohnS said  
  Decoy said  I have become used to GML (Gamemaker Studio 2-code) which just has a function for this.

What's it called please / how does it do it?

John


John, the normal function in GML is:

Keyboard_check(key)

- This will count as a press for each cycle that the key is pressed

The other function is:

keyboard_check_pressed(key)

- this will only register once, then the key will need to be depressed before pressing it again. I have no idea what goes on behind the scenes :)

The above also work for inputs from a microcontroller through a .dll.

I sort of expected a high-level language such as BASIC to have an easier implementation of this than C++ or the like. Jim's example above is great, but it is as - if not more - involved, than the Arduino counterpart.

.
Edited 2020-12-02 03:12 by Decoy