GNOME Bugzilla – Bug 83334
shorcut capplet doesn't accept key modifiers beyond alt, control and shift
Last modified: 2004-12-22 21:47:04 UTC
This because the modifier is masked with the value returned by gtk_accelerator_get_default_mod_mask, which has a default value of GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK. I use the Windows key (Mod4 in most layouts) for my window manager bindings, and I can't set them using the dialog for the reason explained. I propose the following simple patch to fix it.
Created attachment 8805 [details] [review] call gtk_accelarator_set_default_mod_mask with a full mod mask
Hmm, the patch will do what you want in the capplet but it will nto allow you to use any of those accelerators in other applications. The right place to handle this would be in gtk+. gtkaccellgroup.c
Basically, if you want to handle this _within_GTK_ you need to do considerably more work to do it properly ... for one thing you probably awant to introduce "virtual modifiers" like, say, GDK_SUPER_MASK in unused high modifier bits. (We aren't going to change the default mod map as suggested .. it will break stuff because ... accelerators will no longer work with NumLock down, etc.)
Add support for extra virtual modifiers.
A lot of this could be fixed without GTK+ changes with some more work in the keybindings applet. Assigning back to control-center since I don't think it should block on GDK API changes. GDK issue filed as bug 85780.
*** Bug 86612 has been marked as a duplicate of this bug. ***
*** Bug 87019 has been marked as a duplicate of this bug. ***
Because of the a11y implications of this bug, I'm marking it high for right now; Jody's going to work on it for Sun.
The problem isn't just the Keyboard Shortcuts capplet, it may be metacity. If I use gconftool-2 to manually set a keybinding to a key-Meta combination, the keybinding doesn't work.
Brian what do you set the metacity key to that doesn't work? Note that I did some work in libegg to support virtual modifiers and deployed that in CVS for metacity, but I haven't modified the keybindings capplet yet. There's an open bug with work to make the panel use the virtual mods code from libegg.
Jody, any status on this? It's still floating about on our stoppers list...
I just returned from vacation and will think more about this today.
This works: gconftool-2 -s -t string /apps/metacity/global_keybindings/switch_to_workspace_2 "<Control>F2" But the following command doesn't work. It ignores the <Meta> and binds just the F2 key to the action, Meta-F2 does nothing: gconftool-2 -s -t string /apps/metacity/global_keybindings/switch_to_workspace_2 "<Meta>F2"
So, um, that part sounds like a metacity bug. [Though control-center not accepting <mod> is still clearly a control-center bug.]
Lets break this down into 2 components 1) keybinding capplet does not accept modifiers beyond shift ctrl and Alt This is easy to change (although I'd like to see a clean way to keep numlock from appearing). 2) The applications that are supposed to use these accelerators ignore the modifiers if they are not part of the stock set. As Owen has mentioned for Gtk+ based apps this is more complicated than it looks. So for now, I'll close this and we can reopen distinct bugs for the applications that need to extend their modifier support.
But your component #1 still isn't fixed; Metacity allows a <Meta> keybinding, but you can't set one with the control center capplet. Am I missing something?
I have a patch for it. It will go in on Monday.
Or I could forget my cheesy patch and just use the update already in libegg.
Warning. The patch went into HEAD and 2.1.0, but did not go into gnome-2-0 until today and is not in 2.0.1.1
*** Bug 92228 has been marked as a duplicate of this bug. ***
Setting to <Meta> with gconf does not work for me but <Mod4> works fine at least for the key /apps/panel/global.