Simplify the code to send key event 94/54094/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 11 Dec 2015 08:52:04 +0000 (17:52 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 11 Dec 2015 08:53:12 +0000 (17:53 +0900)
Change-Id: Iffda95680e9dcd3c70664749d6b9c2d1b8f5179a

ism/extras/efl_immodule/isf_imf_context.cpp
ism/extras/efl_wsc/isf_wsc_context.cpp

index 3b6fea3..42b63fe 100644 (file)
@@ -3839,10 +3839,7 @@ static XKeyEvent createKeyEvent (bool press, int keycode, int modifiers, bool fa
     event.same_screen = True;
     event.state       = modifiers;
     event.keycode     = keycode;
-    if (press)
-        event.type = KeyPress;
-    else
-        event.type = KeyRelease;
+    event.type        = press ? KeyPress : KeyRelease;
     event.send_event  = False;
     event.serial      = 0;
 
index ac03406..9e8dbe9 100644 (file)
@@ -1589,14 +1589,8 @@ void wsc_context_send_key (weescim *ctx, uint32_t keysym, uint32_t modifiers, ui
 
     ctx->modifiers = modifiers;
 
-    if (press) {
-        wl_input_method_context_keysym (ctx->im_ctx, ctx->serial, time,
-                                        keysym, WL_KEYBOARD_KEY_STATE_PRESSED, ctx->modifiers);
-    }
-    else {
-        wl_input_method_context_keysym (ctx->im_ctx, ctx->serial, time,
-                                        keysym, WL_KEYBOARD_KEY_STATE_RELEASED, ctx->modifiers);
-    }
+    wl_input_method_context_keysym (ctx->im_ctx, ctx->serial, time,
+            keysym, press ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED, ctx->modifiers);
 }
 
 static void