Module: Accessibility::String

Defined in:
lib/accessibility/string.rb

Overview

Parses strings of human readable text into a series of events meant to be processed by Core#post:to: or KeyCoder.post_event.

Supports most, if not all, latin keyboard layouts, maybe some international layouts as well.

Defined Under Namespace

Classes: EventGenerator, Lexer

Instance Method Summary collapse

Instance Method Details

#keyboard_events_for(string) ⇒ Array<Array(Fixnum,Boolean)>

Generate keyboard events for the given string. Strings should be in a human readable with a few exceptions. Command key (e.g. control, option, command) should be written in string as they appear in Accessibility::String::EventGenerator::CUSTOM.

For more details on event generation, read the Keyboard Events documentation.

Parameters:

Returns:

  • (Array<Array(Fixnum,Boolean)>)


25
26
27
# File 'lib/accessibility/string.rb', line 25

def keyboard_events_for string
  EventGenerator.new(Lexer.new(string).lex).generate
end