View Source AFK.Keycode.Layer (afk v0.3.2)
Represents a key that can activate other layers on and off in various ways.
Layers can be activated in 3 ways:
:hold
- Temporarily activates a layer while being held:toggle
- Toggles a layer on or off when pressed:default
- Sets a layer as the default layer
Link to this section Summary
Functions
Creates a layer activation keycode.
Link to this section Types
Link to this section Functions
Creates a layer activation keycode.
The valid types are:
:hold
- Activates a layer while being held:toggle
- Toggles a layer on or off when pressed:default
- Sets a layer as the default layer
examples
Examples
iex> new(:hold, 1)
%AFK.Keycode.Layer{layer: 1, mode: :hold}
iex> new(:hold, 2)
%AFK.Keycode.Layer{layer: 2, mode: :hold}
iex> new(:toggle, 1)
%AFK.Keycode.Layer{layer: 1, mode: :toggle}
iex> new(:default, 2)
%AFK.Keycode.Layer{layer: 2, mode: :default}