Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
V1.EventSourceEvent descriptions
All event descriptions contain the canvas on which the event occured and the timestamp indicating when the event occured.
Timestamps represent the time in microseconds, from an arbitrary starting point
Generic description of events occurring on canvases
A position is a pair of integers
A size is a pair of integers
type key = | KeyEscape| KeyF1| KeyF2| KeyF3| KeyF4| KeyF5| KeyF6| KeyF7| KeyF8| KeyF9| KeyF10| KeyF11| KeyF12| KeyPrintScreenabsent from Mac Keyboards
*)| KeyScrollLockabsent from Mac Keyboards
*)| KeyPauseabsent from Mac Keyboards
*)| KeyGraveTilde| Key1Exclamation| Key2At| Key3Number| Key4Dollar| Key5Percent| Key6Caret| Key7Ampersand| Key8Asterisk| Key9LParenthesis| Key0RParenthesis| KeyMinusUndersclre| KeyEqualPlus| KeyBackspace| KeyTab| KeyQ| KeyW| KeyE| KeyR| KeyT| KeyY| KeyU| KeyI| KeyO| KeyP| KeyLBracketCurly| KeyRBracketCurly| KeyBackslashPipereplaced by KeyNonUSNumberTilde on ISO KB
*)| KeyCapsLock| KeyA| KeyS| KeyD| KeyF| KeyG| KeyH| KeyJ| KeyK| KeyL| KeySemicolonColon| KeyQuoteDoublequote| KeyNonUSNumberTildeextra key left of Return on ISO KB, although generally mapped to KeyBackslashPipe instead
*)| KeyReturn| KeyLShift| KeyNonUSBackslashPipeextra key right of LShift on ISO KB
*)| KeyZ| KeyX| KeyC| KeyV| KeyB| KeyN| KeyM| KeyCommaLess| KeyPeriodGreater| KeySlashQuestion| KeyRShift| KeyLControl| KeyLMetaleft Windows / Command key
*)| KeyLAlt| KeySpacebar| KeyRAlt| KeyRMetaright Windows / Command key
*)| KeyMenu| KeyRControl| KeyInsertreplaced by a Fn key on Mac (with a different code)
*)| KeyHome| KeyPageUp| KeyDeleteForward| KeyEend| KeyPageDown| KeyUpArrow| KeyLeftArrow| KeyDownArrow| KeyRightArrow| KeyPadNumlockClearon Mac, Clear replaces NumLock
*)| KeyPadEqualson Mac keyboards only
*)| KeyPadDivide| KeyPadMultiply| KeyPadMinus| KeyPad7Home| KeyPad8UpArrow| KeyPad9PageUp| KeyPadPlus| KeyPad4LeftArrow| KeyPad5| KeyPad6RightArrow| KeyPadCommaspecific to Brazilian keyboards
*)| KeyPad1End| KeyPad2DownArrow| KeyPad3PageDown| KeyPad0Insert| KeyPadDecimalDelete| KeyPadEnter| KeyF13| KeyF14| KeyF15| KeyF16| KeyF17| KeyF18| KeyF19| KeyF20| KeyF21| KeyF22| KeyF23| KeyF24| KeyInternational1extra key left of RShift on JIS and Brazilian KB
*)| KeyInternational2Katakana/Hiragana key right of Space on JIS KB
*)| KeyInternational3extra key left of Backspace on JIS KB
*)| KeyInternational4Henkan key right of Space on JIS KB
*)| KeyInternational5Muhenkan key left of Space on JIS KB
*)| KeyInternational6Kanma (comma) key right of KP0 on JIS KB
*)| KeyInternational7Double-Byte/Single-Byte toggle key
*)| KeyInternational8Undefined
*)| KeyInternational9Undefined
*)| KeyLang1Hangul/English toggle key (Korean)
*)| KeyLang2Hanja conversion key (Korean)
*)| KeyLang3Katakana key (Japanese)
*)| KeyLang4Hiragana key (Japanese)
*)| KeyLand5Zenkaku/Hankaku key (Japanese)
*)| KeyHelp| KeyMute| KeyVolumeUp| KeyVolumeDownA physical keyboard key, assuming an ideal "extended" QWERTY keyboard that synthetizes various layouts, including ANSI, ISO and JIS. Note that the symbol on the key may be different from the symbolic key name: this allows to refer to keys by their physical location, which can be useful for instance in games.
*)type flags = {flag_shift : bool;flag_alt : bool;flag_control : bool;flag_meta : bool;flag_capslock : bool;flag_numlock : bool;flag_dead : bool;}The state of various keyboard flags
type key_data = {key : key;Physical key that was pressed/released
*)char : Uchar.t;Equivalent Unicode character in the current layout
*)flags : flags;State of various modifier keys when the event occured
*)}Describes a keyboard event
Describes a mouse button event
Occurs when the backend determines it is time to draw a new frame. A typical frequency is 60 times per second, though this varies depending on the platform.
Occurs when the canvas becomes active as a result of being clicked or tabbed-into
Occurs when the canvas becomes inactive as a result of another canvas being clicked or tabbed-into
Occurs when the canvas is resized by a user action
Occurs when the canvas is moved by a user action
Occurs when the user clicks the close button
Occurs when the user presses a key on the keyboard. The event description contains both the physical key (of type Event.key and the Unicode character corresponding to that key (if any), according to the current keyboard layout. For instance, pressing the "A" key on an AZERTY keyboard will yield a physical key Event.KeyQ and the Unicode code point for character "A".
Occurs when the user releases a key on the keyboard
Occurs when the user presses a mouse button
Occurs when the user releases a mouse button
Occurs when the user moves the mouse cursor
The timestamp of the last canvas event that occurred
int_of_key k returns a platform-independent integer representation of key k. This integer corresponds to the key code as defined by the USB standard for keybords.
key_of_int i returns the key corresponding to the platform-independent integer i in the range 0-255.
Exceptions:
Invalid_argument if i < 0 or i > 255