on_f1 ... on_f12

on_a ... on_z

on_0 ... on_9

The event is executed when the corresponding key key is pressed (see key mapping). Functions can be assigned most keys. The scancode of the key is passed as parameter to the function. Scancodes are unique numbers in the range 0..127 assigned to each key; they are listed in the table in the following chapter.

Example:

function quit() { sys_exit(NULL); }
...
void main() {
  ...
on_f1 = quit; // assign quit() to key [F1] ... } // alternative method function on_f1_event() { sys_exit(NULL); }

See also:

key mapping, on_click, on_mouse_left, on_joy, on_anykey

► latest version online