25

In Windows 7 how can I disable the function that activates the menu bar when Alt is pressed?

Are there some registry values to modify this behaviour?

10 Answers 10

-4

The answer is no. How could they do that? If they did that, and someone disabled it, they would cut people off from very necessary menu items. It would be a nightmare.

The only thing you can do is live with that, or activate the menu permanently by clicking Organize>Layout>Menu bar.

9
  • 19
    Should be a comment.
    – Moab
    Jul 11, 2011 at 14:13
  • 4
    @KCotreau: As you say, there is a way to obtain the menu bar, so for me is unnecesary that the ALT key produce that.
    – mjsr
    Jul 11, 2011 at 15:37
  • 6
    This answer simply is wrong! Aug 9, 2016 at 11:39
  • 7
    This is such a useless answer
    – iono
    Mar 13, 2018 at 21:06
  • 1
    I can click on menu items. Some of us are using more than 2,3 programs at the same time and alt firing menu bar randomly is so annoying and disturbing.
    – IGRACH
    Apr 19, 2021 at 18:17
16

I've been using AutoHotkey already, so I added this line to my script and it fixed this annoying behavior in almost all applications:

~LAlt Up:: return

It doesn't work in IE but I don't use IE anyway. :)

BTW, I also killed the annoying start menu popup via:

~LWin Up:: return
~RWin Up:: return
2
  • 7
    This one should be the accepted answer.
    – thorn
    Mar 20, 2016 at 15:48
  • See my answer below for a solution that also works with the Alt+Shift key combo.
    – anrieff
    Nov 20, 2016 at 15:07
4

This autohotkey does work for me on Windows 10:

Alt::Return ;Disables the key alt when it's pressed alone

(Zengabor's answer did not work for me).

All the glory to Rohwedder

1
  • This seems to work at first, but then doing a Ctrl-Z for example after pressing and releasing Alt doesn't work first time. Apr 28, 2019 at 12:02
3

None of the AHK-based solutions posted here have worked for me. However, with some fiddling, I figured out that if you pair ALT with any other key before it is released, it won't act to highlight the menus. Rather than waste a function key, I used an unassigned scan code that is never used for any other purpose.

LAlt::
sendinput, {LAlt down}
sendinput, {SC0E8 down} ;this is the scan code of an unassigned key. As long as you nor the system never use it for anything else, it can be used in THIS way to cancel the menu acceleration.
;tooltip, Lalt is pressed
KeyWait, LAlt
; That line is important, so that ALT does not continuously fire as you are holding it down.
;tooltip, Lalt was released
return

LAlt up::
sendinput, {LAlt up}
sendinput, {SC0E8 up}
;;;Unlike my 2nd keyboard, this method does not use the scan code as a strict "wrapper."
;;tooltip, 
return


RAlt::
sendinput, {RAlt down}
sendinput, {SC0E8 down}
;;tooltip, Ralt is pressed
KeyWait, RAlt
;;tooltip, Ralt was released
return

RAlt up::
sendinput, {RAlt up}
sendinput, {SC0E8 up}
;;tooltip, 
return

Video explanation:
https://www.youtube.com/watch?v=vRld4bVFrpU&lc=UgzMjkQd4rbmvRDqU9h4AaABAg

Link to full script:
https://github.com/TaranVH/2nd-keyboard/blob/master/Taran's_Windows_Mods/Alt_menu_acceleration_DISABLER.ahk

0
2

I found this question because I have a new keyboard and sometimes accidentally hit the ALT key when typing emails in Gmail. The focus is lost and any following keystrokes are passed to my browser (which can have very annoying results sometimes).

The best solution I found, which is an improvement but not perfect, is with a keymapper program called KeyTweak, which as far as I understand, changes the registry.

In the program, you map Left Alt to Right Alt, and Right Alt to Left Alt. This allows the Alt functions to still work somewhat (Ctrl-Alt-Delete). However, Alt-Tab is partially broken (at least on my Windows-7). It allows you partially to move to the other applications, but when you release the Alt key, the "selection" of the next application isn't made (you can make it with a mouse-click, however).

It's too bad Windows doesn't have something to prevent loss of focus from errant Alt presses. The Shift and Ctrl keys don't have that effect, for example.

2
  • I use a similar approach using SharpKeys, registry remapping rocks! :D
    – mjsr
    Apr 14, 2012 at 0:05
  • Remapped via SharpKeys (KeyTweak couldn't install, just quiely exits. Perhaps it doesn't work with XP?), rebooted, but the trick didn't worked.
    – Hi-Angel
    Oct 1, 2014 at 9:17
1

This one is interesting. I don't know of any programs besides Autokey. Or just end up writing a program. But no registry setting. That would break TONS of programs.

1
1

I was searching for a solution to the same problem: fixing how Windows reacts to "Alt+Shift" (change input language), but you mistype and press Alt, followed by Shift, with no overlap. In that case Windows would interpret the lone Alt as "select menu", the lone Shift does nothing, and any characters you press afterwards select and enter random menus you didn't intend to open.

When using a chat app like Skype and you are a foreign language speaker, switching with Alt+Shift is quite often, and you can do a lot of stupid things in the hurry.

@user3419297 pointed me to his solution here, which I modified to allow Alt+Shift to happen in all cases. It is only one #If more, but a very important one! The relevant excerpt:

; Disable stand-alone Alt key press: make Alt purely a modifier key.
; The If statement is required to get Alt+Shift work as expected. If it's not
; there, only [Press Alt], [Press Shift], [Release Shift], [Release Alt] would
; trigger the input language change. The other, more common sequence would be
; [Press Alt], [Press Shift], [Release  Alt], [Release Shift], but AutoHotKey
; would block it before it reaches Windows if the "#If" isn't there.
#If not GetKeyState("LShift", "P")
~LAlt::
    KeyWait, LAlt
return

; Make Alt+Something still work:
~LAlt Up::
    Send, {LAlt Up}
return

My full script also enables two Linuxish features: Alt+F2 opens up a "quick launch command", and pressing the right Alt minimizes the currently active window:

;==============================================================================
; AutoHotKey script for "Linuxifying" Windows 8.
; Based on suggestions on SuperUser (http://superuser.com/questions/1147370)
; 
; Written by: Veselin Georgiev
; Date      : 2016-11-18
;==============================================================================

; Optional: Make Alt+F2 bring up the "quick launch command" Window.
; In this case, it simulates the Windows logo key press. On Windows 8, the
; cursor would be in the search bar, which nicely emulates launching a
; command.
!F2::
    Sleep 200
    Send {LWin}
return

; Disable stand-alone Alt key press: make Alt purely a modifier key.
; The If statement is required to get Alt+Shift work as expected. If it's not
; there, only [Press Alt], [Press Shift], [Release Shift], [Release Alt] would
; trigger the input language change. The other, more common sequence would be
; [Press Alt], [Press Shift], [Release  Alt], [Release Shift], but AutoHotKey
; would block it before it reaches Windows if the "#If" isn't there.
#If not GetKeyState("LShift", "P")
~LAlt::
    KeyWait, LAlt
return

; Make Alt+Something still work:
~LAlt Up::
    Send, {LAlt Up}
return

; Optional: Make the right alt key minimize the currently visible window.
~RAlt Up::WinMinimize A
1

This works in AHK v1.1.28+:

~LAlt::Send {Blind}{vkE8}
1
  • See my answer below for a solution that also works with the Alt+Shift key combo.
    – anrieff
    Nov 20, 2016 at 15:08
0

as found somewhere @MS

  1. Press Windows Key+ R, type Regedit and hit Enter.
  2. Navigate to HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Preference
  3. Now create or modify a String Value (REG_SZ) called On and set its value to 1
  4. Logoff your computer to take effect.
2
  • 4
    Rather than posting the exact same answer to multiple questions you should be specifically tailoring your answer to suit OP. If a question is exactly identical and can be answered by exactly the same answer then you should be flagging to close one of the questions as a duplicate rather than posting duplicate answers.
    – Mokubai
    Aug 10, 2016 at 7:15
  • 2
    i got no time to search how moderators should mark duplicates, sorry, maybe you could do that? instead of bumming ppl who support with solutions. Aug 10, 2016 at 7:42
0

Just posting a solution I found around. It kills any Alt menu 100%

Alt::
KeyWait, Alt
return

LAlt Up::
if (A_PriorKey = "Alt")
    return
return

If you prefer too, you can also restrict this solution to a single program:

#IfWinActive ahk_exe sublime_text.exe
    Alt::
    KeyWait, Alt
    return

    LAlt Up::
    if (A_PriorKey = "Alt")
        return
    return
#IfWinActive
  1. https://www.autohotkey.com/boards/viewtopic.php?p=248473#p248473

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.