Skip navigation

Harald Markus Wirth


Page Content:

How to Disable the Menu Key

My german keyboard has a key [AltGr], which I need to enter certain special chars. The Pipe sign ("|") is to be entered with [AltGr]+[><|].

The "[Menu]" key shows an icon with a context menu and a mouse pointer. It is located right next to [AltGr] on my notebook and a menu pops up, when I press the key. Unconveniently, you can't close the popup-menu by hitting [Menu] again, you have to use [ESC] instead.

I wanted to turn off the Menu key and found a nice tutorial, which helped me. Basically you run:

xev

to see all events listed and press the key you are looking for the code of (You will probably see more than just those two sections):

- [Menu] -
KeyPress event, serial 31, synthetic NO, window 0x3200001,
    root 0x67, subw 0x0, time 66973474, (176,-10), root:(184,38),
    state 0x0, keycode 135 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x3200001,
    root 0x67, subw 0x0, time 66973595, (176,-10), root:(184,38),
    state 0x80, keycode 135 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

In my case, the following code line disabled the Menu key:

xmodmap -e "keycode 135 = 0x0000"

You can even have both keys acting as [AltGr], by assigning the keysym of [AltGr] to [Menu]:

- [AltGr] -
KeyPress event, serial 34, synthetic NO, window 0x3000001,
    root 0x67, subw 0x0, time 65469481, (782,331), root:(790,379),
    state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False
xmodmap -e "keycode 135 = 0xfe03"


Content Management:

μCMS α1.6