PDA

View Full Version : Window Is Foreground



doubleJ
June 16th, 2007, 07:17 PM
Hello...
I want to map a button to send one key to only one program and a different key for anything else. I tried setting it in two different groups, creating disable/enable macros, and giving an if window is forground command to run the macros, but it never disabled. I specified the target window, too.
I even tried Window Exists and it still didn't work. And yes, the target window was open and focused at the time.
Hehehe...
JJ

blubberhoofd
June 17th, 2007, 05:52 AM
best way to do this is to create a LUA script that will trigger the events you want.

The best method to check if a window is in the foreground is by checking if it's obscured in any way:
[res] = win.IsWindowObscured([handle]) -- Any part of window is obscured and then triggering the appropriate event by using
gir.TriggerEvent([eventstring], [eventdevice], [payload] ... )


Let me know if you need any more help with LUA.

hope this helps ;)