afk v0.3.0 AFK.Keycode.MFA View Source

MFA allows you to call arbitrary Elixir code from key presses.

Link to this section Summary

Link to this section Types

Link to this type

mfargs()

View Source
mfargs() :: {module(), atom()} | {module(), atom(), list()}
Link to this type

t()

View Source
t() :: %AFK.Keycode.MFA{pressed_mfa: mfargs(), released_mfa: nil | mfargs()}

Link to this section Functions

Link to this function

new(pressed_mfa, released_mfa \\ nil)

View Source
new(pressed_mfa :: mfargs(), released_mfa :: nil | mfargs()) :: t()

Creates an MFA keycode.

Examples

In this example, the keycode will call MyMod.my_func/0 when pressed, and nothing when released.

iex> new({MyMod, :my_func})
%AFK.Keycode.MFA{pressed_mfa: {MyMod, :my_func}}