afk v0.1.0 AFK.Keycode.Layer View Source

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 type

mode()

View Source
mode() :: :default | :hold | :toggle
Link to this type

t()

View Source
t() :: %AFK.Keycode.Layer{layer: layer(), mode: mode()}

Link to this section Functions

Link to this function

new(mode, layer)

View Source
new(mode(), layer()) :: t()

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

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}