A problem with remapping Windows key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
haeri
Posts: 3
Joined: 03 Feb 2020, 11:01

A problem with remapping Windows key

Post by haeri » 30 Jun 2023, 13:27

So I've been trying to fully reassign the function of the right Windows key, smth like

Code: Select all

RWin::Space
I then realized, that all the windows hotkeys are still firing, so I disabled the "Windows + X" hotkeys in local group policy editor, but even after that some hotkeys were still working. I then used the "DisableLockWorkstation" registry edit, that successfully removed the functionality of "Windows + L" hotkey, however there still remained a major problem, that apparently is a known bug (https://social.technet.microsoft.com/Forums/en-US/cbaae74e-8311-4a46-a842-31dcdd6878dc/windows-key-quotstuckquot?forum=winserverTS): after issuing the combination of "Windows + L" the Windows key becomes "stuck" until you press it again, and if you happen to hit "p" or "u", the combination of which with the Windows key are by the way also apparently impossible to disable, the corresponding function will still go through, even though I'm not holding the Windows key anymore, opening the projector settings or ease of access center (and alt-tabbing you out of your full screen program).
My question is: is there some kind of workaround i can do with the Autohotkey to prevent Windows + L from getting registered and getting the Windows key "stuck" ? I tried to simply do

Code: Select all

>#l::return
but no luck.


haeri
Posts: 3
Joined: 03 Feb 2020, 11:01

Re: A problem with remapping Windows key

Post by haeri » 06 Jul 2023, 08:59

I've made progress, but there are still some problems. As I mentioned, I disabled all the functionality of the windows key that can be disabled and currently have a script like this:

Code: Select all

#NoEnv
#Persistent
SendMode Input
#MaxThreadsPerHotkey 10
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetWinDelay, -1
SetControlDelay, -1
SetBatchLines, -1

#p::e ;used to avoid Win+P hotkey, as it's not possible to disable it otherwise
#u::q ;same as above
>#l::s ;disables the problematic Win+L hotkey.  also e,q, s and Space are all used as hotkeys within a game.
~RWin::Space ;remaps right Win to Space
This however only works 95% of the time. Occasionally, Windows key will still issue the default "open start menu". I've notice that this happens without me pressing any other keys, just the RWin. I do, however, have other part of my script that's doing something else in the process, I'll make sure to test if that has something to do with it.
But if that's not the case, what could be causing the remapped hotkey to occasionally not work?

Post Reply

Return to “Ask for Help (v1)”