canvas


Event Type

Represents one of the events: Key, DownArrow, UpArrow, LeftArrow, RightArow, Return, TimerTick, MouseButtonDown, MouseButtonUp, and MouseMotion.

Union cases

Union case Description

DownArrow

Full Usage: DownArrow

Down arrow is pressed

Key key

Full Usage: Key key

Parameters:
    key : char

A key with at letter is pressed

key : char

LeftArrow

Full Usage: LeftArrow

Left arrow is pressed

MouseButtonDown(x, y)

Full Usage: MouseButtonDown(x, y)

Parameters:
    x : int
    y : int

The left mouse button is clicked at coordinate `(x,y)`

x : int
y : int

MouseButtonUp(x, y)

Full Usage: MouseButtonUp(x, y)

Parameters:
    x : int
    y : int

The left mouse button is released at coordinate `(x,y)`

x : int
y : int

MouseMotion(x, y, relx, rely)

Full Usage: MouseMotion(x, y, relx, rely)

Parameters:
    x : int
    y : int
    relx : int
    rely : int

The mouse is moved

x : int
y : int
relx : int
rely : int

Return

Full Usage: Return

Return key is pressed

RightArrow

Full Usage: RightArrow

Right arrow is pressed

TimerTick

Full Usage: TimerTick

A tick event from the timer

UpArrow

Full Usage: UpArrow

Up arrow is pressed