Keyboard Macro Program (as available in Windows)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Apologies in advance:
   * I just joined this list -- I should probably lurk a little bit 
more before posting, but I guess I'm impatient.
   * This is basically a duplicate of an email I sent to the 
expert@linux-mandrake.org list yesterday morning -- no response so far 
and I guess I don't expect one -- probably not an appropriate list, but 
maybe I should have given it more time.)

Since I started making a transition to Linux, I've been looking for a 
keyboard macro program.  By that I mean a program that will intercept 
the keystrokes from my keyboard and send a string of keycodes to an 
arbitrary program.

(In dos/Windows (I'm not 100% certain I actually ever used a keyboard 
macro program in Windows) I could set up certain keystroke combinations 
to send long strings to any program.  Maybe <alt><shift><F10> would 
send my sig, or a salutation, like "Dear Sir", or whatever.)

Haven't found anything so far in Linux.

I've looked at and/or tried:

loadkeys:  I can use loadkeys to send a different keycode, but haven't 
found a way (and don't think there is a way) to send a string of 
keycodes in response to one keystroke.

expect: From what I've read and tried so far I think:
   * Programs like kwrite (just one example) don't accept input from 
stdin, or send screen output to stdout, so I don't think something like 
expect, which, IIUC, looks at things on stdout and sends things to 
stdin, can have any effect on kwrite
   * Assuming kwrite could accept input from stdin, I'd really want 
expect to be sort of a filter on stdin -- look at things coming in on 
stdin, and replace them with something else if it triggers one of the 
"expect rules" that I would set up

The author of klipper promised to do somethings in the klipper with kde 
3.0 (and he might have) but even so, those things will work primarily 
with kde applications.

So, I'd like to take a semi-serious look at writing my own program.  
(By semi-serious, I mean that I probably don't have the programming 
skills at this time to actually write the program, but I'd like to 
attempt to figure out a workable approach and what would be involved.)

In the dos world, one way of writing a program like this is to 
intercept (hook) the keyboard interrupt, look at the input from the 
keyboard, and if appropriate, substitute some different input.

Anybody know:

   * If a similar approach can be followed in Linux?
   
   * Where to learn more about how Linux handles this type of thing and 
how I could hook the interrupt in Linux? (Must I dig into the Linux 
kernel?  Into the whole Linux kernel?)

   * Pointers to resources (books, articles, appropriate mail lists, 
etc.)?

   * Other suggestions?

Of course, it would be wonderful to hear that someone else is already 
working on such a program ;-)

Randy Kramer
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux