Disable the key alt when it's pressed alone (while allowing to work in combination with other keys). Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
partof
Posts: 95
Joined: 16 Jan 2016, 08:38

Disable the key alt when it's pressed alone (while allowing to work in combination with other keys).

10 Jan 2019, 10:38

In many apps, such as chrome pressing alt lose the focus (the cursor goes to the menu)

I'm struggling to find the way to disable that simple keystroke without losing all my shortcuts which work with the alt and others keys (ex: alt+x).

Any idea?


This stack answer https://superuser.com/a/615424/235752does not work:

Code: Select all

~LAlt Up:: return

; It doesn't work also with the win key 
~LWin Up:: return
~RWin Up:: return
Rohwedder
Posts: 2200
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Disable the key alt when it's pressed alone (while allowing to work in combination with other keys).  Topic is solved

10 Jan 2019, 11:29

Hallo,
try:

Code: Select all

Alt::Return ;Disables the key alt when it's pressed alone
!x:: ;alt+x works
!y:: ;alt+y works
ToolTip,% A_ThisHotkey
Return
partof
Posts: 95
Joined: 16 Jan 2016, 08:38

Re: Disable the key alt when it's pressed alone (while allowing to work in combination with other keys).

10 Jan 2019, 12:48

Guten abend Rohwedder und danke schoen!

It's insulting of simplicity but it's working, so I'll worship your name for the rest of my life!

Thanks again!

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot] and 218 guests