4 Keyboard API
Jakub Sobon edited this page 2019-03-03 18:47:18 -05:00

Doc Status

The keyboard package exposes types that represent keys on the keyboard.

This is a data-only package which provides types that are accepted by the infrastructure and widgets in multiple locations.

The public API surface of this package consists of the following:

keyboard.Key

The keyboard.Key type represents keys on the keyboard. The package provides predefined values for some of the keys which can be used directly, e.g:

var key keyboard.Key
key = keyboard.KeyEnter

For all other keys like regular letters, the character that represents the letter can be directly assigned to the Key type.

var key keyboard.Key
key = 'a'