View Source KeyboardLayout.Key (keyboard_layout v0.1.1)

Describes a physical key and its location. Width and height are specified in relative units, so a key with a width of 2 will be twice as wide as 1, and a height of 1.5 will be half the height of a key with a height of 3.

Link to this section Summary

Types

An atom used as a unique key identifier

t()

A key struct with an id, x and y positions, a width, a height, and an led.

Functions

Returns a new key. The keyword list keys width, height, and led are optional parameters.

Link to this section Types

@type id() :: atom()

An atom used as a unique key identifier

@type t() :: %KeyboardLayout.Key{
  height: number(),
  id: id(),
  led: KeyboardLayout.LED.id(),
  width: number(),
  x: number(),
  y: number()
}

A key struct with an id, x and y positions, a width, a height, and an led.

Link to this section Functions

Link to this function

new(id, x, y, opts \\ [])

View Source
@spec new(
  id :: id(),
  x :: number(),
  y :: number(),
  opts :: [width: number(), height: number(), led: KeyboardLayout.LED.id()]
) :: t()

Returns a new key. The keyword list keys width, height, and led are optional parameters.