GNOME Bugzilla – Bug 119051
Cheap way of adding custom key bindings to a widget
Last modified: 2004-12-26 06:49:18 UTC
In order to effectively bind keys which might be needed by an input method on a GtkTextView, it would be nice to be able to pass each key through the associated GtkIMContext to see if the input method being used is interested before acting on the binding. However, there is currently no way to get to this GtkIMContext except by direct access of the im_context member of the GtkTextView. An API function to provide access to this GtkIMContext is a desirable alternative, I think.
I don't think revealing to apps what GTK+ is doing with the keystrokes internally in GtkTextView makes sense (I think there was another bug along the lines of "I tried sending keystrokes to the input method and it didn't work" bug that I WONTFIX'ed") You could do your bindings by deriving from GtkTextView and adding new binding signals and bindings, but that's certainly a bit involved. I'm thinking that we could do something like: GtkBindingSet* gtk_binding_set_by_widget (gpointer object_class); That got a per-widget custom GtkBindingSet (sort of like gtk_widget_get_modifier_style()) Then gtk_binding_entry_add_callback() gtk_binding_entry_add_closure() to allow adding key bindings without having to have a signal.
*** This bug has been marked as a duplicate of 56904 ***