Module

Gesso.Interactions

Package
purescript-gesso
Repository
smilack/purescript-gesso

Interactions are a wrapper for HTML events that allow specifying event types and handlers which are attached to the canvas when it's created. Interactions are part of the AppSpec and will typically be specified as an update of the default record, similar to mkEval and defaultEval in Halogen.

The Interactions type is a record of arrays of interactions for each event type.

#ClipboardInteraction Source

#DragInteraction Source

#EventInteraction Source

#FocusInteraction Source

#KeyboardInteraction Source

#MouseInteraction Source

#PointerInteraction Source

#TouchInteraction Source

#WheelInteraction Source

#default Source

default :: forall state. Interactions state

A default Interactions record containing no interactions. The attributes can be overridden individually instead of manually creating a complete but mostly empty record. For example,

Interactions.default { keyboard = [ handleKeyDown ] }

Re-exports from Gesso.Interactions.Events

#onTransitionEnd Source

#onInput Source

onInput :: forall s. Handler Event s -> Interaction Event s

#onDragStart Source

#onDragLeave Source

#onDragEnter Source

Re-exports from Gesso.Interactions.Internal

#WheelEvent Source

#TouchEvent Source

#PointerEvent Source

#MouseEvent Source

#KeyboardEvent Source

#Interactions Source

type Interactions state = { base :: Array (Interaction Event state), clipboard :: Array (Interaction ClipboardEvent state), drag :: Array (Interaction DragEvent state), focus :: Array (Interaction FocusEvent state), keyboard :: Array (Interaction KeyboardEvent state), mouse :: Array (Interaction MouseEvent state), pointer :: Array (Interaction PointerEvent state), touch :: Array (Interaction TouchEvent state), wheel :: Array (Interaction WheelEvent state) }

Interactions is a record containing arrays of interactions for each type of event that Canvas supports. It's used in Gesso.Application.AppBehavior to add event handlers to a component.

#Interaction Source

data Interaction event state

An Interaction is a combination event listener and handler which is turned into an HTML property and attached to a Gesso canvas. They can be constructed with the "on" functions (onMouseMove, onKeyDown, etc.)

#Handler Source

type Handler event state = event -> UpdateFunction state

An event handler is a variant of an update function, which receives an event and produces an update function in response.

#FocusEvent Source

#Event Source

data Event

Basic type for all DOM events.

#DragEvent Source

#ClipboardEvent Source