SashaChernykh wrote:@qwerty12, thank you, it's worked! But I have problem: if I press LWin+2 second time, Windows start menu are shown for me.
Eurgh, sorry. I thought the similar problem I had on my system was StartIsBack's fault (its keyboard hook is insanely annoying when it comes to the Windows key). With it turned off, I get the same after about five presses. Hopefully I'm just missing something and someone can correct me.
Meanwhile, I have another way for these specific keys (Win+{1-9}), but I don't know if you're going to like it...
Code: Select all
DetectHiddenWindows On
IsWindow := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandle", "Str", "user32", "Ptr"), "AStr", "IsWindow", "Ptr")
#IfWinActive ahk_class PX_WINDOW_CLASS
#2::
{
if (!DllCall(IsWindow, "Ptr", taskbarIcons))
ControlGet, taskbarIcons, Hwnd,, MSTaskSwWClass1, ahk_class Shell_TrayWnd
Control, Hide,,, ahk_id %taskbarIcons%
ControlSend, ahk_parent, % SubStr(A_ThisHotkey, 2)
Control, Show,,, ahk_id %taskbarIcons%
}
#IfWinActive
EDIT: The start menu actually isn't shown with the above, but that's only because this code is slower to work (which brings in its own problems like the key not getting properly sent to Sublime sometimes). You may be able to sort the original code out by introducing your own artificial delay after the key is sent to Sublime, like with
Sleep or
SetControlDelay, but that's probably not entirely reliable, either. I see what guest3456 means...
Some links that may help:
https://autohotkey.com/docs/misc/Override.htm
http://winaero.com/blog/disable-certain ... indows-10/ - namely, see if the
DisabledHotkeys registry value helps any