Disabling the Win key without disabling other hotkeys Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
panhartstuff
Posts: 20
Joined: 21 Jan 2018, 07:40

Disabling the Win key without disabling other hotkeys

01 Jan 2019, 14:21

I want to disable the Win key, but I also have several Win+* hotkeys. Is there a way to disable it without having all the other hotkeys to stop working?
I tried the below, but it disables not only the Win key, but also my other hotkeys.

Code: Select all

LWin::
Return
RWin::
Return
This code also have the same effect as the above:

Code: Select all

LWin Up::
Return
RWin Up::
Return
I also tried this:

Code: Select all

~LWin Up::
Return
~RWin Up::
Return
People claimed that it worked on Win 7, but I couldn't get it to work on my Win 10. It still triggers the menu.

Any help will be appreciated!
vsub
Posts: 256
Joined: 29 Sep 2015, 03:39

Re: Disabling the Win key without disabling other hotkeys

01 Jan 2019, 14:57

This works(win10)but there is something weird about it(maybe some hidden feature I don't know about)
In the mouse settings I have the option enabled to show where the mouse is but that happens when you press Ctrl not the window key

Code: Select all

$LWin::
Keywait,Lwin,T0.5
If ErrorLevel = 1
{
Send,{LWin Down}
Keywait,Lwin
Send,{LWin Up}
}
Return
The code is waiting for you 0.5 seconds to release the key.
Waiting longer that 0.5 seconds will send the win key so you can do a key combination and the good part of this is that sending the win key like this will not bring the start menu,instead it will execute that weird mouse location function

$ infront of a hotkey is used to prevent the code to be executed again by sending the same key
panhartstuff
Posts: 20
Joined: 21 Jan 2018, 07:40

Re: Disabling the Win key without disabling other hotkeys

01 Jan 2019, 17:23

Thanks, but it doesn't really work very consistently. I usually tap my shortcuts really fast, so 0.5 is usually too slow. After some testing, it seems that I tap my shortcuts at the average of 0.06 seconds. But if I set the timeout to that length, it'd be just as fast as how I'd accidentally tap the Win key, rendering the script useless. Is there a more cohesive solution to this?
panhartstuff
Posts: 20
Joined: 21 Jan 2018, 07:40

Re: Disabling the Win key without disabling other hotkeys

01 Jan 2019, 21:32

Damn nice, didn't know about that at all! Thanks for the help, it works perfectly!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], flyingDman, Google [Bot], joshuajclark, Odlanir, Sashkon, tom0925 and 112 guests