node-apple-remote
v1.0.0
Published
Simple event-driven interface to Aluminum Apple Remote
Downloads
13
Readme
node-apple-remote
Simple node.js library for receiving events from an aluminum Apple Remote
Usage
var AppleRemote = require('node-apple-remote');
var remote = new AppleRemote();
try {
remote.open()
.on('left', /* ... */)
.on('left.long', /* ... */)
.on('left.long.released', /* ... */)
.on('center', /* ... */)
.on('center.long', /* ... */)
} catch (e) {
// an exception is thrown if the apple remote
// device was not found on the system
}
All events
'raw' // Every single event; the Button pressed is passed.
// it is unlikely you will need this
'button' // Each parsed button event; for example, 'left'
// will never have a 'left.released' follow it,
// though a 'raw' Released event may fire. In
// most cases, it may be easiest to register
// specific listeners (below)
'left' // single-press
'left.long' // long-press (as in rewind); release to follow
'left.long.released' // release of long-press
'right'
'right.long'
'right.long.released'
'up' // pressed; release ALWAYS follows
'up.released' // note that there is no up.long
'down'
'down.released'
'center' // single-press only
'center.long' // long-press only (not "holdable")
'playpause'
'playpause.long'
'menu'
'menu.long'
'error' // emits with the an error Object from node-hid
node-apple-remote and Electron/NW.js
If using this library with Electron or NW.js, see the notes from node-hid.