69

I need use the key combinations Ctrl-Alt-Left Arrow and Ctrl-Alt-Right Arrow in an application on my computer. When I use Remote Desktop to connect to that computer, either the Remote Desktop Client (mstsc.exe) or the RDP server implementation swallow these key combinations. The combos appear to be reserved to the Remote Desktop, although they don't seem to be doing anything.

Is there a way (supported or not) to disable this behavior so that the key combinations are sent to my application?

Update 2022-12-01: As noted by Bragolgirith, this was fixed in version 1.2.2924 of the Remote Desktop client for Windows.

3

8 Answers 8

40
+50

The hotkeys Ctrl+Alt+Left Arrow and Ctrl+Alt+Right Arrow are eaten up by the Remote Desktop Client. Their only effect is to switch you to back to the host computer.

It looks like this was some intended feature that was never fully programmed and completed, but there is no way to turn it off. These hotkeys are not even listed by Microsoft in its official documentation at Remote Desktop Services Shortcut Keys.

Solution 1 : Use the Microsoft Store version

Another version of RDP can be found in the Microsoft Store at Microsoft Remote Desktop.

This version does not have this semi-implemented feature, so it lets through these hotkeys without a problem. This was verified on Windows 10 version 1903.

Solution 2 : Translate the hotkeys on both client and server

This solution will use AutoHotkey installed on both client and server, to:

  • On the client, translate the above hotkeys to others that are not intercepted by RDP
  • On the server, translate these keys back to the above hotkeys.

You may for example use on the client the following AutoHotkey script "rdp hotkeys_slave.ahk" to convert
Ctrl+Alt+arrow to Alt+Win+arrow:

#SingleInstance Force
#IfWinActive, ahk_exe mstsc.exe
;Send Alt+Win+Left when user types Ctrl+Alt+Left
^!Left::
send !#{Left}
return

;Send Alt+Win+Right when user types Ctrl+Alt+Right
^!Right::
send !#{Right}
return

The script is restricted to the mstsc.exe process using #IfWin[Not]Active / #IfWin[Not]Exist.

Unfortunately Autohotkey scripts only work in full screen RDP once they are restarted after activating the fullscreen (See here: How to fix AHK to send keys to RDP fullscreen?) So we need a second script "rdp hotkeys_master.ahk" to achieve this:

#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" "rdp hotkeys_slave.ahk"

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

        }
    }
}

You may use on the server the following AutoHotkey script to convert
Alt+Win+arrow to Ctrl+Alt+arrow:

;Send Ctrl+Alt+Left when user types Ctrl+Win+Left
!#Left::
send !^{Left}
return

;Send Ctrl+Alt+Right when user types Ctrl+Win+Right
!#Right::
send !^{Right}
return

To make the scripts run on startup put all of them in the autostart folder on the respective devices (type Win+R and shell:startup)

11
  • 1
    Yes, just awarded you the bounty. This didn't lead me to a solution I wanted to but it answered the question so that I believe it will stop people from riposting the same question elsewhere. Great job!
    – jpierson
    Jan 10, 2020 at 21:54
  • This seems like a good solution, but the problem is that the ctrl-alt-keys are now not usable on the local system because they are translated. Is it possible to only do the translation when the focus is in the RDP app?
    – fool4jesus
    Jun 11, 2020 at 13:55
  • I know this is old, but yes, start the ahk script with this line: #IfWinActive, ahk_exe mstsc.exe
    – MassuguGo
    Oct 4, 2020 at 23:27
  • 5
    Microsoft Store's Remote Desktop doesn't support multi monitor setups ( Sep 23, 2021 at 15:17
  • The same issue arises for vmware workstation. Take a look atEdit -> Preferences -> Hot Keys
    – René Link
    Jan 20, 2022 at 11:27
8

Thanks to the poster and the answers so far; these helped me solve my similar issue: I have keyboard shortcuts on my desktop PC's text editor that use Ctrl+Alt+..., and I wanted to be able to use them when accessing the machine remotely.

With this AHK script, I type Win instead of Alt and I'm able to accomplish the commented commands below. Now regardless of which PC I use to access the remote desktop PC (i.e., when home or traveling), I can use my shortcuts (and Win is pretty near Alt). Here's my AHK script:

;Send Ctrl+Alt+Left keys when user types Ctrl+Win+Left
^#Left::
send !^{Left}
return

;Send Ctrl+Alt+Right keys when user types Ctrl+Win+Right
^#Right::
send !^{Right}
return

;Send Ctrl+Alt+Up keys when user types Ctrl+Win+Up
^#Up::
send !^{Up}
return

;Send Ctrl+Alt+Down keys when user types Ctrl+Win+Down
^#Down::
send !^{Down}
return

;Send Ctrl+Alt+Shift+Left keys when user types Ctrl+Win+Shift+Left
^#+Left::
send !^+{Left}
return

;Send Ctrl+Alt+Shift+Right keys when user types Ctrl+Win+Shift+Right
^#+Right::
send !^+{Right}
return

;Send Ctrl+Alt+Shift+Up keys when user types Ctrl+Win+Shift+Up
^#+Up::
send !^+{Up}
return

;Send Ctrl+Alt+Shift+Down keys when user types Ctrl+Win+Shift+Down
^#+Down::
send !^+{Down}
return

Note, I use "Apply windows key combinations...On the remote computer" in Remote Desktop Connection, so I run this script on the remote computer.

While there are probably more efficient AHK ways to do this, the above works for me. Hope this helps someone else, too.

4

I would like to share a shorter Autohotkey script that will fix all Alt combinations intercepted by RDP.

The script does not remap a common combination which depends on the # key, thus results in almost zero conflicts as combinations with the AppsKey are very rare.

Client

*^LAlt::^AppsKey
return

Server

*^AppsKey::^LAlt
return
2
  • This was the simplest solution and worked for me.
    – notacouch
    Jul 31, 2022 at 10:29
  • how to modify this script to use only with mstsc ? Apr 24, 2023 at 23:24
2

For using CtrlAlt+ in Far Manager I used the following AutoHotKey script:

!^Right::
send ^+{F9}
return

!^Left::
send ^+{F8}
return

… where under CtrlShiftF8/F9 I have Far macros which do the same as when pressing CtrlAlt+.

This workaround only works if in Properties, the connection option Keyboard is set to "On this computer".

3
  • I'm marking this as the accepted answer because I ended up doing something similar: I, too, have an AutoHotKey script on my host computer that captures and translates the key combo to a different one; then I have a second AutoHotKey script on the remote computer that translates it back to the original key combo. Oct 17, 2012 at 9:00
  • But, this option force the remote user to change the shortcut used remotely, right?
    – chomp
    Feb 22, 2019 at 12:43
  • There's another answer now that shows how to use AutoHotKey to translate the key sequence to something other on the client, then translate it back on the server: superuser.com/a/1514904/79488. I'm marking that one as the accepted answer now because it's more complete and contains more details. Still, kudos for the idea of using AutoHotKey! Jan 7, 2020 at 10:19
2

For what it's worth, if you need Ctrl + Alt + Up to work in VSCode a less painful way is just to remap it to say Ctrl + Alt + Num8

enter image description here

1

Make sure you have the Keyboard settings set to something appropriate for how you use RDP. Have a look in the options for your RDP connection, on the Local Resources Tab.

If you always have the connection full screen then set it to "Only when using the full screen" but if you don't use RDP in full screen then set it to "On the remote computer."

RDP Key Combo

4
  • 21
    This does not solve the issue. I always have the connection full screen, and the "Local Resources/Keyboard" settings are set to "Only when using the full screen". This means I can use Alt-Tab and the like, but I still canot use Ctrl-Alt-Left Arrow or Ctrl-Alt-Right Arrow. Aug 25, 2011 at 13:34
  • I find that Ctrl-Alt-Up and Ctrl-Atl-Down do work; but Ctrl-Alt-Left and Ctrl-Alt-Right no longer do. Although they all used to work until recently. Jul 17, 2017 at 14:22
  • I find this really annoying, mstsc.exe doesn't seem to matter what I try Ctrl-Alt-Left and Ctrl-Alt-Right doesn't work. The other Remote Desktop app (maybe only available in Windows 10) does pass on those keystrokes but it has other limitations such as no dual monitor support and seems to disconnect a bunch for me.
    – Glen
    Sep 26, 2018 at 21:56
  • Sadly the settings only apply for "WIN key" or "ALT+TAB" as documented here docs.microsoft.com/en-us/windows-server/remote/…
    – René Link
    May 17, 2022 at 7:33
0

Not so much as a solution, so much as a workaround. I removed the bookmark shortcuts and replaced them with the Navigation shortcuts. This will give up Bookmark shortcuts 9 and 10.

In IntelliJ in the Remote Desktop:
Help -> Find Action..
Type "Back" in the input field and it should bring up the Navigation Back including displaying the shortcut Ctrl+Alt+Left.
Press "Alt+Enter"
Press "Ctrl+9" and click Ok.

Repeat process for Forward.

0

Easy Solution: you can add new keyboard short cut.

File->setting-> Keymap->nevigation-> Back-> Add Keyboard Shortcut

Screenshot of menu selection in Settings

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .