jamesmacaulay.zelkova.keyboard
This namespace provides keyboard-related signals.
arrows
A signal of :x
/:y
maps as per the directions
function, with the arrow keys used for directions.
directions
(directions up down left right)
Takes a key code to associate with up
, down
, left
, and right
, and returns a signal of maps with :x
and :y
keys, and values of -1, 0, or 1 based on which keys are pressed.
down?
(down? code)
Takes a key code and returns a boolean signal which is true
when the corresponding key is depressed.
keys-down
A signal of sets of the numeric key codes of whichever keys are currently depressed.
meta
A boolean signal which is true
when the meta key is depressed (this is the Command key on a Mac, and the Windows key on Windows).
wasd
A signal of :x
/:y
maps as per the directions
function, with the w
, a
, s
, and d
used for directions.