98-keyboard-examples
This commit is contained in:
parent
90d9cf849b
commit
038bd5d3a7
|
@ -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()
|
|
@ -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();
|
Loading…
Reference in New Issue