0

How can I send "ALT"+"s" keys to a window using RAutomation? No info in Google at all.

orde
  • 5,233
  • 6
  • 31
  • 33
Nodir Nasirov
  • 1,488
  • 3
  • 26
  • 44

2 Answers2

1

Untested, but you should be able to use send_keys. The exact syntax depends on the selected adapter type. These are the examples for the Win32 adapter:

RAutomation::Window.new(:title => //).send_keys "hello!"
RAutomation::Window.new(:title => //).send_keys [:control, "a"], "world!"
orde
  • 5,233
  • 6
  • 31
  • 33
  • nope, did not work, getting error: NoMethodError: undefined method `split' for [:alt, "s"]:Array – Nodir Nasirov Aug 19 '16 at 19:23
  • The rdoc suggests referring "to specific Adapter documentation for all possible values". You should check the docs for the adapter that you're using. Answer updated. – orde Aug 19 '16 at 19:30
0

You can see all defined special keys at keys.rb and some specs of how to use them.

Looking at the specs, it seems that your example would be something like this:

window.send_keys [:alt, "s"]

Maybe you want to use :left_alt instead?

Jarmo Pertman
  • 1,905
  • 1
  • 12
  • 19