98-keyboard-examples

This commit is contained in:
xixebombilla 2014-01-13 13:09:28 -06:00
parent 90d9cf849b
commit 038bd5d3a7
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,10 @@
Cylon = require '../..'
Cylon.robot
device: { name: 'keyboard', driver: 'keyboard' }
connection: { name: 'keyboard', adaptor: 'keyboard' }
work: (my) ->
my.keyboard.on 'a', (key) ->
console.log "A PRESSED!"
.start()

View File

@ -0,0 +1,12 @@
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();