Named keyboard key mappings and validation.
Maps wire-format key name strings (PascalCase, matching iced's
keyboard::key::Named debug format) to Elixir atoms. Used by
the protocol decoder to convert key events and by test helpers
to validate key names at call time.
Summary
Functions
Converts a key name string to an atom for named keys, or returns the string unchanged for single-character keys.
Parses a key location string to an atom.
Converts a physical key code string to an atom, or returns the string unchanged for unknown codes.
Functions
Converts a key name string to an atom for named keys, or returns the string unchanged for single-character keys.
Examples
iex> Plushie.Protocol.Keys.parse_key("Escape")
:escape
iex> Plushie.Protocol.Keys.parse_key("a")
"a"
@spec parse_location(String.t() | nil) :: :left | :right | :numpad | :standard
Parses a key location string to an atom.
Converts a physical key code string to an atom, or returns the string unchanged for unknown codes.