New Version

New Version

我有两个显示器,其中一个上运行全屏远程桌面会话,另一个上运行常规 Windows 程序。

当其他程序之一获得焦点时,我可以正常在窗口之间按 Alt+Tab,而我可以通过 Alt+Tab 选择的选项之一是远程桌面。

一旦我切换到远程桌面,键盘就会被远程桌面“捕获”,从而进一步通过 Alt+Tab 在远程桌面上打开的程序之间进行切换。

Is there a keyboard shortcut that "un-traps" the keyboard while the remote desktop has the focus, so that a subsequent Alt+Tab will switch to one of the programs on my other monitor?

(I am used to VirtualBox virtual machines where there is a key (usually Right Ctrl) which does precisely that, i.e. un-traps the keyboard from the VM.)

答案1

When full screen and set active, there is no way to "untrap" keys.

However, based on your comments on the other answer, if you just want a plain keyboard only method of getting out of Remote Desktop, try the following:

Press Ctrl+Alt+Pause/Break.

This will take you out of full screen mode and "untrap" the keys, meaning you can do Alt+Tab. To get back to full screen mode, simply do the same shortcut.

答案2

Since I had the same problem and read these answers I must add my solution - maybe it helps someone else.

I wanted to press Ctrl+Alt+Pause/Break but accidently hit Press Ctrl+Alt+Home.

I found that this moves the focus out of the maximized window to the title bar and after that Alt+Tab is working.

Think this is slightly more handy ..

答案3

Like Bertram said, Ctrl+Alt+Home gives focus to the title bar so that things like Alt+Tab go to the local desktop.

I've further found that hitting ESC gives focus back to the remote desktop. (On Windows 10, I didn't have the time-out problem that @JohnnyO reported.)

答案4

New Version

Windows 10 Home, Windows 10 Home

Nothing should go wrong, but since this grabs Left Mouse Button and Enter, probably save all your work first.

I was pretty awful at AutoHotKey when I wrote this. This utility is one of the things that got me learning AHK, although hough I never took it very far.

This version of the script functions much better. It's also adapted from my script to allow a VirtualBox Virtual Machine to do the same thing

While RDC is open and focused, it uses ALT+Tab to trigger ALT+Page Down which is built into Terminal Services to activate the server's 'Task Switcher'.

#SingleInstance, Force
hostkey = RCTRL                                            ; set this to your VirtualBox HOSTKEY
boxMode := ""
Hotkey, <#Tab, WinTabbing
Hotkey, >#Tab, WinTabbing
Return

TabFinish:
    Send, {ALT UP}
    RDCKeysState("Off")
Return

Tabbing:
    Send, {Right}
Return

WinTabbing:
  WinGetTitle, Title, A
  StringRight, TitleEnd, Title, 25

  RDCKeysState("On")
  If (TitleEnd = "Remote Desktop Connection") and (not Title = "Remote Desktop Connection") {
    ; RDC mode, but not the launcher window
 
    Send, {Alt down}{PgDn}                                 ; Press and hold alt, and press pgdn

  } Else {                                                 ; Host mode

    Send, {ALT Down}{TAB}                                  
    Sleep, 200                                             ; Sleep to wait a split-second for Alt-Tab window to appear
    iter := 0                                              ; loop tracker
    Loop {
      iter := iter+1
      if (!WinExist("Task Switching") Or iter > 60) {      ; If Alt+tab is gone, or it's been 30 seconds
        Send, {ALT UP}
        Break
      }
      Sleep, 500
    }
  }
Return

RDCKeysState(toggle) {
    ; This function maps all the ways that a user might end the alt-tab box.
    Hotkey, Enter, TabFinish, %toggle%                   ; Map Enter, Click, and their alt-counterparts to TabFinish()
    Hotkey, !Enter, TabFinish, %toggle%
    Hotkey, LButton, TabFinish, %toggle%
    Hotkey, !LButton, TabFinish, %toggle%
    Hotkey, *LWIN UP, TabFinish, %toggle%
    Hotkey, *RWIN UP, TabFinish, %toggle%
    Hotkey, *Tab, Tabbing, %toggle%
}

; if you get the error 'could not close the previous instance of the script,`
; while ever trying to reload the script, you need to right click it and select
; 'Run As Administrator'

Old Version

Windows 10 Home, and Windows 2012 Server

I wanted functionality to do both, so I wrote an AutoHotKey script for my local machine.

I gave my local computer full access to Windows Key Commands even while RDC is maximized

RDP 选项。本地资源选项卡

And then wrote an AutoHotKey script (I am not well-versed in it) that captured WIN+TAB (#Tab), while RDC is open and then uses that and the ALT+Page Down built into Terminal Services to activate the server's ALT+Tab. Once it's open, you can navigate with arrow keys and enter/click to select.

If you can improve upon this, please do, and share.

#persistent
#Tab::WinTabbing()
return

WinTabbing() {
    WinGetTitle, Title, A                             ; Get Title
    StringRight, TitleEnd, Title, 25                  ; RDC is 25 letters long
    If (TitleEnd = "Remote Desktop Connection")       ; Check that an RDC is active. This will probably have
                                                      ; issues with the inital "connect to dialog of RDC
    {
        Send, {Alt down}{PgDn}                        ; Press and hold alt, and press pgdn
        Hotkey, Enter, Entering, On                   ; Map Enter, Click, and their alt-counterparts to Entering()
        Hotkey, !Enter, Entering, On
        Hotkey, LButton, Entering, On
        Hotkey, !LButton, Entering, On
        return
    }
}
; There is no return statement at the end of this function, because we want
; Control Tab to work when focused in any other window.

; I tried to map Tab/Alt Tab (because alt is still pressed) to Right arrow
; and Control Tab/Control Alt Tab to left arrow. I was unable to get it to work.
; I left the functions in comments if anyone want to try    
; Righting()
;   Send, Right
;   return
; }

; Lefting() {
;   Send, Right
;   return
; }

Entering() {
    Send, {Alt}{Enter}                                ; Releases Alt, and makes the selection
    Hotkey, Enter, Entering, Off                      ; See WinTabbing()
    Hotkey, !Enter, Entering, Off
    Hotkey, LButton, Entering, Off
    Hotkey, !LButton, Entering, Off
    return
}

相关内容