Fix handling of backspace key press
[profile/ivi/weekeyboard.git] / src / wkb-main.c
index d5f2c1b..0331c61 100644 (file)
@@ -177,7 +177,10 @@ _cb_wkb_on_key_down(void *data, Evas_Object *obj, const char *emission EINA_UNUS
    else if (strcmp(key, "backspace") == 0)
      {
         if (strlen(wkb->preedit_str) == 0)
+          {
              wl_input_method_context_delete_surrounding_text(wkb->im_ctx, -1, 1);
+             wl_input_method_context_commit_string(wkb->im_ctx, wkb->serial, "");
+          }
         else
           {
              wkb->preedit_str[strlen(wkb->preedit_str) - 1] = '\0';
@@ -189,7 +192,9 @@ _cb_wkb_on_key_down(void *data, Evas_Object *obj, const char *emission EINA_UNUS
    else if (strcmp(key, "enter") == 0)
      {
         _wkb_commit_preedit_str(wkb);
-        /* wl_input_method_context_keysym(wkb->im_ctx, wkb->serial, time, XKB_KEY_Return, key_state, mod_mask); */
+        wl_input_method_context_keysym(wkb->im_ctx, wkb->serial, 0,
+                       XKB_KEY_Return, WL_KEYBOARD_KEY_STATE_PRESSED,
+                       0);
         goto end;
      }
    else if (strcmp(key, "space") == 0)