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 119051 - Cheap way of adding custom key bindings to a widget
Cheap way of adding custom key bindings to a widget
Status: RESOLVED DUPLICATE of bug 56904
Product: gtk+
Classification: Platform
Component: Widget: Other
2.2.x
Other All
: Normal enhancement
: future
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-08-04 01:06 UTC by Ethan Blanton
Modified: 2004-12-26 06:49 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Ethan Blanton 2003-08-04 01:06:36 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.
Comment 1 Owen Taylor 2003-08-25 22:26:05 UTC
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.


 
Comment 2 Matthias Clasen 2004-12-26 06:49:18 UTC

*** This bug has been marked as a duplicate of 56904 ***