Method: AutoItX3::Control#send_keys
- Defined in:
- lib/AutoItX3/control.rb
#send_keys(str, flag = 0) ⇒ Object
Simulates user input to a control.
Parameters
str-
The input string to simulate.
flag-
(0) If set to 1, escape sequences in braces { and } are ignored.
Return value
nil.
Raises
- Au3Error
-
Control or window not found.
Example
#Send some keystrokes
ctrl.send_keys("Abc")
#Send some keys with escape sequences
ctrl.send_keys("Ab{ESC}c")
#Ignore the escape sequences
ctrl.send_keys("Ab{ESC}c", 1)
254 255 256 257 258 259 |
# File 'lib/AutoItX3/control.rb', line 254 def send_keys(str, flag = 0) Control.functions[__method__] ||= AU3_Function.new("ControlSend", 'SSSSI', 'L') res = Control.functions[__method__].call(@title.wide, @text.wide, @c_id.wide, str.wide, flag) raise_unfound if res == 0 nil end |