Alt+<key> window menu shortcuts cannot be disabled

Bug #1113420 reported by Dražen Lučanin on 2013-02-02
This bug affects 78 people
Affects Status Importance Assigned to Milestone
nautilus (Ubuntu)
unity (Ubuntu)

Bug Description

I find the <alt> key ergonomically very useful (it can be pressed with a thumb without moving any of the "letter" fingers) and I would like to use it for many custom keyboard shortcuts (there is a reason why it plays such a big role in Emacs and the whole OS X for that matter).

Currently, though, <alt> is hardcoded to activate window menu entries (such as <alt>+F for the file menu, <alt>+E for the edit menu) and there is no way to surpass this functionality in all the applications. Personally, I find these shortcuts quite useless - they take you to "copy", "paste", and "open file" which have standard shortcuts anyway (with the exception of preferences, which for some reason don't have a standardized shortcut even though that's often the only thing a person looks for up there).

Expected behaviour

What I would like to see is a global option to disable these alt+<key> menu shortcuts to free up the <alt> key for other uses (similar to the option already available in gnome-terminal, only global). Preferably, activating this option would also remove the first-letter underlining in the menu to indicate to users that they can't acess it through shortcuts.

To reproduce:

- in Unity settings -> keyboard -> Shortcuts -> Launchers change the "Launch terminal" shortcut to ALT+T
- hit <alt>-t, new terminial pops up
- start Thunderbird or Okular, both of which have a "Tools" menu
- note <alt>-t now opens the Tools menu
- kill the application
- hit <alt>-t, nothing happens

(I marked nautilus for apport to collect my version numbers, but this affects most applications - didn't know what the right target is)

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: nautilus 1:3.5.90.really.3.4.2-0ubuntu4.1
ProcVersionSignature: Ubuntu 3.5.0-23.35-generic
Uname: Linux 3.5.0-23-generic x86_64
ApportVersion: 2.6.1-0ubuntu10
Architecture: amd64
Date: Sat Feb 2 13:22:32 2013
ExecutablePath: /usr/bin/nautilus
 b'org.gnome.nautilus.window-state' b'geometry' b"'931x626+1+80'"
 b'org.gnome.nautilus.window-state' b'start-with-status-bar' b'true'
InstallationDate: Installed on 2012-10-19 (106 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
MarkForUpload: True
SourcePackage: nautilus
UpgradeStatus: No upgrade log present (probably fresh install)

Dražen Lučanin (kermit666) wrote :
Pjack Chen (pjack-chen) wrote :

This bug really annoy me too. I cannot use some Alt+<key> shortcut key in bash. ex: Alt+f, Alt + (left arrow key), Alt + (right arrow key)

In the terminal application in specific, you can disable the menu shortcuts
it in the options (otherwise I don't know how would I edit long commands).

For all the other applications, though, it is not possible to free
alt-shortcuts for other uses.

On Wed, May 29, 2013 at 12:59 PM, Pjack Chen <email address hidden> wrote:

> This bug really annoy me too. I cannot use some Alt+<key> shortcut key
> in bash. ex: Alt+f, Alt + (left arrow key), Alt + (right arrow key)
> --
> You received this bug notification because you are subscribed to the bug
> report.
> Title:
> Alt+<key> window menu shortcuts cannot be disabled
> To manage notifications about this bug go to:

Dražen Lučanin (kermit666) wrote :

BTW, Pjack Chen, you can mark this bug as "affecting you" on top of the page (under the bug title).

Dražen Lučanin (kermit666) wrote :

Woohoo! It seems that this is already possible! I just read this comment on an SO question

System Settings - Keyboard - Shortcuts tab - Windows section - Disable "Activate the window menu"

Although this is only alt+space initially, disabling it removes all the alt+<key> window menu shorcuts. Since this is the case, this bug report can be aimed at making that description clearer.

Dražen Lučanin (kermit666) wrote :

False alarm, it doesn't really work :(

It seemed to be working for Chromium, but not for all applications. Seems that Chromium didn't have these "shortcut" menu items - just alt+f mapping to its options.

The bug remains open...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nautilus (Ubuntu):
status: New → Confirmed
Oleksandr Senkovych (blackjack) wrote :

Alt+menu shortcut shortcuts doesn't work also (e.g. Alt+F should open &File menu)

ngsupb (ngsupb) wrote :

This issue is still in 14.04

Belarrius (belarrius) wrote :

Same bug here! on Ubuntu 14.04

I play at WoW with wine and the alt+a and alt+e bug my game!

It's not possible to disable alt+a or alt+e ....

I found a work around in ubuntu forum :

*** quote ***
To disable mnemonics you should create (if it doesn't already exist) ~/.gtkrc-2.0. This file should contain the line gtk-enable- mnemonics = 0 (you can add other GTK settings if you'd like). Then, restart for the changes to take effect (you may be able to log out then log in instead).

I don't know what are mnemonics, and it might depends on which version of gtk your application is using.

Elijah Lynn (elijah-lynn) wrote :

The above comment didn't work for me. It seems in Ubuntu 14.04, Nautilus uses GTK-3.0 and in 3.0 they moved away from the gtkrc files and use settings.ini files in various locations.

For Nautilus on Ubuntu 14.04:

Create the following path & file if it doesn't already exist.
Then add:
gtk-enable-mnemonics = 0
Then logout and log back in.


Better formatting here =>

midopa (midopa) wrote :

#13 that doesn't work for me.

According to GTK docs, this setting has been disabled since 3.10, which is what's on 14.04.

scinart (scinart) wrote :

#13 does work for me.

According to GTK docs , GtkSettings:gtk-enable-mnemonics has been deprecated since version 3.10 and should not be used in newly-written code. This setting can still be used for application overrides, but will be ignored in the future.

#14 refers to the wrong property. It is gtk-enable-mnemonics rather than gtk-auto-mnemonics.

Just in case someone is so annoyed that he is ready to do some untested things, just copy-paste this in terminal with root permissions:

export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
export QUILT_PATCHES=debian/patches
apt-get -y build-dep indicator-appmenu
apt-get -y source indicator-appmenu
apt-get -y install quilt
cd indicator-appmenu-*
quilt new disable_alt_shortcut
quilt push
quilt add src/window-menu-dbusmenu.c
echo """
Index: indicator-appmenu-15.02.0+15.04.20150302/src/window-menu-dbusmenu.c
--- indicator-appmenu-15.02.0+15.04.20150302.orig/src/window-menu-dbusmenu.c
+++ indicator-appmenu-15.02.0+15.04.20150302/src/window-menu-dbusmenu.c
@@ -345,7 +345,6 @@ item_activate (DbusmenuClient * client,
 static void
 status_changed (DbusmenuClient * client, GParamSpec * pspec, gpointer user_data)
- g_signal_emit_by_name(G_OBJECT(user_data), WINDOW_MENU_SIGNAL_STATUS_CHANGED, dbusmenu_client_get_status (client));

 WindowMenuStatus dbusmenu_status_table[] = {
""" | patch --ignore-whitespace -p1
quilt refresh
cd ..
dpkg -i indicator-appmenu-*.deb

Sorry, don't mind to my previous comment. It doesn't work (although it seemed to me that it did for a moment).

Bert Vermeulen (biot) wrote :

This is a general problem across Unity, and it is SUPREMELY annoying.

I like to use <alt>-t to open a terminal, and various other keyboard shortcuts that use <alt> as the only modifier. That has always worked, but it's broken on Unity: when I start an application that has a menu that starts with the letter 't', that application steals the shortcut. Instead of popping up a new terminal, it opens that menu.

Even worse, even after quitting the application the keyboard shortcut remains broken.

To reproduce:
- in Unity settings -> keyboard -> Shortcuts -> Launchers change the "Launch terminal" shortcut to ALT+T
- hit <alt>-t, new terminial pops up
- start Thunderbird or Okular, both of which have a "Tools" menu
- note <alt>-t now opens the Tools menu
- kill the application
- hit <alt>-t, nothing happens

The keyboard shortcut is still there in the settings. Restarting Unity makes it work again.

Note that the applications that trigger this use GTK2 and Qt, respectively. There is nothing wrong with an application registering menu keyboard shortcuts -- but the window manager cannot be overruled by an application!

Unity's keyboard shortcuts *must* take precedence.

Davide Depau (depau) wrote :

This is very annoying with Sublime Text too, which binds special keybindings using the Alt key.

Rodrigo (rodhos-hp) wrote :

As part of the big bug review for 16.04 LTS I have tested this on 15.10 and the bug is still there.

Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
tags: added: desktop-bugscrub-triaged
Rodrigo (rodhos-hp) on 2015-11-13
description: updated
Rodrigo (rodhos-hp) on 2015-11-16
tags: added: shortcut

Bug still present in 15.10 . Doesn't work by even disabling the "Activate the window menu" shortcut from Settings->Keyboard->Shortcuts. Particularly annoying while using Sublime Text.

John Parejko (parejkoj-3) wrote :

Still exists on 16.04. This bug appears to have been orphaned for years: what might be necessary to get someone to look at it? Should we go upstream to gtk?

Brett Stahlman (brettstahlman) wrote :

Linux power users tend to make heavy use of keybindings involving alt/meta and ctrl. Consequently, this is a very serious issue.

Sebastian Zaha (grimdonkey) wrote :

#13 does not seem to work in 16.04 anymore. It takes the keys from the application too, can't use the keys bound by the editor / ide.

Velkan (velkan-s) wrote :

Yes, just set some language that doesn't use Latin alphabet for your GUI and you'll be able to code in the IDE.

Joshua Bearden (joshua-0) wrote :

I just wanted to play games in Ubuntu. alt-e is a crucial keybind for me in my favourite game. This little bug prevents me from playing.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers