Window Focus?

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Window Focus?

Post by srass » Wed Oct 01, 2014 12:02 am

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.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Wed Oct 01, 2014 5:56 am

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.

srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Post by srass » Wed Oct 01, 2014 8:33 pm

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.

Valerian
GamingTools Subscriber
Posts: 7
Joined: Tue Jan 04, 2005 5:19 pm

Post by Valerian » Wed Oct 01, 2014 8:43 pm

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

srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Post by srass » Wed Oct 01, 2014 9:01 pm

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.

srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Post by srass » Wed Oct 01, 2014 9:21 pm

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.

Valerian
GamingTools Subscriber
Posts: 7
Joined: Tue Jan 04, 2005 5:19 pm

Post by Valerian » Wed Oct 01, 2014 9:34 pm

Sorry, I stopped reading after seeing your apostrophe abuse.

srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Post by srass » Wed Oct 01, 2014 10:05 pm

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.

Valerian
GamingTools Subscriber
Posts: 7
Joined: Tue Jan 04, 2005 5:19 pm

Post by Valerian » Wed Oct 01, 2014 11:17 pm

No, but if you actually read anything there you might learn something.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Thu Oct 02, 2014 6:11 am

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.
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.

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 ;)

srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Post by srass » Thu Oct 02, 2014 7:18 am

Thank you for that logic, sounds like that would work. When I get home tonight, I will give it a shot. Thanks again, I will post later once confirmed.

srass
GamingTools Subscriber
Posts: 7
Joined: Thu Aug 09, 2012 6:18 pm

Post by srass » Thu Oct 02, 2014 8:20 pm

Thanks Lax, it worked flawlessly. I appreciate your time.

Post Reply