如何修复 AHK 以将密钥发送到 RDP 全屏?

use*_*659 8 remote-desktop windows-7 autohotkey

如何让 AutoHotKey 热键在 Windows 7 上以全屏模式与远程桌面一起使用?

G K*_*Koe 11

您还需要将远程桌面连接“mstsc.exe”的“本地资源”选项卡上的“应用 Windows 组合键”设置为“在此计算机上”MSTSC WINDOWS 关键组合


Tah*_*san 6

正如 user16659 指出的那样,Reload使热键再次起作用(但他的脚本对我不起作用)。

基本上,我现在有两个脚本正在运行,一个包含我的热键和热字符串"script.ahk",另一个将在 RDP 最大化时重新加载此脚本"controller.ahk"

脚本.ahk:

#SingleInstance force
::hw::Hello World
Run Code Online (Sandbox Code Playgroud)

控制器.ahk:

Run "autohotkey" "script.ahk"

#Persistent
SetTimer, ReloadOnRDPMaximized, 500
return

ReloadOnRDPMaximized:
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 therefore reload "script.ahk"
            Run "autohotkey" "script.ahk"

            ; wait until window gets deactivated so you don't reload it again.
            WinWaitNotActive, ahk_class TscShellContainerClass

        }
    }
}
return
Run Code Online (Sandbox Code Playgroud)

  • 但是,我注意到即使我的解决方案也不起作用,因为在 RDP 中它不会发送热字符串的 shift 键按下,例如,如果您发送 `*` 那么它会发送 `8`... `:(` (2认同)