17

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?

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.

  • 8
    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
  • @voodoomsr But if you have no ALT, and you previously had not exposed it permanently, you would be locked out, no? – KCotreau Jul 11 '11 at 15:42
  • It is easy for a program to disable the Alt globally, but testing it is tricky. There is no guarantee that another program won't intercept the call before you . . . – surfasb Jul 11 '11 at 17:07
12

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
  • 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.

  • 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
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.

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 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.

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

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

  • 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 at 12:02
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
    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
0

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

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.