I am looking for a Linux equivalent for this Windows utility: Key Presser
Basically, I need a program that allows me to choose a key on a keyboard, and then the program automatically simulates a key press of that key and inserts it into another running application of my choosing.
Does anyone know of a program, or an alternative way that I can accomplish this?
Thanks for the plethora of links; they’ll be a big help in my search.
As to why I need this program, it isn’t actually for me, but my girlfriend. I finally convinced her to let me put Linux on her laptop again (long story), but she demanded I copy every bit of functionality she has in Windows. This includes this key presser utility. She plays the game Secondlife a lot, and she uses the key presser utility to automatically press certain key combinations in the game, whilst she is away doing something else.
I thought about writing her a script that would do it, but unfortunately a program like this far exceeds my script writing abilities. As you say, if my search here is unfruitful, I may be requesting assistance in the programming forum. I’ve also considered seeing if the Windows program will run in Wine.
Thanks again for the links. They’ll keep me busy for awhile.
On Tue, 2010-02-02 at 16:16 +0000, srschifano wrote:
> I finally convinced her to let me put Linux on her laptop
> again (long story), but she demanded I copy every bit of functionality
> she has in Windows.
Sigh (just fyi)… what your girlfriend is asking for is technically
impossible. Likewise, I would never try to require Windows to do
everything that a Linux distro can do (also impossible).
Hope you can find enough to make her happy… but she’s got
the WRONG motives right now. Moving to a different OS is simply
that… moving to a different OS.
Keep us posted on the progress (her satisfaction).
Believe me, I’m well aware of this. She used to run Linux (her laptop came with it) but she got bit by the Intel graphics bug in 08-09 and it left a bad taste in her mouth. I’ve been trying to get her back onto Linux b/c her laptop was designed for it and overall it runs heaps better than Vista (even graphics performance is improved thanks to the changes that initially broke everything.) I’ve been trying to convince her that demanding everything apples-for-apples is a little unreasonable, but it is her laptop after all.
After I got everything else set up, she did comment that things are faster and prettier (I customized the plasma shell extensively). And so far, she can do everything in openSUSE she can in Windows, save for the Key presser. Unfortunately the Windows utility won’t work with Wine (didn’t expect it too) but I did make some progress in finding info to write a script.
@ken_yap - thanks for the link. On a brief read-through it looks very interesting. I’ll keep y’all posted.
On Tue, 2010-02-02 at 01:46 +0000, srschifano wrote:
> I am looking for a Linux equivalent for this Windows utility:
> ‘Key Presser’
> Basically, I need a program that allows me to choose a key on a
> keyboard, and then the program automatically simulates a key press of
> that key and inserts it into another running application of my
> Does anyone know of a program, or an alternative way that I can
> accomplish this?
About 4 years ago I wrote something using xsendkey to push
a keypress out to a running Firefox. You could use KDE’s
key shortcuts to invoke xsendkey. The problem is identifying
the window for xsendkey. I’m sure there’s a dbus/dcop call
that could get that somehow roughly by name.
Success! Thanks to the information everyone posted in this thread, I was able to locate a command-line utility that would do everything I need! Thank you everyone!
The utility I found is called xdotool. It uses xsendkey and xtest to send fake key presses to X windows using a variety of criteria. The utility is highly configurable, and can even control mouse movements, window actions, and window focus.
With xdotool, I was able to write a very simple shell script that copies most of the basic functions the Windows KeyPresser utility has. There are still a few areas I am looking to improve upon with my script, but for the time being my girlfriend is very happy.
From what she tells me, the Windows utility actually has a lot of problems identifying which application to send the input actions too, and a lot of times she can’t do much else on her laptop while it is running. In this regard, my script (though slightly more primitive) is more reliable.
So again, thank you to everyone! Hopefully this time around, she’ll stick with Linux.