passing keypress to a non-focused application


I am trying to pass a keypress, that has a state modified with the shift mask (0x0001) to an application that is active, but just not in focus… anyone else ever try to do this before?

I have tried using a keybinding to a function, and then pass a synthetic keypress (FakeKeypress) onto the desired application, but I can’t get the FakeKeypress to pass in a state other than 0x0000. Anyone have any ideas?

Below is the code that I have been trying (unsuccessfully):

Key F1 A A FuncFoo
DestroyFunc FuncFoo
AddToFunc   FuncFoo
+ I FuncFooHelper "foo"

     AddToFunc FuncFooHelper
     + I WindowId $[] FakeKeypress press F1 release F1

If anyone has been able to make something similar work, I would appreciate any ideas that you have.


Nope, but I can’t see how it is ever going to work. As I have mentioned in the past, the propogation is always to the active window.

I believe you can do things like this:

Key (*application name*) <key_pressed> A A --

Which passes the event down to the application, but the window has to have focus.

– Thomas Adam