Keyboard modifier state change event.
Emitted when the set of held modifier keys changes (e.g. pressing or releasing Shift, Ctrl, Alt, or Command/Super). Useful for updating UI hints that depend on modifier state without waiting for a key event.
Fields
modifiers- aPlushie.KeyModifiersstruct with boolean fields forshift,ctrl,alt,command, andlogocaptured- whether a subscription captured this event
Pattern matching
def update(model, %ModifiersEvent{modifiers: %{shift: true}}) do
%{model | shift_held: true}
end
def update(model, %ModifiersEvent{modifiers: mods}) do
%{model | modifiers: mods}
end
Summary
Types
@type t() :: %Plushie.Event.ModifiersEvent{ captured: boolean(), modifiers: Plushie.KeyModifiers.t(), window_id: String.t() | nil }