Window Focus?
Moderators: Lavish Software Team, Moderators
Window Focus?
I am using this with EQ2. When I issue the following commands in a script:
WindowVisibility foreground
wait 10
Press Ctrl+Alt+2
The press command is casting spells on my hotbar, almost as if it is ignoring the first button (Ctrl) and only pressing (Alt+2).
With that said, my intent is to bring whatever window is running the script to the foreground and give it the focus. If additional info. is needed, please let me know.
WindowVisibility foreground
wait 10
Press Ctrl+Alt+2
The press command is casting spells on my hotbar, almost as if it is ignoring the first button (Ctrl) and only pressing (Alt+2).
With that said, my intent is to bring whatever window is running the script to the foreground and give it the focus. If additional info. is needed, please let me know.
You're looking for the Focus command. https://www.lavishsoft.com/wiki/index.p ... Command%29
The Press command sends keystrokes directly to the game, bypassing any Windows Hotkeys (like Ctrl+Alt+# if the Hotkey is set to global) or Inner Space Hotkeys (like Ctrl+Alt+# if the Hotkey is not set to global). (Yep, there's no way to activate this Hotkey with Press.)
So because the game has no Ctrl+Alt+# hotkey, the game interprets your Press as if it were just Alt+# which it has a hotkey for.
The Press command sends keystrokes directly to the game, bypassing any Windows Hotkeys (like Ctrl+Alt+# if the Hotkey is set to global) or Inner Space Hotkeys (like Ctrl+Alt+# if the Hotkey is not set to global). (Yep, there's no way to activate this Hotkey with Press.)
So because the game has no Ctrl+Alt+# hotkey, the game interprets your Press as if it were just Alt+# which it has a hotkey for.
I tried the Focus command, but it does not seem to be doing anything. I have tried two ways.
I did the below on is1 and it did not switch to the is2 session.
1. Focus is2
I also tried the below, thinking maybe if I brought it to the foreground that it would give focus to the session.
2. WindowVisibility foreground
wait 10
Focus is2
Neither of the two options above give the window the active focus, and by that, I mean that I want to run "relay is2 run focusscript" and have the script bring is2 to the foreground and give it the focus so that if I were to start typing, it would type in session is2. Currently, if I do the above the WindowVisibility command brings the window to the front, but when I type, it still is typing in is1, instead of is2.
I did the below on is1 and it did not switch to the is2 session.
1. Focus is2
I also tried the below, thinking maybe if I brought it to the foreground that it would give focus to the session.
2. WindowVisibility foreground
wait 10
Focus is2
Neither of the two options above give the window the active focus, and by that, I mean that I want to run "relay is2 run focusscript" and have the script bring is2 to the foreground and give it the focus so that if I were to start typing, it would type in session is2. Currently, if I do the above the WindowVisibility command brings the window to the front, but when I type, it still is typing in is1, instead of is2.
Did you even read the examples? from here: https://www.lavishsoft.com/wiki/index.p ... 9#Examples
to focus a window from a SESSION (e.g. is1 or is2) you need to do it via the uplink command.
uplink focus is2
to focus a window from a SESSION (e.g. is1 or is2) you need to do it via the uplink command.
uplink focus is2
Yes, Actually I did.
"Focusing a window, from the Uplink directly
Focus is2"
I thought since the script was running in the is2 session (the session I want focus on) that I did not have to utilize the 'uplink' command in front of it.....Sorry that I am not Miss Cleo and knew what I needed to know, I'll make sure in the future I call her first.
"Focusing a window, from the Uplink directly
Focus is2"
I thought since the script was running in the is2 session (the session I want focus on) that I did not have to utilize the 'uplink' command in front of it.....Sorry that I am not Miss Cleo and knew what I needed to know, I'll make sure in the future I call her first.
Just to add some context to what I am attempting to do.
I have six toon's running the same script, but at certain intervals, I need it to switch to that session and do some action, but that action requires for the session to have focus. Currently, I have tried both "focus ${Session}" and "uplink focus ${Session}" in the script running in said session, however, when using the uplink version, it does bring the window to the foreground, but it does not have focus still, because if I try typing it will still go to whatever session had the focus previously. Now, I did try the uplink version manually via another session and putting in a diff session does make the other session come into focus, but it running in the script on that session is not working. I tried using just focus ${Session} and that really does not do anything, at least from what I could tell.
I have six toon's running the same script, but at certain intervals, I need it to switch to that session and do some action, but that action requires for the session to have focus. Currently, I have tried both "focus ${Session}" and "uplink focus ${Session}" in the script running in said session, however, when using the uplink version, it does bring the window to the foreground, but it does not have focus still, because if I try typing it will still go to whatever session had the focus previously. Now, I did try the uplink version manually via another session and putting in a diff session does make the other session come into focus, but it running in the script on that session is not working. I tried using just focus ${Session} and that really does not do anything, at least from what I could tell.
I must be on the wrong forums, my apologies. I assume I need to post my question here http://apostrophe-aps.proboards.com/board/2 to get a response to my Lavish inquiries.
If the focus command is not initiated by the foreground window, then it's not going to have permission from Windows to activate the new window for input focus. This is because they don't want just any program to force itself active for input focus when you're working with something else.srass wrote:Just to add some context to what I am attempting to do.
I have six toon's running the same script, but at certain intervals, I need it to switch to that session and do some action, but that action requires for the session to have focus. Currently, I have tried both "focus ${Session}" and "uplink focus ${Session}" in the script running in said session, however, when using the uplink version, it does bring the window to the foreground, but it does not have focus still, because if I try typing it will still go to whatever session had the focus previously. Now, I did try the uplink version manually via another session and putting in a diff session does make the other session come into focus, but it running in the script on that session is not working. I tried using just focus ${Session} and that really does not do anything, at least from what I could tell.
So instead of doing "uplink focus xyz" in that case, do "relay all uplink focus xyz". Every window will try to focus the one you're trying to do, so as long as one of your game windows is focused it should work for you. It should actually work for the one that was foreground
