After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 50300 - Make keybindings handle modifiers properly
Make keybindings handle modifiers properly
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 54850 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-01-05 21:38 UTC by Owen Taylor
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix (1.76 KB, patch)
2002-01-08 21:58 UTC, Anders Carlsson
none Details | Review

Description Owen Taylor 2001-01-05 21:38:39 UTC
GtkAccelGroup and GtkBindingSet need to use the GdkKeymap
functionality to properly handle hotkeys being pressed
when in keyboard groups other than where they are defined.

That is, Alt-F should always bring up the filemenu, even
if F is producing a cyrillic character.

The logic here is somewhat complex, so it possibly should
be encapsulated in some publically exported object.

A proposal for how to do this appears in:

http://mail.gnome.org/archives/gtk-devel-list/2000-December/msg00044.html
Comment 1 Havoc Pennington 2001-01-29 19:40:21 UTC
Put all GTK 1.3.x bugs on 2.0.0 milestone
Comment 2 Owen Taylor 2001-02-19 21:40:30 UTC
Remember to revert the duplicate-modifier-entry changes to
GtkCTree (Bug #2682) when this is fixed.
Comment 3 Anders Carlsson 2002-01-08 21:58:34 UTC
Created attachment 6357 [details] [review]
Proposed fix
Comment 4 Owen Taylor 2002-01-08 23:11:56 UTC
The proposed fix only fixes a very small part of the problem.
Comment 5 Owen Taylor 2002-01-22 21:05:44 UTC
*** Bug 54850 has been marked as a duplicate of this bug. ***
Comment 6 Owen Taylor 2002-02-18 14:12:04 UTC
http://mail.gnome.org/archives/gtk-devel-list/2002-February/msg00224.html

Has a detailed plan.
Comment 7 Owen Taylor 2002-02-21 17:20:18 UTC
Wed Feb 20 14:26:47 2002  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkkeyhash.[ch]: Implement "fuzzy" key binding lookups;
	allow matches on key and level but not group. Also, implement 
	ignoring "consumed modifiers correctly."

	* gtk/gtkaccelgroup.c gtk/gtkbindings.c: Convert to using
	GtkKeyHash.
	
	* gtk/gtkdebug.h gtk/gtkmain.c: Support GTK_DEBUG=keybindings

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Fill in
	the group for key release events as well as key press events.

	* gdk/gdkkeys.h gdk/x11/gdkkeys-x11.c
(gdk_keymap_translate_keyboard_state): 
	Rename unused_modifiers to consumed_modifiers, make the docs and
	non-Xkb implementation match the Xkb implementation.

	* gdk/linux-fb/gdkkeyboard-fb.c gdk/win32/gdkkeys-win32.c: Propagate
	doc and parameter name changes.

	* gdk/x11/gdkkeys-x11.c (gdk_keymap_translate_keyboard_state):
	XkbTranslateKeyCode doesn't handle LockMask, we need to handle
	it ourselves.

	* gdk/x11/gdkkeys-x11.c (gdk_keymap_translate_keyboard_state): Force
	<Shift>Tab to give GDK_ISO_Left_Tab, since we need consistency
	to allow dealing with ISO_Left_Tab.
	
	* gtk/gtkwindow.c gtk/gtktextview.c gtk/gtkscrolledwindow.c
	gtk/gtkpaned.c gtk/gtkcombo.c  gtk/gtknotebook.c:
	Remove inappropriate uses of GDK_ISO_Left_Tab. (GDK_ISO_Left_Tab
	or <Shift>Tab both are equivalent as a binding specifier.)

	* gtk/gtkbutton.c (gtk_button_class_init): Make ::activate
	GTK_RUN_ACTION, so you can bind an accelerator to it.

	* gtk/gtklabel.c (gtk_label_set_uline_text_internal): Call 
	gdk_unicode_to_keyval on the mnemonic character.

	* tests/testgtk.c: Add a test for the new fuzzy key binding matching.