Event field types for unified pointer events.
Provides pointer type and button parsing for the unified pointer event model that replaces the old canvas*/mouse/sensor_ event families.
Pointer types
:mouse-- standard mouse input:touch-- touchscreen finger:pen-- stylus or pen tablet
Buttons
:left,:right,:middle-- standard three-button mouse:back,:forward-- extended navigation buttons
Examples
iex> Plushie.Type.Pointer.parse_pointer("mouse")
{:ok, :mouse}
iex> Plushie.Type.Pointer.parse_button("right")
{:ok, :right}
Summary
Functions
Parses a wire-format button string into an atom.
Parses a wire-format pointer type string into an atom.
Types
Functions
Parses a wire-format button string into an atom.
Returns {:ok, button} or :error. Defaults to :left when nil
(press/release events without an explicit button are left clicks).
@spec parse_pointer(value :: term()) :: {:ok, pointer_type()} | :error
Parses a wire-format pointer type string into an atom.
Returns {:ok, pointer_type} or :error.