Zelkova Api Documentation

Version: 0.4.0

jamesmacaulay.zelkova.keyboard

This namespace provides keyboard-related signals.

alt

A boolean signal which is true when the alt key is depressed.

arrows

A signal of :x/:y maps as per the directions function, with the arrow keys used for directions.

blur-channel

(blur-channel graph opts)

ctrl

A boolean signal which is true when the control key is depressed.

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.

enter

A boolean signal which is true when the enter key is depressed.

key-signal

(key-signal f)

keydown-channel

(keydown-channel graph opts)

keys-down

A signal of sets of the numeric key codes of whichever keys are currently depressed.

keyup-channel

(keyup-channel graph opts)

last-pressed

A signal of the code of the last pressed key.

listen

(listen el type & args)

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).

shift

A boolean signal which is true when the shift key is depressed.

space

A boolean signal which is true when the space key is depressed.

wasd

A signal of :x/:y maps as per the directions function, with the w, a, s, and d used for directions.