2014-12-14 08:19:25 +08:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var Cylon = require("../..");
|
2014-01-14 03:09:28 +08:00
|
|
|
|
|
|
|
Cylon.robot({
|
2014-11-26 08:01:31 +08:00
|
|
|
connections: {
|
2014-12-14 08:19:25 +08:00
|
|
|
keyboard: { adaptor: "keyboard" }
|
2014-11-26 08:01:31 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
devices: {
|
2014-12-14 08:19:25 +08:00
|
|
|
keyboard: { driver: "keyboard" }
|
2014-11-26 08:01:31 +08:00
|
|
|
},
|
2014-01-14 03:09:28 +08:00
|
|
|
|
|
|
|
work: function(my) {
|
2014-12-14 08:19:25 +08:00
|
|
|
my.keyboard.on("a", function() {
|
2014-11-26 06:39:24 +08:00
|
|
|
console.log("a pressed!");
|
2014-01-14 03:09:28 +08:00
|
|
|
});
|
|
|
|
}
|
2014-11-26 06:39:24 +08:00
|
|
|
}).start();
|