Class: Artoo::Drivers::Keyboard

Inherits:
Driver
  • Object
show all
Defined in:
lib/artoo/drivers/keyboard.rb

Overview

The keyboard driver behaviors

Instance Method Summary collapse

Instance Method Details

#start_driverObject

Public: Start driver and any required connections.

Returns null.



11
12
13
14
15
16
17
18
# File 'lib/artoo/drivers/keyboard.rb', line 11

def start_driver
  every(0.05) do
    key = connection.get_char # get the next char if any...
    publish(event_topic_name("key"), key) if key
  end

  super
end