Turns a CauldronGPU window's key events into the events a drafter app gets from a
terminal speaking the kitty keyboard protocol with key releases
(Drafter.Terminal.KittyKeyboard): a press is the legacy {:key, ...} event followed
by {:key_down, key, modifiers}, a repeat the legacy event alone, a release
{:key_up, key, modifiers}. Shifted glyphs are those of a US keyboard.
iex> alias Cauldron2D.Drafter.Client.WindowKeys
iex> WindowKeys.events({:key, :down, :a, false}, [:shift])
[{:key, :A}, {:key_down, :a, [:shift]}]
iex> WindowKeys.events({:key, :up, :return, false}, [])
[{:key_up, :enter, []}]
Summary
Functions
The drafter events for one window key event with modifiers held.
The modifiers held after event, from those held before it, in the order [:ctrl, :alt, :shift].
Types
Functions
@spec events(window_event(), [modifier()]) :: [tuple()]
The drafter events for one window key event with modifiers held.
@spec modifiers(window_event(), [modifier()]) :: [modifier()]
The modifiers held after event, from those held before it, in the order [:ctrl, :alt, :shift].