NeuroAgent

How to Configure Ctrl+Win+Left/Right in Fullscreen RDP Mode

Configure Ctrl+Win+Left/Right keyboard shortcuts for local PC when connecting to RDP in fullscreen mode. Complete guide with methods using AutoHotkey, Group Policy, and registry.

Question

How can I make the Ctrl+Win+Left/Right keyboard shortcuts work on my local PC instead of the remote one when connecting via RDP in full-screen mode?

The situation is: when connecting via RDP in full-screen mode, all keyboard shortcuts are passed to the remote computer, which is normal behavior. I need the shortcuts for switching desktops (Ctrl+Win+Left/Right) to execute on the local PC rather than being forwarded through RDP.

I know that I can completely disable keyboard shortcut forwarding, but that option doesn’t work for me. I’ve tried setting up custom shortcuts through AutoHotkey and PowerToys. On the local PC, they work fine, but as soon as RDP opens in full-screen mode, they stop functioning.

NeuroAgent

When connecting via RDP in fullscreen mode, default keyboard shortcuts are sent to the remote computer. To make Ctrl+Win+Left/Right work on the local PC, use a combination of RDP client settings and Windows system configurations.

Table of Contents

Main Solution Methods

There are several approaches to solving this problem, ranging from simple to more complex:

  1. Using RDP client options - the simplest method
  2. Automation with AutoHotkey - a flexible solution
  3. Group policy configuration - for corporate environments
  4. Registry modification - an advanced approach

A combination of multiple methods often proves to be the most effective.

RDP Client Settings

Using the adminConnectionMode Option

When connecting via RDP, add the /admin or /console parameter:

mstsc.exe /v:IP_address /admin

This parameter can change the behavior of keyboard shortcut handling.

Editing the RDP File

  1. Open an existing RDP file or create a new one
  2. Add the line:
    admin connection mode:i:2
    
  3. Save the file and connect using it

This method doesn’t always work for all keyboard shortcuts, but it’s worth trying.

Advanced AutoHotkey Usage

Basic Script

autohotkey
#IfWinActive ahk_class TscShellContainerClass
^#Left::Send ^#{Left}
^#Right::Send ^#{Right}
#IfWinActive

Advanced Script with Context Switching

autohotkey
; Define RDP windows
RDP_Window := "ahk_class TscShellContainerClass"

; Global hotkeys
^#Left::
    IfWinActive %RDP_Window%
    {
        WinGet, active_id, ID, A
        WinActivate, ahk_id %active_id%
        Sleep, 50
        Send, ^#{Left}
    }
    Else
    {
        Send, ^#{Left}
    }
    Return

^#Right::
    IfWinActive %RDP_Window%
    {
        WinGet, active_id, ID, A
        WinActivate, ahk_id %active_id%
        Sleep, 50
        Send, ^#{Right}
    }
    Else
    {
        Send, ^#{Right}
    }
    Return

Running AutoHotkey with Elevated Privileges

  1. Create a shortcut for AutoHotkey
  2. In the shortcut properties, select “Run as administrator”
  3. Configure AutoHotkey to launch at system login via Task Scheduler

Group Policy Configuration

For Local System

  1. Press Win+R, type gpedit.msc
  2. Navigate: Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services
  3. Find the policy: “Set client connection settings”
  4. Enable the policy and set:
    • “Windows key combinations” = “On this computer”
    • “Priority for local key combinations” = “High”

For Registry

Create the following registry values:

reg
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"KeepAliveEnable"=dword:00000001
"KeepAliveInterval"=dword:0000000a
"KeyboardHookMode"=dword:00000002

Alternative Solutions

Using PowerShell Scripts

powershell
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class KeyboardHook {
    [DllImport("user32.dll")]
    public static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
    
    [DllImport("user32.dll")]
    public static extern bool UnhookWindowsHookEx(IntPtr hhk);
    
    [DllImport("user32.dll")]
    public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
    
    public delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
    
    public static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) {
        if (nCode >= 0 && wParam == (IntPtr)0x0100) {
            int vkCode = Marshal.ReadInt32(lParam);
            if (vkCode == 0xA2 || vkCode == 0xA3) { // VK_LWIN || VK_RWIN
                return (IntPtr)1; // Block processing
            }
        }
        return CallNextHookEx(IntPtr.Zero, nCode, wParam, lParam);
    }
}
"@

# Here you can add logic for handling Ctrl+Win+Left/Right

Using Third-Party Utilities

  • PowerToys FancyZones - can help with window management
  • SharpKeys - for key remapping
  • Microsoft PowerToys - includes Keyboard Manager utility

Verifying Results

After applying the settings, check if the keyboard shortcuts work:

  1. Close all RDP sessions
  2. Restart AutoHotkey (if using)
  3. Connect to RDP in fullscreen mode
  4. Try using Ctrl+Win+Left/Right

If the shortcuts still don’t work:

  • Check Windows event logs
  • Ensure AutoHotkey is running as administrator
  • Try changing process priorities
  • Check for other programs intercepting keyboard events

Sources

  1. Microsoft Documentation - Remote Desktop Services
  2. AutoHotkey Documentation - Window Groups
  3. Microsoft TechNet - Terminal Services Group Policy
  4. Stack Overflow - RDP Keyboard Shortcuts
  5. Microsoft Learn - Windows Keyboard Shortcuts

Conclusion

To solve the issue with Ctrl+Win+Left/Right keyboard shortcuts in fullscreen RDP mode, it’s recommended to:

  1. Start with basic RDP client settings and group policy configurations
  2. Use an advanced AutoHotkey script with proper context handling
  3. Always run AutoHotkey with elevated privileges
  4. Test changes incrementally, disabling other keyboard interceptors

The most reliable solution often involves a combination of group policy settings and a carefully configured AutoHotkey script that correctly handles the active window context.