Learn
Receiving and processing events
Every time you call gm_yield, gama collects all the events which
have happened and stores them in a way you can easily access them.
Mouse events
Events happening to the mouse are stored in a global
gm_mouse structure,
As such:
- you can get the mouse last position with
gm_mouse.position.xandgm_mouse.position.y. - You can get the mouse change in position with
gm_mouse.movement. gm_mouse.downreports if the mouse is currently down, if the user holds the mouse down, this will contiuously be `.gm_mouse.pressedreports likegm_mouse.down, except that this is reported only once even if the user holds the mouse down, you can use this to tests for clicks.
Little example
Keyboard events
Processing keyboard events is a bit more interesting, the fact is that there are plenty of keys on the keyboard, you have a few functions to test if a key is currently being pressed, for convenience I will talk only of that will mostly use.
The keycode is usually the key itself in lowercase, e.g
'a' for key A, ' ' for key space, '.' for key dot.
But for special keys you will use upper case letters:
'U'for key up'D'for key down'L'for key left'R'for key right'E'for key escape'S'for shift key'C'for control key'A'for alt key'\0'for unsupported or invalid keys
