Remapping Windows 10 Desktop hotkeys

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
MrCellophane
Posts: 2
Joined: 31 May 2023, 05:23

Remapping Windows 10 Desktop hotkeys

Post by MrCellophane » 02 Jun 2023, 14:56

Hello,

I would like to remap the standard Windows 10 Desktop hotkeys Ctrl-Win-Left (Right) to AltGr-Left (Right) so that I can change desktops with one hand.

I thought it should be pretty straghtforward, but I must be a dummy because I am running into all sorts of issues. Here is the script I have been playing with:

Code: Select all

#Requires AutoHotkey v2.0
>!Right::^<#Right
>!Left::^<#Left
; >!Left::Send '^<#{Left}'
; >!Left::Send "{LCtrl down}{LWin down}{Left}{LWin up}{LCtrl up}"
Issues:
1. Lines 4 and 5 simply do not work. I tried all combinations of Send I could, none has ever done anything. I have no clue why.
2. The keyboard is configured as US International, thus it has AltGr (which works as expected and generates the right characters). However, <^>!Left (Right) never worked, only the above >!Left (Right). Experimented with a tilde as well, no luck.
3. Lines 2 and 3 sort of work, but they cause a weird activation of a window on the target desktop with the status bar popping up and the windows icon in it highlighted. When I use an alternative keyboard layout that does not have AltGr, only a regular Alt, then before switching the desktop the active window receives the angle bracket character (< or >).

In summary:
- I am unable to map just the Right Alt key as a modifier in either keyboard layout (US International or SK Qwerty)
- I am unable to reliably inject the right codes to just make the desktops switch without either dropping a character in the currently active window, or "activating" the to-be-active window.

Any help would be much appreciated.

Bill

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: Remapping Windows 10 Desktop hotkeys

Post by mikeyww » 02 Jun 2023, 16:36

Welcome to this AutoHotkey forum!

This worked here.

Code: Select all

#Requires AutoHotkey v2.0
<^>!Left:: Send '#^{Left}'
<^>!Right::Send '#^{Right}'

MrCellophane
Posts: 2
Joined: 31 May 2023, 05:23

Re: Remapping Windows 10 Desktop hotkeys

Post by MrCellophane » 03 Jun 2023, 02:28

I know this should work, I have done a search and seen your earlier post, as a matter of fact, my line 4 is from your post.
However, I cannot get it to work, this is a brand new install of Win 10 LTSC 21H2 on a ThinkPad X1 Carbon 3rd gen.
Any way to figure out what and why may be failing?

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: Remapping Windows 10 Desktop hotkeys

Post by mikeyww » 03 Jun 2023, 05:06

Do you mean the 3-line script that I posted here? You tried it by itself? What does it do? What does KeyHistory show?

Post Reply

Return to “Ask for Help (v2)”