[4.0] Fix to get ecore_device information to initialize it 98/161798/4
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 27 Nov 2017 10:59:54 +0000 (19:59 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Nov 2017 02:09:50 +0000 (11:09 +0900)
 - To pass the key event to ecore_imf_context_filter_event(),
   the device information, such as device name, device class, and device subclass,
   should be initialized by ecore_device APIs.
 - So, added ecore_device_name_get(), ecore_device_class_get(), ecore_device_subclass_get()
   in EcoreEventKeyDown() and EcoreEventKeyUp()

Change-Id: Id553e2bc6f9ead07cd89aa82fce9d12efbe5281c
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
adaptors/ecore/wayland/event-handler-ecore-wl.cpp

index 4647b5c..964524e 100644 (file)
@@ -665,9 +665,9 @@ struct EventHandler::Impl
         ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
         ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
         ecoreKeyDownEvent.locks     = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
-        ecoreKeyDownEvent.dev_name  = "";
-        ecoreKeyDownEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
-        ecoreKeyDownEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
+        ecoreKeyDownEvent.dev_name  = ecore_device_name_get( keyEvent->dev );
+        ecoreKeyDownEvent.dev_class = static_cast<Ecore_IMF_Device_Class>( ecore_device_class_get( keyEvent->dev ) );
+        ecoreKeyDownEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass>( ecore_device_subclass_get( keyEvent->dev ) );
 
         std::string checkDevice;
         GetDeviceName( keyEvent, checkDevice );
@@ -770,9 +770,9 @@ struct EventHandler::Impl
         ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
         ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
         ecoreKeyUpEvent.locks     = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
-        ecoreKeyUpEvent.dev_name  = "";
-        ecoreKeyUpEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
-        ecoreKeyUpEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
+        ecoreKeyUpEvent.dev_name  = ecore_device_name_get( keyEvent->dev );
+        ecoreKeyUpEvent.dev_class = static_cast<Ecore_IMF_Device_Class>( ecore_device_class_get( keyEvent->dev ) );
+        ecoreKeyUpEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass>( ecore_device_subclass_get( keyEvent->dev ) );
 
         eventHandled = ecore_imf_context_filter_event( imfContext,
                                                        ECORE_IMF_EVENT_KEY_UP,