need some help ahk diferent on remotedesktop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jeroen666
Posts: 3
Joined: 25 Jan 2022, 08:45

need some help ahk diferent on remotedesktop

Post by Jeroen666 » 25 Jan 2022, 08:57

Hi i wrote a script to switch between windows

this scripts works fine on my pc however when working on a remote pc it doesn't behave the same
i use a numpad to switch between screens
where 7, 8, and 9 switch between the first set of screens
4,5 and 6 the second group
1,2 and 3 the third

as long s i dont have a group of programs it works fine however when grouped it does "something" but not the thing i expect or what is does on my normal pc
I tried to set delays but that didn't seem to do the trick

Any thoughts or help would be appriciated thanks, Jeroen

this is the script i use:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Numpad7::Send, {blind}{RWin down}1{RWin up}

Numpad8::Send, {blind}{RWin down}11{RWin up}

Numpad9::Send, {blind}{RWin down}111{RWin up}

Numpad4::Send, {blind}{RWin down}2{RWin up}

Numpad5::Send, {blind}{RWin down}22{RWin up}

Numpad6::Send, {blind}{RWin down}222{RWin up}

Numpad1::Send, {blind}{RWin down}3{RWin up}

Numpad2::Send, {blind}{RWin down}33{RWin up}

Numpad3::Send, {blind}{RWin down}333{RWin up}

return



amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: need some help ahk diferent on remotedesktop

Post by amateur+ » 25 Jan 2022, 10:28

Jeroen666 wrote:
25 Jan 2022, 08:57
it does "something"
Could you explain what exactly happens instead of naming it "something"?
For me your script fails even on my main PC when there is a group (several windows of my browser, for example).
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

Jeroen666
Posts: 3
Joined: 25 Jan 2022, 08:45

Re: need some help ahk diferent on remotedesktop

Post by Jeroen666 » 27 Jan 2022, 03:04

Hi thanks for you''re response i try to clearyfy

the "something" is as folows:
instead of switching between screens it wil show black squares where you normaly would see the miniature version of the programes the squares represents

for instanse start two browser screens as a seperate instance and move them to the most left position on the taskbar
when you pres win + 1 both screens are shown inminiature. on keyup the first window is maximimised
press win + 1 + 1 would result in the second screen. beeining maximised

this still works when i do it using the keyboard but not via a AHK script instead it seems to break (or windows seems to break)

so what i mean to say is i gues is the key script is triggerd by the key but the result is completly diferent from the same script on a normal pc

I fear however it is not a AHK issue because i just found out other hotkey combinations for instance the once i use in phpstrom are not working as well
this seems more like a RDP problem than anything else

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: need some help ahk diferent on remotedesktop

Post by amateur+ » 27 Jan 2022, 14:44

Ok, I've understood you. Run this code as a separate file to test.

Code: Select all

Loop, 9 {
	Hotkey, Numpad%A_Index%, NumpadWinSwitches
	Hotkey, Numpad%A_Index% Up, RWinUp
	Hotkey, #Numpad%A_Index% Up, RWinUp
}
;  The lines above are to be placed in the auto-execute section (top part of the script): https://www.autohotkey.com/docs/Scripts.htm#auto
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
return

NumpadWinSwitches() {	; We use a function instead of label to make var num local for safety.
	num := RegExReplace(A_ThisHotkey, ".*Numpad")
	send, % "{RWin Down}{" . 1+(9-num)//3 . A_Space . 1+Mod(num-1, 3) . "}" 
}

RWinUp:
send {RWin up}
return
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

Jeroen666
Posts: 3
Joined: 25 Jan 2022, 08:45

Re: need some help ahk diferent on remotedesktop

Post by Jeroen666 » 01 Feb 2022, 08:39

Thank you very much!
My compony desided to ditch the virtual pc's for our department
so i can't test this anymore unfortunatly

good news though with that this problem also went away

so again thanks for the efford

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: need some help ahk diferent on remotedesktop

Post by amateur+ » 01 Feb 2022, 09:16

Ok.
You can test it on any PC, non-obligatory virtual. But yes, there is no need: 1). I tested it; 2). It isn't actual for you.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

Post Reply

Return to “Ask for Help (v1)”