View Source AFK.Keycode.Key (afk v0.3.2)

Represents a basic keyboard keycode, like letters, numbers, etc.

All standard keys on a keyboard except the modifiers can be represented by Key keycodes. The currently supported keys are key/0.

Link to this section Summary

Functions

Creates a basic key keycode.

Link to this section Types

@type key() ::
  :a
  | :b
  | :c
  | :d
  | :e
  | :f
  | :g
  | :h
  | :i
  | :j
  | :k
  | :l
  | :m
  | :n
  | :o
  | :p
  | :q
  | :r
  | :s
  | :t
  | :u
  | :v
  | :w
  | :x
  | :y
  | :z
  | :"1"
  | :"2"
  | :"3"
  | :"4"
  | :"5"
  | :"6"
  | :"7"
  | :"8"
  | :"9"
  | :"0"
  | :enter
  | :escape
  | :backspace
  | :tab
  | :space
  | :minus
  | :equals
  | :left_square_bracket
  | :right_square_bracket
  | :backslash
  | :semicolon
  | :single_quote
  | :grave
  | :comma
  | :period
  | :slash
  | :caps_lock
  | :f1
  | :f2
  | :f3
  | :f4
  | :f5
  | :f6
  | :f7
  | :f8
  | :f9
  | :f10
  | :f11
  | :f12
  | :print_screen
  | :scroll_lock
  | :pause
  | :insert
  | :home
  | :page_up
  | :delete
  | :end
  | :page_down
  | :right
  | :left
  | :down
  | :up
  | :application
  | :mute
  | :volume_up
  | :volume_down
@type t() :: %AFK.Keycode.Key{key: key()}

Link to this section Functions

@spec new(key()) :: t()

Creates a basic key keycode.

examples

Examples

iex> new(:a)
%AFK.Keycode.Key{key: :a}

iex> new(:up)
%AFK.Keycode.Key{key: :up}