LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-04-2008, 02:37 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA
Distribution: Debian/ Fedora
Posts: 435

Rep: Reputation: 33
simulated keyboard inputs under Linux


Hi group,

I'm looking for a program or API that will allow me to 'drive' a Gnome or Fluxbox WM.

By drive I mean:
Switch Workspaces
Rotate through the window list (Alt-Tab)
Enter key strokes into a window
Etc.
What I am trying to do is create a script to switch the display to show all of the workspaces and windows within them.

I know about 'chvt' but that is only part of the solution.

Under OS/2 there was a Rexx API that worked great, I think it was call APMT?

Any ideas?
 
Old 07-04-2008, 03:24 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
You might want to try xmacro. Documentation is sparse on it, but it's actually easy to use. Simply record your mouse and keyboard actions with
Code:
xmacrorec2 > macro.txt
(There's also xmacrorec (no number). I don't know what the difference is, but xmacrorec doesn't seem to handle mouse movements for some reason. Edit: xmacrorec appears to be for remote displays, while xmacrorec2 records the local one only.)

Then you can edit it as you wish and play it back with
Code:
cat macro.txt | xmacroplay -d 500 ":0.0"
the last number is your display number, and the -d is the number of milliseconds between commands. Set it too low and everything will fly through almost instantaneously. But setting it slower has the side-effect of making mouse double-clicking impossible. You can insert delays into the macro file itself instead if necessary.

Last edited by David the H.; 07-04-2008 at 03:31 PM.
 
  


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
Keyboard inputs same characters? yuxingpiao Linux - Hardware 0 06-12-2008 04:25 AM
Perl Keyboard Inputs opto Programming 2 08-28-2006 01:28 PM
Comparison: Enterprise Linux Vs. Solaris need feedback and inputs. savithk Linux - Enterprise 2 01-22-2006 02:38 PM
Simulated mouse clicks in linux? devilkin Programming 2 02-14-2005 08:59 AM
Booting Kernel with simulated root file-system priyankadeven Linux - Newbie 2 12-29-2004 07:47 PM


All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
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