Module: Rukuli::Typeable

Included in:
Region
Defined in:
lib/rukuli/typeable.rb

Instance Method Summary collapse

Instance Method Details

#enter(text) ⇒ Object

Public: Types text then presses the return/enter key on the keyboard

text - String

Returns nothing


28
29
30
# File 'lib/rukuli/typeable.rb', line 28

def enter(text)
  @java_obj.type(text + Rukuli::KEY_RETURN)
end

#type(text, modifier = 0) ⇒ Object

Public: Types text as if it was being typed on the keyboard with an optional key modifier

text - String representing text to be typed on keyboard modifier - (optional) Sikilu constant (defined in key_code.rb) representing key to hold while typing text

Examples

region.type("Hello World")
region.type("s", Rukuli::KEY_CMD) # saves a file

Returns nothing


19
20
21
# File 'lib/rukuli/typeable.rb', line 19

def type(text, modifier = 0)
  @java_obj.type(nil, text, modifier)
end