LinuxQuestions.org
Visit Jeremy's Blog.
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, 01:37 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
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, 02:24 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:13 AM.

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
Open Source Consulting | Domain Registration