cylon/examples/keyboard/keyboard.js

12 lines
273 B
JavaScript
Raw Normal View History

2014-01-14 03:09:28 +08:00
var Cylon = require('../..');
Cylon.robot({
connection: { name: 'keyboard', adaptor: 'keyboard' },
device: {name: 'keyboard', driver: 'keyboard'},
work: function(my) {
my.keyboard.on('a', function(key) {
console.log("A PRESSED!");
});
}
}).start();