[maemo-commits] [maemo-commits] r15138 - in projects/haf/trunk/hildon-input-method-framework: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Feb 5 16:10:41 EET 2008
Author: tjunnone
Date: 2008-02-05 16:10:40 +0200 (Tue, 05 Feb 2008)
New Revision: 15138

Modified:
   projects/haf/trunk/hildon-input-method-framework/ChangeLog
   projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c
   projects/haf/trunk/hildon-input-method-framework/src/hildon-im-protocol.h
Log:
        * src/hildon-im-context.c, src/hildon-im-protocol.h:
          Introduce HILDON_IM_CONTEXT_ENTER_ON_FOCUS, which generates
          a virtual enter key event when the client widget receives
          focus. This is mainly useful for fullscreen plugins.       


Modified: projects/haf/trunk/hildon-input-method-framework/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-input-method-framework/ChangeLog	2008-02-05 12:49:43 UTC (rev 15137)
+++ projects/haf/trunk/hildon-input-method-framework/ChangeLog	2008-02-05 14:10:40 UTC (rev 15138)
@@ -4,6 +4,10 @@
 	  characters when there are several key press events in
 	  the queue and the mainloop iteration does not run between
 	  their processing. Fixes NB#79664.
+	* src/hildon-im-context.c, src/hildon-im-protocol.h:
+	  Introduce HILDON_IM_CONTEXT_ENTER_ON_FOCUS, which generates
+	  a virtual enter key event when the client widget receives
+	  focus. This is mainly useful for fullscreen plugins.
 
 2008-02-04  Tomas Junnonen  <tomas.junnonen at nokia.com>
 

Modified: projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c
===================================================================
--- projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c	2008-02-05 12:49:43 UTC (rev 15137)
+++ projects/haf/trunk/hildon-input-method-framework/src/hildon-im-context.c	2008-02-05 14:10:40 UTC (rev 15138)
@@ -73,6 +73,7 @@
 static HildonIMCommitMode commit_mode = 0;
 static gboolean is_internal_widget = FALSE;
 static gboolean internal_reset = FALSE;
+static gboolean enter_on_focus_pending = FALSE;
 
 typedef enum {
   HILDON_IM_SHIFT_STICKY_MASK     = 1 << 0,
@@ -851,6 +852,9 @@
           hildon_im_context_send_fake_key(GDK_KP_Enter, TRUE);
           hildon_im_context_send_fake_key(GDK_KP_Enter, FALSE);
           break;
+        case HILDON_IM_CONTEXT_ENTER_ON_FOCUS:
+          enter_on_focus_pending = TRUE;
+          break;
         case HILDON_IM_CONTEXT_CONFIRM_SENTENCE_START:
           hildon_im_context_check_sentence_start(self);
           break;
@@ -1181,6 +1185,13 @@
   }
 
   hildon_im_context_send_command(self, HILDON_IM_SETCLIENT);
+
+  if (enter_on_focus_pending)
+  {
+    hildon_im_context_send_fake_key(GDK_KP_Enter, TRUE);
+    hildon_im_context_send_fake_key(GDK_KP_Enter, FALSE);
+    enter_on_focus_pending = FALSE;
+  }
 }
 
 static void

Modified: projects/haf/trunk/hildon-input-method-framework/src/hildon-im-protocol.h
===================================================================
--- projects/haf/trunk/hildon-input-method-framework/src/hildon-im-protocol.h	2008-02-05 12:49:43 UTC (rev 15137)
+++ projects/haf/trunk/hildon-input-method-framework/src/hildon-im-protocol.h	2008-02-05 14:10:40 UTC (rev 15138)
@@ -118,6 +118,7 @@
   HILDON_IM_CONTEXT_WIDGET_CHANGED,            /* IM detected that the client widget changed */
   HILDON_IM_CONTEXT_OPTION_CHANGED,            /* The OptionMask for the active context is updated */
   HILDON_IM_CONTEXT_CLEAR_STICKY,              /* Clear the sticky key state */
+  HILDON_IM_CONTEXT_ENTER_ON_FOCUS,            /* Generate a virtual enter key event on focus in */
 
   /* always last */
   HILDON_IM_CONTEXT_NUM_COM


More information about the maemo-commits mailing list