GPUI.Event (gpui v0.2.0-rc.1)

Copy Markdown View Source

Normalized UI event delivered from a display into GPUI.Session.

Summary

Functions

Returns event types accepted by the low-level native injection boundary.

Returns the renderer-independent event types routed to root view callbacks.

Converts an event struct and its extra attributes into a plain event map.

Types

t()

@type t() :: %GPUI.Event{
  attrs: map(),
  event: String.t() | nil,
  type: type(),
  value: term(),
  window_id: pos_integer() | nil
}

type()

@type type() ::
  :click
  | :command
  | :change
  | :select
  | :release
  | :search
  | :submit
  | :range
  | :link
  | :transaction
  | :selection
  | :viewport
  | :geometry
  | :range_geometry
  | :hit_test
  | :bounds
  | :focus
  | :blur
  | :keydown
  | :keyup
  | :drag_enter
  | :drag_move
  | :drag_leave
  | :drop
  | :clipboard
  | :clipboard_write
  | :copy
  | :file_read
  | :window_close_request
  | :window_focus
  | :window_blur
  | :window_closed

Functions

injectable_types()

@spec injectable_types() :: [type()]

Returns event types accepted by the low-level native injection boundary.

is_routed_type(type)

(macro)

normalize(event)

@spec normalize(t() | map() | keyword()) :: {:ok, map()} | {:error, term()}

routed_types()

@spec routed_types() :: [type()]

Returns the renderer-independent event types routed to root view callbacks.

to_map(event)

@spec to_map(t()) :: map()

Converts an event struct and its extra attributes into a plain event map.