1.0.0-rtm.4 • Published 10 years ago
cycle-keyboard v1.0.0-rtm.4
cycle-keyboard
A keyboard driver for cycle.js. View Demo
Usage
Install the package using node package manager
$ npm install cycle-keyboard@1.0.0-rtm.4Import the driver in your cycle app
import { makeKeyboardDriver } from 'cycle-keyboard'
...
const drivers = {
...
keyboard: makeKeyboardDriver()
}Subscribe to keyboard-related event streams on the driver
function main({ ..., keyboard }) {
const keyUp$ = keyboard.ups().map(ev => ev.displayKey + ' was pressed');
}The driver provides the following xstream streams:
ups(key?: number|string), a stream of all keyup events emitted on the document, with an additionaldisplayKeyproperty, optionally filtered by a key code or a key namedowns(key?: number|string), a stream of all keydown events emitted on the document, with an additionaldisplayKeyproperty, optionally filtered by a key code or a key namepresses(key?: number|string), a stream of all keypress events emitted on the document, with additionaldisplayKeyanddisplayCharproperties, optionally filtered by a key code or a key nameshift$, a stream of booleans indicating if the shift key is held down, andcapsLock$, a stream of booleans indicating if the caps lock is on
1.0.0-rtm.4
10 years ago
1.0.0-rtm.3
10 years ago
1.0.0-rtm.2
10 years ago
1.0.0-alpha.206
10 years ago
1.0.0-alpha.204
10 years ago
1.0.0-alpha.203
10 years ago
1.0.0-alpha.201
10 years ago
1.0.0-rtm.1
10 years ago
1.0.0-alpha.11
10 years ago
1.0.0-alpha.10
10 years ago
1.0.0-alpha.8
10 years ago
1.0.0-alpha.7
10 years ago
1.0.0-alpha.6
10 years ago
1.0.0-alpha.5
10 years ago
1.0.0-alpha.4
10 years ago
1.0.0-alpha.3
10 years ago
1.0.0-alpha.2
10 years ago
1.0.0-alpha.1
10 years ago
1.0.0-rc.8
10 years ago
1.0.0-rc.7
10 years ago
1.0.0-rc.6
10 years ago
1.0.0-rc.5
10 years ago
1.0.0-rc.4
10 years ago
1.0.0-rc.3
10 years ago
1.0.0-rc.2
10 years ago
1.0.0-rc.1
10 years ago
0.12.0
10 years ago
0.11.1
10 years ago
0.11.0
10 years ago
0.10.4
10 years ago
0.10.3
10 years ago
0.10.2
10 years ago
0.10.1
10 years ago
0.10.0
10 years ago
0.9.1
10 years ago
0.9.0
10 years ago
0.3.0
10 years ago
0.2.0
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago