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 or KeyCoder.post_event.
Supports most, if not all, latin keyboard layouts, maybe some international layouts as well. Japanese layouts can be made to work with use of ‘String#transform`.
Defined Under Namespace
Classes: EventGenerator, Lexer
Instance Method Summary collapse
-
#keyboard_events_for(string) ⇒ Array<Array(Fixnum,Boolean)>
Generate keyboard events for the given string.
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 [Keyboarding documentation](github.com/Marketcircle/AXElements/wiki/Keyboarding).
33 34 35 |
# File 'lib/accessibility/string.rb', line 33 def keyboard_events_for string EventGenerator.new(Lexer.new(string).lex).generate end |