How to emulate Alt + Tab on a remote connection

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
daniel347x
Newbie
Posts: 8
Joined: Tue Apr 26, 2011 9:41 pm

How to emulate Alt + Tab on a remote connection

Post by daniel347x » Wed May 20, 2015 4:19 am

Hello!

I would like to get Chrome OS's "remote control" application working in usable fashion. Unfortunately, it is impossible to redirect Alt + Tab to the remote computer. This makes Chrome OS not worthwhile for me. However, I think other key combinations *can* be redirected. Therefore, if I install Macro Scheduler on the remote machine, would it be possible to assign a different hotkey combination that would emulate Alt + Tab on the remote computer? If so, what would this script look like?

Thanks!
Dan

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: How to emulate Alt + Tab on a remote connection

Post by Marcus Tettmar » Wed May 20, 2015 10:38 am

Assuming the remote PC is Windows, then yes, that should be doable. A script to send ALT+TAB would just be:

Press ALT
Send>TAB
Release ALT

Then just assign it to whatever hot key combo you like in Macro Properties.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

daniel347x
Newbie
Posts: 8
Joined: Tue Apr 26, 2011 9:41 pm

Re: How to emulate Alt + Tab on a remote connection

Post by daniel347x » Wed May 20, 2015 11:58 am

Thanks. Do you know if it could be enhanced to support pressing 'tab' multiple times before releasing the 'Alt' button - such as using Alt + W W W W (instead of Alt + tab tab tab tab)?

Dan

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: How to emulate Alt + Tab on a remote connection

Post by Phil Pendlebury » Wed May 20, 2015 2:08 pm

Code: Select all

Press ALT
Press TAB *4
Release ALT
Also you may find that putting micro wait in between Send and release is required:

Code: Select all

Press ALT
Wait>0.01
Press TAB * 4
Wait>0.01
Release ALT
OR:

Code: Select all

Let>t=4
// t = number of tab presses
Press ALT
Wait>0.01
Press TAB * n
Wait>0.01
Release ALT
nb. I am not sure if TAB can be done by using Send>TAB as Marcus wrote. But I always use "PRESS". :-)
Phil Pendlebury - Linktree

daniel347x
Newbie
Posts: 8
Joined: Tue Apr 26, 2011 9:41 pm

Re: How to emulate Alt + Tab on a remote connection

Post by daniel347x » Wed May 20, 2015 2:39 pm

Thanks! I realize now that I should have mentioned that 4 is just an arbitrary number. I won't know how many times until I actually activate the macro. (Have you ever pressed Alt + Tab and waited to see how many key presses of the Tab button were required to navigate back to the desired window?)

In other words, the number 't' in the code below won't be known. If there is a way for the macro to listen for the 'release' of a hotkey, so that I could use (for example):

- Alt + W + Alt Release
- Alt + W W + Alt Release
- Alt + W W W W W W + Alt Release

Thanks!
Dan

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: How to emulate Alt + Tab on a remote connection

Post by Marcus Tettmar » Wed May 20, 2015 3:47 pm

Hi Dan,

I'm afraid this isn't possible - unless anyone else can think of a cunning workaround I can't see how you could do this. Macro Scheduler simply responds to a windows hot key but doesn't (can't) know how long (many times) part of that hot key was depressed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3517
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: How to emulate Alt + Tab on a remote connection

Post by JRL » Fri May 22, 2015 6:44 pm

What happens if you run this script on the remote computer then press Alt + Esc when you want Alt + Tab.

This more or less works on my local computer, there are some timing issues and Esc may not be the best choice for an alternate key. But there's no point making it perfect for me and I don't have your setup to test on. If it works for you, perhaps it could be perfected then made into an executable that runs full time on the remote computer.

Code: Select all

OnEvent>KEY_DOWN,VK27,3,Esc_To_Tab_Key

Label>Loop
  Wait>0.01
Goto>Loop

SRT>Esc_To_Tab_Key
  Press Tab
END>Esc_To_Tab_Key

User avatar
Phil Pendlebury
Automation Wizard
Posts: 543
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: How to emulate Alt + Tab on a remote connection

Post by Phil Pendlebury » Sun May 24, 2015 5:49 am

Can't you just take a screen grab of (the largest possible as it will be faster) part of the screen you want to get back to then use Image Recognition to check after each press of ALT + TAB if the screen is visible again? You can also keep a count of how many times you had to loop and use that in the script etc.
Phil Pendlebury - Linktree

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts