How to stop Alt from triggering Global Menu?

21,084

Solution 1

I also use Emacs, but with the GUI (emacs & in a terminal shell) I don't see this problem - Alt-H selects the whole buffer.

When I run Emacs specifically inside a terminal (emacs -nw) I see the problem as you report. The Alt key is intercepted by the terminal application.

If you really want to use text-mode Emacs inside a terminal, you should use the terminal's menu (click inside the terminal window, then go to top of screen), then select Edit > Keyboard Shortcuts..., and uncheck "Enable menu access keys". After doing that, text-mode Emacs treats Alt-H just like GUI Emacs.

(edit) to disable the Alt key in all applications, run ccsm (CompizConfig Settings Manager), select Desktop -> Ubuntu Unity Plugin and disable the "Key to show the menu bar while pressed" and possibly "Key to show the HUD when tapped" too.

You may need to install ccsm using sudo apt-get install CompizConfig-Settings-Manager.

Solution 2

You can go into Settings > Keyboard and change the shortcut or disable the shortcut there

enter image description here

Share:
21,084

Related videos on Youtube

fusilli.jerry89
Author by

fusilli.jerry89

Updated on September 18, 2022

Comments

  • fusilli.jerry89
    fusilli.jerry89 over 1 year

    I am trying to disable Alt from triggering the global menu when I am using an application (I am using Ubuntu 14.04).

    My problem is, when I am using emacs, for example, and I hit Alt+h, the help menu is being launched, which I don't want.

  • fusilli.jerry89
    fusilli.jerry89 about 10 years
    I already have 'Key to show the HUD' set as disabled. Are you sure this is an issue with HUD?
  • laugh salutes Monica C
    laugh salutes Monica C about 10 years
    I now see Emacs GUI is a special case, which probably intercepts Alt. I edited the answer to provide a more general solution.
  • fusilli.jerry89
    fusilli.jerry89 about 10 years
    Thank you laugh for your help. Sadly, this does prevent the menu bar from displaying, but if I still type a shortcut, for example alt + h, it will still trigger the menu.
  • laugh salutes Monica C
    laugh salutes Monica C about 10 years
    You're right, and I now see there are many related questions about this, plus the bug you referred to. Sorry. Anyway, for Emacs specifically, you may try to update (I'm using 24.3.1 which does not suffer from this).
  • fusilli.jerry89
    fusilli.jerry89 about 10 years
    Thank you. You still helped me because now I can just use emacs outside of the terminal and it does everything I need. Thank you!!!
  • Chester
    Chester over 8 years
    @fusilli.jerry89 Mine showed disabled as well. I set it to something I never planned on using (Fn+? ... or something like that). Afterwards, Alt stopped triggering the menu.
  • Alexander van Trijffel
    Alexander van Trijffel over 6 years
    I wish I found your tip 2 years ago, that would have saved me so many unwanted context switches to the global menu..
  • kvz
    kvz over 4 years
    For CLI junkies out there, I think you should also be able to do this like so: gsettings set org.compiz.integrated show-hud "['disabled']" # or a different key-mapping