afk v0.1.0 AFK.State View Source
A struct representing the current state of the keyboard.
The state is initialized with a list of physical key to keycode maps representing the desired layers. The first layer is assumed to be the active default.
The keyboard state can be modified by calling press_key/2
and
release_key/2
with physical key IDs.
The state can then be turned into a HID report byte string using
to_hid_report/1
.
Link to this section Summary
Functions
Returns a new state struct initialized with the given keymap.
Adds a key being pressed.
Releases a key being pressed.
Return the keyboard state to as a 6-key USB keyboard HID report.
Link to this section Types
Link to this type
t()
View Sourcet() :: %AFK.State{ keymap: AFK.State.Keymap.t(), keys: %{required(atom()) => AFK.Keycode.t()}, modifiers: %{required(atom()) => AFK.Keycode.t()}, six_keys: [nil | AFK.Scancode.t()] }
Link to this section Functions
Returns a new state struct initialized with the given keymap.
Adds a key being pressed.
Releases a key being pressed.
Return the keyboard state to as a 6-key USB keyboard HID report.