Author |
Topic |
|
Rob
USA
2615 Posts |
Posted - 04/22/2012 : 14:37:39
|
Did you know...
The acSendKeys action simply injects the specified keys into Windows as if you typed them directly. This means the the keys will be received by the window which currently has focus (active window).
If you want to send keys to an inactive window, it needs to be activated first. The following Lua script will store the current foreground window handle in memory, activate the window where the gesture began, send the keys, then re-activate the window which was previously active:
local iHandle = acGetForegroundWindow() acActivateWindow(nil, gsx, gsy) acSendKeys("Type some stuff") acActivateWindow(iHandle, nil, nil) |
|
dantist
5 Posts |
Posted - 05/13/2014 : 10:29:21
|
Hi Rob,
I just registered to thank you for this great hint! I'm currently switching from Opera to Chrome and try to rebuild the great Opera mouse-gestures. Auto-focussing Chrome during the new tab-gesture is a great step forward. To do so I'm just using the second line, no need for focussing back to the previous application.
Cheers, Dan |
|
|
|
Topic |
|
|
|