Some keys are not recognized, though. Actually, mainly those related to deleting actions (like delete, backspace virtual keyboard keys and so on). As far as I can see/understand, xterm also had to handle them in a proper way, using "vte" [1] for that. Is it ? Is there other GtkIMContext singal to handle actions like these ?
<br><br>[1] <a href="http://developer.gnome.org/doc/API/2.0/vte/vteterminal.html#VTETERMINALERASEBINDING">http://developer.gnome.org/doc/API/2.0/vte/vteterminal.html#VTETERMINALERASEBINDING</a><br><br>regards<br><br><div>
<span class="gmail_quote">On 1/28/06, <b class="gmail_sendername">Antonio Gomes</b> <<a href="mailto:tonikitoo@gmail.com">tonikitoo@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hey Aaron ..<br><br>just to thank you for your input regarding the Vk stuff ;)<br><br>is works ! (just fixing bugies now)<br><br>cheers<div><span class="e" id="q_1091243a5aaad044_1"><br><br><div><span class="gmail_quote">
On 1/24/06, <b class="gmail_sendername">Aaron Levinson
</b> <<a href="mailto:alevinsn@aracnet.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">alevinsn@aracnet.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I should note that the "commit" signal, along with the "preedit-changed"
<br>signal, are the only ways that you can respond to input from an input<br>method. That's likely your problem--you weren't doing anything with the<br>string in the "commit" callback. Writing a proper "commit" callback is a
<br>requirement for using a GTK input method. I wouldn't bother with using<br>gdk_window_foreign_new() if this works, and it should work.<br><br>Aaron<br><br>On Tue, 24 Jan 2006, Antonio Gomes wrote:<br><br>> On 1/24/06, Aaron Levinson <
<a href="mailto:alevinsn@aracnet.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">alevinsn@aracnet.com</a>> wrote:<br>> ><br>> > It's unclear to me why you wouldn't be able to "type" anymore in HTML
<br>> > forms. Do you mean with a regular keyboard or with the virtual keyboard?
<br>><br>><br>><br>> it stop working only for the virtual keyboard. Regular kb is ok !<br>><br>> As you indicated in a previous e-mail, you are getting to the "commit"<br>> > signal--why don't you just push the string passed to the "commit" callback
<br>> > directly into the form?<br>><br>><br>> Hummm ... I got your point here. Good enough to give it a try ;)<br>><br>> Look at the source code for GtkSocket or maybe GtkPlug for examples of<br>> > using gdk_window_foreign_new(). GtkMozEmbed may use it as well.
<br>><br>><br>> Ok ... I'll do that now .<br>><br>> many thanks again<br>><br>> Aaron<br>> ><br>> > On Tue, 24 Jan 2006, Antonio Gomes wrote:<br>> ><br>> > > > I still think working with the GtkMozEmbed is the way to go--I don't
<br>> > > > exactly understand your description of the problem that occurred when<br>> > you<br>> > > > used a GtkIMContext with your GtkMozEmbed widget. A more detailed<br>> > > > description would help.
<br>> > ><br>> > ><br>> > > Ok, so let me try: GtkMozEmbed widget wraps some gtk stuff, making<br>> > easier<br>> > > "embedding" mozilla in a gtk app. It also wraps some mozilla guts (like
<br>> > the<br>> > > EmbedPrivate, and listeners - you don't care, probably) and these are<br>> > left<br>> > > alone - I mean, non-gtk widgets. Having said that, the point is: "HTML<br>
> > > forms" are not gtk/gdk objects, so I can not connect im_context to them<br>> > > without mapping them to gtk object (I'm investigating ways to make this<br>> > > mapping possible, but I am not sure if it is supported).
<br>> > ><br>> > > In other words, the GtkMozEmbed widget itself seems to be too external<br>> > for<br>> > > my needs, I guess. As soon as set<br>> > ><br>> > > *gtk_im_context_set_client_window ((GtkIMContext *) embed->im_context,
<br>> > > GDK_WINDOW (widget->window));<br>> > ><br>> > > *<br>> > ><br>> > > I can not longer type into HTML forms ... Now, does it make sense to you<br>> > ?<br>> > >
<br>> > ><br>> > > Why don't you send me the relevant source code<br>> > > > that you wrote for GtkMozEmbed? I'll have a chance to look at it over<br>> > the<br>> > > > weekend or possibly on Friday.
<br>> > ><br>> > ><br>> > > I will ... thanks for that ;)<br>> > ><br>> > > Regarding gdk_window_foreign_new, the GdkNativeWindow parameter (not<br>> > > > GtkNativeWindow as you stated) represents a native window. As stated
<br>> > in<br>> > > > the GDK API documentation, this is a Window for X and an HWND for<br>> > Win32.<br>> > > > See<br>> > > ><br>> > > ><br>> > <a href="http://developer.gnome.org/doc/API/2.0/gdk/gdk-X-Window-System-Interaction.html#gdk-window-foreign-new" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://developer.gnome.org/doc/API/2.0/gdk/gdk-X-Window-System-Interaction.html#gdk-window-foreign-new</a><br>> > > > for more information. I've never used this function and I haven't<br>> > > > personally tried to use the method that I suggested in my original
<br>> > e-mail.<br>> > ><br>> > ><br>> > > it seems nobody knows much about it :S<br>> > ><br>> > > regards<br>> > ><br>> > ><br>> > > > > Aaron,
<br>> > > > ><br>> > > > > After some troubles, I'm now reconsidering the idea of creating<br>> > > > > GdkNativeWindow from the HTML form, and setting the im_context to it<br>
> > > > > (gtk_im_context_set_client_window) - as your proposed first -<br>> > instead of<br>> > > > > setting it to the GtkMozEmbed widget !<br>> > > > ><br>> > > > > But I'm stuck on the gdk_window_foreign_new function. How do I use
<br>> > that<br>> > > > ? I<br>> > > > > mean, I don't get the GtkNativeWindow parameter required by this<br>> > > > function<br>> > > > > ... Could you help me out here ?
<br>> > > > ><br>> > > > > thanks again ;)<br>> > > > ><br>> > > > ><br>> > > > > On 1/23/06, Antonio Gomes <<a href="mailto:tonikitoo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
tonikitoo@gmail.com</a>> wrote:<br>> > > > > ><br>> > > > > > hi Aaron,<br>> > > > > ><br>> > > > > ><br>> > > > > > > I didn't mention this in my last e-mail, but you'll also need to
<br>> > > > setup a<br>> > > > > > ><br>> > > > > > > signal handler for the GtkIMContext object's "commit" signal.<br>> > > > > ><br>> > > > > >
<br>> > > > > > I have it (the 'commit' signal) already connected and also its<br>> > > > callback<br>> > > > > > defined as it is in your post at<br>> > > > > >
<br>> > <a href="http://maemo.org/pipermail/maemo-developers/2006-January/002337.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://maemo.org/pipermail/maemo-developers/2006-January/002337.html
</a> -<br>> > > > > > cool !!! ... But problem begins after creating the IM_Context
<br>> > object<br>> > > > and<br>> > > > > > associating it with the GdkWindow of my GtkMozEmbed object : the<br>> > > > > > mozilla_engine stop recognizing any input from the vkb, except if
<br>> > I<br>> > > > press<br>> > > > > > 'backspace' ...<br>> > > > > ><br>> > > > > > bwt, in 'commit_cb' method, it prints what I type at the console
<br>> > but<br>> > > > > > doesn't add nothing at the HTML form (detail: it does with no<br>> > context<br>> > > > > > associated or if I type from the physical keyboard) ...
<br>> > > > > ><br>> > > > > > static gboolean<br>> > > > > > gtk_moz_embed_im_context_commit_cb (GtkIMContext *ctx,<br>> > const gchar<br>> > > > *str, GtkMozEmbed *aEmbed) {
<br>> > > > > > gunichar uChar = 0;<br>> > > > > > guint keyval = 0;<br>> > > > > > gchar *text2 = (gchar *) str;<br>> > > > > ><br>> > > > > > printf ("\n [GTK_MOZ_EMBED] it gets here '%s'
<br>> > > > > > \n", str);<br>> > > > > ><br>> > > > > > *// the string is in UTF-8 format--iterate through the<br>> > characters*<br>> > > > > > *while* (*text2) {
<br>> > > > > > uChar = g_utf8_get_char(text2);<br>> > > > > > keyval = gdk_unicode_to_keyval(uChar);<br>> > > > > ><br>> > > > > > *//*
<br>
> > > > > > *// do something with the character here*<br>> > > > > > *//*<br>> > > > > > text2 = g_utf8_next_char(text2);<br>> > > > > > }
<br>> > > > > > }<br></blockquote></div></span></div></blockquote></div><br>-- <br>--Antonio Gomes<br>http:// tonikitoo (dot) blogspot (dot) com (slash)