Re: gtkmm support for keyboard input processing and input methods (or lack thereof)



On Tue, Jan 19, 2010 at 8:47 AM, Murray Cumming <murrayc murrayc com> wrote:
> On Sun, 2010-01-17 at 21:05 +0100, Chrysme wrote:
>> Hello,
>>
>>
>> Is there any plan to wrap the parts of Gtk+ needed for proper keyboard
>> input handling?
>>
>> Looking through the documentation for gtkmm 2.4, it seems the only way
>> to process individual key press/release events is to read the raw
>> GdkEventKey, but gdk_unicode_to_keyval(), gdk_keyval_to_unicode() and
>> related keymap functions are not present in gdkmm. As for text entry,
>> the necessary Gtk+ classes GtkIMContext, GtkIMMulticontext, etc are
>> not wrapped in gtkmm.
>
> There are for implementing input methods. For instance, to support
> Chinese via entering strokes. What do you actually need to do?

I need to add text entry support to an OpenGL enabled DrawingArea.
Support for CJK characters entry is required.

The only way to obtain keyboard input I found is to parse the
GdkEventKey parameter of Widget::on_key_press/release_event(), then
matching the keyval against defines in gdkkeysyms.h. It's not suitable
though, since I need the widget to have SCIM/XIM support, like
Gtk::Entry or Gtk::TextView.

>> I'm new to gtkmm, and it was pretty disappointing to see that I can't
>> support more than the Queen's ASCII without having to fall back on
>> Gtk+.
>
> In general, there's full unicode support in gtkmm applications.

I'm aware, but this support doesn't seem to extend to text entry
(gdk_keyval_to_unicode(), gdk_unicode_to_keyval(), and input methods
are missing).

According to the Gdk documentation: "The only correct way to handle
text input of text is using input methods (see GtkIMContext)" (see
http://library.gnome.org/devel/gdk/stable/gdk-Event-Structures.html#GdkEventKey).

And I did not find input methods mentioned anywhere in the gtkmm
documentation. While the wrapped Gtk+ classes in gtkmm obviously still
have their IM support, I found no way to implement a gtkmm-only widget
supporting it.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]