Module Config

module Config: sig .. end

Config contains the config type, used for providing configuration and input information to the sketch, and utility functions for accessing information from a config.


type keys = Stdlib.Set.Make(Stdlib.Uchar).t 
type config = {
   width : int;
   height : int;
   display_width : int;
   display_height : int;
   mouse_x : int;
   mouse_y : int;
   pmouse_x : int;
   pmouse_y : int;
   mouse_scroll : int;
   mouse_pressed : bool;
   mouse_button : [ `Center | `Left | `Right ];
   key : char;
   keys : keys;
   key_unicode : Stdlib.Uchar.t;
   key_pressed : bool;
   frame_count : int;
   frame_rate : float;
}

Keys

val check_key : config -> char -> bool

check_key config char is true if the key char is pressed in config and false otherwise.

val check_key_uchar : config -> Stdlib.Uchar.t -> bool

check_key_uchar config char is true if the key char is pressed in config and false otherwise. Supports unicode characters.

val get_keys : config -> char list

get_keys config is the list of all keys that are currently pressed in config, or [] if there are no keys pressed. Only includes keys that are valid ASCII char values.

val get_keys_uchar : config -> Stdlib.Uchar.t list

key_keys_uchar config is the list of all keys that are currently pressed in config, or [] if there are no keys pressed. Includes all keys, represented as Unicode characters.

Exit

exception Exit

Exit may be raised to terminate the sketch.