GNOME Bugzilla – Bug 603190
Allow setting GDK_META/SUPER/HYPER_MASK simultaneously?
Last modified: 2010-06-05 14:44:07 UTC
I'd like to use meta key in gnome-terminal. Libvte currently use Mod1 as Meta, which is only correct if Alt is the Meta key (the default in Gnome I think, but it's not an option here, because Alt with some common keys also triggers the menu in gnome-terminal). I reported a bug to libvte developers (https://bugzilla.gnome.org/show_bug.cgi?id=601926) and it turned out that libvte should use GDK_META_MASK to determine which modifier is really the Meta. The problem is that if I make with Gnome's keyboard settings the Win key to Meta, than it maps Meta Super and Hyper to Mod4 (xmodmap output): xmodmap: up to 5 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40) mod2 Num_Lock (0x4d) mod3 mod4 Meta_L (0x85), Meta_R (0x86), Meta_L (0xcd), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) And after testing GDK_META/SUPER/HYPER_MASK I found that only one of them is set. In my case it's SUPER, so pressing a combination with Win key is recognized as Super not as Meta. Adding just Meta keys to mod3 solves the problem, but gnome's keyboard settings is useless for GDK in my case. Different modifier keys on the same modifier bit happens in my case anyway, because I have only mod3 and mod4 free for the Meta Super and Hyper. I had the idea that setting more than one of GDK_META/SUPER/HYPER_MASK-s could be a solution. As I understand ICCCM doesn't prohibit that, and this way if the program needs Super but not Meta and Hyper it works and it also works if the program needs Meta but not the others.
Created attachment 148676 [details] [review] a patch Here is a patch that makes GTK+ try harder to make sense of key combinations involving virtual modifiers. I need to meditate a bit more over this before committing it.
Hm. Has patch 148676 finally been committed?
See gdk_keymap_add_virtual_modifiers / gdk_keymap_map_virtual_modifiers
On Karmic i think this patch solved my problem. (maybe i left my xmodmap setting modified) Now i use Lucid, and although the changelog of the gtk package contains this patch, my pygtk program used for testing still reports meta key only as super modifier. xmodmap: shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40) mod2 Num_Lock (0x4d) mod3 mod4 Meta_L (0x85), Meta_R (0x86), Meta_L (0xcd), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)