-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathremote-desktop.ahk
32 lines (27 loc) · 1020 Bytes
/
remote-desktop.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; https://superuser.com/questions/397257/how-to-fix-ahk-to-send-keys-to-rdp-fullscreen
; http://tahirhassan.blogspot.co.uk/2012/11/autohotkey-scripts_19.html
; this line should be put on top (auto-exec) section of ahk script
SetTimer, SuspendOnRDPMaximized, 500
;Hotkey, *CapsLock, capsHotKeyAction, On
return
; this actual code label and the fn can be put anywhere in the script file
SuspendOnRDPMaximized:
If WinActive("ahk_class TscShellContainerClass") {
WinGet, maxOrMin, MinMax, ahk_class TscShellContainerClass
if (maxOrMin = 0) {
WinGetPos, PosX, PosY, WinWidth, WinHeight, ahk_class TscShellContainerClass
if (PosY <= 0) { ; it is fully maximized
;Hotkey, *CapsLock, Off
Suspend, On
WinWaitNotActive, ahk_class TscShellContainerClass
Suspend, Off
;Hotkey, *CapsLock, On
}
; MsgBox, PosY: %PosY%, PosX: %PosX%
}
}
return
; capsHotKeyAction:
; Send, { ESC }
; ;MsgBox You pressed %A_ThisHotkey%.
; return