Search documentation of Plushie

# Plushie.Type.KeyModifiers (Plushie v0.7.2)

Copy Markdown View Source

Event field type for keyboard modifier state.

Parses a wire-format modifier map (string keys, boolean values) into a `%Plushie.KeyModifiers{}` struct. Missing fields default to `false`.

## Examples

    iex> Plushie.Type.KeyModifiers.parse(%{"ctrl" => true, "shift" => false})
    {:ok, %Plushie.KeyModifiers{ctrl: true, shift: false, alt: false, logo: false, command: false}}

    iex> Plushie.Type.KeyModifiers.parse(%{})
    {:ok, %Plushie.KeyModifiers{}}

    iex> Plushie.Type.KeyModifiers.parse(nil)
    {:ok, %Plushie.KeyModifiers{}}

## Summary

### Functions

parse(mods)

## Functions

# parse(mods)

    @spec parse(value :: term()) :: {:ok, Plushie.KeyModifiers.t()} | :error