LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-03-2011, 01:11 AM   #1
RonBigman
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Rep: Reputation: 0
How can I simulate key strokes events in other processes in linux?


Hi
I have a program that receive user input.
I want to run this program automatically without user interaction, and in order to do that I need to simulate key events.
How can I do such a thing?

The program I am running is partly java and partly shell.

The shell part is easily done by using:
./prog.sh <parameters (Parameters being a file containing parameters)
But the java doesn't work similarly.

Thanks
Ron
 
Old 02-03-2011, 06:16 AM   #2
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: Debian lenny, Slackware 12
Posts: 808

Rep: Reputation: 178Reputation: 178
Quote:
Originally Posted by RonBigman View Post
Hi
I have a program that receive user input.
I want to run this program automatically without user interaction, and in order to do that I need to simulate key events.
Use expect. A brief intro can also be found here.
 
Old 02-06-2011, 01:42 PM   #3
RonBigman
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks it worked

The expect command is working perfectly

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to programatically feed top with key strokes babaqga Linux - Software 4 09-02-2010 02:54 AM
Midnight Commander requires twice the key-strokes jsmith6 Slackware 13 05-19-2006 03:47 PM
problem recognising key strokes himateja Programming 3 05-27-2005 05:54 AM
Identifying and Mapping/Binding key strokes mikeyt_333 Linux - General 3 10-02-2003 10:42 PM
Repeating key strokes toxic53 Linux - General 1 12-11-2002 09:06 PM


All times are GMT -5. The time now is 08:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration