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
type ClipboardInteraction state = Interaction ClipboardEvent state
#DragInteraction Source
type DragInteraction state = Interaction DragEvent state
#EventInteraction Source
type EventInteraction state = Interaction Event state
#FocusInteraction Source
type FocusInteraction state = Interaction FocusEvent state
#KeyboardInteraction Source
type KeyboardInteraction state = Interaction KeyboardEvent state
#MouseInteraction Source
type MouseInteraction state = Interaction MouseEvent state
#PointerInteraction Source
type PointerInteraction state = Interaction PointerEvent state
#TouchInteraction Source
type TouchInteraction state = Interaction TouchEvent state
#WheelInteraction Source
type WheelInteraction state = Interaction WheelEvent state
#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
#onWheel Source
onWheel :: forall s. Handler WheelEvent s -> Interaction WheelEvent s
#onTransitionEnd Source
onTransitionEnd :: forall s. Handler Event s -> Interaction Event s
#onTouchStart Source
onTouchStart :: forall s. Handler TouchEvent s -> Interaction TouchEvent s
#onTouchMove Source
onTouchMove :: forall s. Handler TouchEvent s -> Interaction TouchEvent s
#onTouchLeave Source
onTouchLeave :: forall s. Handler TouchEvent s -> Interaction TouchEvent s
#onTouchEnter Source
onTouchEnter :: forall s. Handler TouchEvent s -> Interaction TouchEvent s
#onTouchEnd Source
onTouchEnd :: forall s. Handler TouchEvent s -> Interaction TouchEvent s
#onTouchCancel Source
onTouchCancel :: forall s. Handler TouchEvent s -> Interaction TouchEvent s
#onPaste Source
onPaste :: forall s. Handler ClipboardEvent s -> Interaction ClipboardEvent s
#onMouseUp Source
onMouseUp :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onMouseOver Source
onMouseOver :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onMouseOut Source
onMouseOut :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onMouseMove Source
onMouseMove :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onMouseLeave Source
onMouseLeave :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onMouseEnter Source
onMouseEnter :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onMouseDown Source
onMouseDown :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onKeyUp Source
onKeyUp :: forall s. Handler KeyboardEvent s -> Interaction KeyboardEvent s
#onKeyDown Source
onKeyDown :: forall s. Handler KeyboardEvent s -> Interaction KeyboardEvent s
#onFocusOut Source
onFocusOut :: forall s. Handler FocusEvent s -> Interaction FocusEvent s
#onFocusIn Source
onFocusIn :: forall s. Handler FocusEvent s -> Interaction FocusEvent s
#onFocus Source
onFocus :: forall s. Handler FocusEvent s -> Interaction FocusEvent s
#onDragStart Source
onDragStart :: forall s. Handler DragEvent s -> Interaction DragEvent s
#onDragOver Source
onDragOver :: forall s. Handler DragEvent s -> Interaction DragEvent s
#onDragLeave Source
onDragLeave :: forall s. Handler DragEvent s -> Interaction DragEvent s
#onDragExit Source
onDragExit :: forall s. Handler DragEvent s -> Interaction DragEvent s
#onDragEnter Source
onDragEnter :: forall s. Handler DragEvent s -> Interaction DragEvent s
#onDoubleClick Source
onDoubleClick :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onCut Source
onCut :: forall s. Handler ClipboardEvent s -> Interaction ClipboardEvent s
#onCopy Source
onCopy :: forall s. Handler ClipboardEvent s -> Interaction ClipboardEvent s
#onClick Source
onClick :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
#onBlur Source
onBlur :: forall s. Handler FocusEvent s -> Interaction FocusEvent s
#onAuxClick Source
onAuxClick :: forall s. Handler MouseEvent s -> Interaction MouseEvent s
Re-exports from Gesso.Interactions.Internal
#WheelEvent Source
data WheelEvent
#TouchEvent Source
data TouchEvent
#PointerEvent Source
data PointerEvent
#MouseEvent Source
data MouseEvent
#KeyboardEvent Source
data KeyboardEvent
#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
data FocusEvent
#ClipboardEvent Source
data ClipboardEvent