1

I want to create a application that simulates various users but I need this "ghost" users to type on the keyboard, how to I simulate a keypress and keyrealease events on Ruby?

2
  • 1
    In which environment are you planing on using this application? Browser? Desktop? Commented Jan 12, 2011 at 17:00
  • In Safari on MacOS X, I found a solution using a module called 'appscript', there is a method for simulate key events, i.e. Appscript.app('System Events').keystroke(' '); simulates a spacebar click event. Commented Jan 13, 2011 at 1:30

1 Answer 1

1

Java has a class called Robot(I think) which simulates stuff like that.You could use JRuby to invoke that. I ever had some testscript somewhere,I'll post it when i find it..but I remember it was really dead simple to do that with that class,you even could move the cursor around ,really funny tough.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.