Alt+<key> window menu shortcuts cannot be disabled

Bug #1113420 reported by Dražen Lučanin
252
This bug affects 79 people
Affects Status Importance Assigned to Milestone
Unity
Confirmed
Undecided
Unassigned
nautilus (Ubuntu)
Confirmed
Undecided
Unassigned
unity (Ubuntu)
Confirmed
Undecided
Unassigned

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 3.5.7.2
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
GsettingsChanges:
 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)

Revision history for this message
Dražen Lučanin (kermit666) wrote :
Revision history for this message
Eric Chen (eric-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)

Revision history for this message
Dražen Lučanin (kermit666) wrote : Re: [Bug 1113420] Re: Alt+<key> window menu shortcuts cannot be disabled

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).
See:

http://askubuntu.com/questions/30224/how-to-disable-the-alt-hotkey-behavior-on-gnome-terminal

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.
> https://bugs.launchpad.net/bugs/1113420
>
> Title:
> Alt+<key> window menu shortcuts cannot be disabled
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1113420/+subscriptions
>

Revision history for this message
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).

Revision history for this message
Dražen Lučanin (kermit666) wrote :

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

http://askubuntu.com/questions/124815/how-do-i-enable-emacs-keybindings-in-google-chrome#comment332725_233539

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.

Revision history for this message
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...

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in nautilus (Ubuntu):
status: New → Confirmed
Revision history for this message
Oleksandr Senkovych (blackjack) wrote :

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

Revision history for this message
ngsupb (ngsupb) wrote :

This issue is still in 14.04

Revision history for this message
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 ....

Revision history for this message
Guillaume Wenzek (guillaume-wenzek) wrote :

I found a work around in ubuntu forum : http://ubuntuforums.org/showthread.php?t=1735533

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

Revision history for this message
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.
/home/YOURUSERNAME/.config/gtk-3.0/settings.ini
Then add:
[Settings]
gtk-enable-mnemonics = 0
Then logout and log back in.

Sources:
* https://mail.gnome.org/archives/gtk-list/2011-March/msg00108.html
* https://developer.gnome.org/gtk3/stable/GtkSettings.html

Better formatting here => http://askubuntu.com/a/569303/11929

Revision history for this message
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.

https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-auto-mnemonics

Revision history for this message
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.

https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-enable-mnemonics

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

Revision history for this message
Oleksandr Senkovych (blackjack) wrote :

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
dpkg-buildpackage
cd ..
dpkg -i indicator-appmenu-*.deb

Revision history for this message
Oleksandr Senkovych (blackjack) wrote :

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

Revision history for this message
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.

Revision history for this message
Davide Depau (depau) wrote :

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

Revision history for this message
Rodrigo Lledó (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
description: updated
tags: added: shortcut
Revision history for this message
Mukeshgupta-2006 (mukeshgupta-2006) wrote :

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.

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Samuel Tissot (hels149) wrote :

A little workaround that I found

the alt-r key does not trigger for me the HUD. So I reprogrammed my keyboard alt-l to be alt-r as well.

works for me. I hope it helps until this is fixed/changed.

NOTE. I do have a programmable keyboard. I do not know if it works with software keymapping solution

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.