18

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

2

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.

|improve this answer|||||
  • 11
    Should be a comment. – Moab Jul 11 '11 at 14:13
  • @Moab I thought it was an answer, but I will be more clear. – KCotreau Jul 11 '11 at 14:16
  • @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 '11 at 15:37
  • 1
    This answer simply is wrong! – Jens Marchewka Aug 9 '16 at 11:39
  • 1
    This is such a useless answer – iono Mar 13 '18 at 21:06
13

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
|improve this answer|||||
  • 6
    This one should be the accepted answer. – thorn Mar 20 '16 at 15:48
  • See my answer below for a solution that also works with the Alt+Shift key combo. – anrieff Nov 20 '16 at 15:07
3

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.

|improve this answer|||||
  • I use a similar approach using SharpKeys, registry remapping rocks! :D – mjsr Apr 14 '12 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 '14 at 9:17
3

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

|improve this answer|||||
  • This seems to work at first, but then doing a Ctrl-Z for example after pressing and releasing Alt doesn't work first time. – Alexandre G Apr 28 '19 at 12:02
2

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.

|improve this answer|||||
1

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.
|improve this answer|||||
  • 2
    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 '16 at 7:15
  • 1
    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. – Jens Marchewka Aug 10 '16 at 7:42
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
|improve this answer|||||
1

This works in my system with Autohotkey:

~LAlt::
KeyWait, LAlt
return

~LAlt Up::
Send, {LAlt Up}
return

It makes LAlt to behave purely as a modifier key, without triggering any action if it is pressed all by itself (such as activating the menu bar of the currently active window).

EDIT:

Try also this.

|improve this answer|||||
  • See my answer below for a solution that also works with the Alt+Shift key combo. – anrieff Nov 20 '16 at 15:08
1

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%20Windows%20Mods/Alt_menu_acceleration_DISABLER.ahk

|improve this answer|||||
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
|improve this answer|||||

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.