cylon/examples/keyboard/keyboard.litcoffee

14 lines
289 B
Plaintext

# Keyboard
First, let's import Cylon:
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()