Does anyone have a solid solution for determining window focus?
I tried Nadrews creative browser solution but it doesn't work for me because it requires the entire window to be of type "browser".
I need to set focus on a window after a user brings it to the foreground. They can click on any number of controls or the window itself to bring it forward.
ts
ID:158057
![]() Nov 9 2009, 12:04 pm
|
|
Yeah, I did. Sorry I didn't mention it. It returns 0 all the time even when switching back and forth between windows.
ts |
Bug report time, then. Even more so if it actually really returns 0 (?), because by principle it should always be returning a text string (or at least null) and never a number.
|
My windows are cloned and have no title bars. It didn't seem to matter if I clicked in the embedded browser controls or on the window itself, it always returned 0.
I might have to put a cloned demo together and see if I can repro it outside of my project. ts |
My example returns what window I have focused and what sub unit I have focused in text format: window.subunit so the problem is on your end.
|
Special winget() calls
Calling the winget() proc with a blank or null control ID can return some values that belong to the whole program.
- winget(player, null, "focus") will return the ID of the control, if any, that currently has keyboard focus.
- winget(player, null, "windows") will return the IDs of the windows available in the program, separated by semicolons.
- winget(player, null, "menus") will return the IDs of the menus available in the program, separated by semicolons.
- winget(player, null, "macros") will return the IDs of the macros available in the program, separated by semicolons.
You can try seeing if clicking other elements, which gives it focus, changes the winget() value (as it says keyboard focus...)