X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fecore%2Fwayland%2Fevent-handler-ecore-wl.cpp;h=4634859500cd333b2b0a22c73cd2a1861e5b301f;hb=3e6f1441cbb782e8924b808081e4a263b1326f8d;hp=964524efaae5379494b817e67c2e51b41a7b813a;hpb=3fcbee3be7ba279e3f44f6e057307c1baee23a49;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp old mode 100644 new mode 100755 index 964524e..4634859 --- a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp +++ b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp @@ -169,6 +169,33 @@ const unsigned int DirectionStringsTotal = sizeof( ElDBusAccessibilityDirectionS #endif // DALI_ELDBUS_AVAILABLE /** + * EcoreInputModifierToEcoreIMFLock function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Locks enums. + * @param[in] modifier the Ecore_Event_Modifier input. + * @return the Ecore_IMF_Keyboard_Locks output. + */ +Ecore_IMF_Keyboard_Locks EcoreInputModifierToEcoreIMFLock( unsigned int modifier ) +{ + unsigned int lock( ECORE_IMF_KEYBOARD_LOCK_NONE ); // If no other matches, returns NONE. + + if( modifier & ECORE_EVENT_LOCK_NUM ) + { + lock |= ECORE_IMF_KEYBOARD_LOCK_NUM; // Num lock is active. + } + + if( modifier & ECORE_EVENT_LOCK_CAPS ) + { + lock |= ECORE_IMF_KEYBOARD_LOCK_CAPS; // Caps lock is active. + } + + if( modifier & ECORE_EVENT_LOCK_SCROLL ) + { + lock |= ECORE_IMF_KEYBOARD_LOCK_SCROLL; // Scroll lock is active. + } + + return static_cast( lock ); +} + +/** * Ecore_Event_Modifier enums in Ecore_Input.h do not match Ecore_IMF_Keyboard_Modifiers in Ecore_IMF.h. * This function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Modifiers enums. * @param[in] ecoreModifier the Ecore_Event_Modifier input. @@ -176,7 +203,7 @@ const unsigned int DirectionStringsTotal = sizeof( ElDBusAccessibilityDirectionS */ Ecore_IMF_Keyboard_Modifiers EcoreInputModifierToEcoreIMFModifier(unsigned int ecoreModifier) { - int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE. + unsigned int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE. if ( ecoreModifier & ECORE_EVENT_MODIFIER_SHIFT ) // enums from ecore_input/Ecore_Input.h @@ -664,7 +691,7 @@ struct EventHandler::Impl ecoreKeyDownEvent.compose = keyEvent->compose; ecoreKeyDownEvent.timestamp = keyEvent->timestamp; ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers ); - ecoreKeyDownEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE; + ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent->modifiers ); ecoreKeyDownEvent.dev_name = ecore_device_name_get( keyEvent->dev ); ecoreKeyDownEvent.dev_class = static_cast( ecore_device_class_get( keyEvent->dev ) ); ecoreKeyDownEvent.dev_subclass = static_cast( ecore_device_subclass_get( keyEvent->dev ) ); @@ -692,8 +719,10 @@ struct EventHandler::Impl { if ( !strcmp( keyEvent->keyname, "Escape" ) || !strcmp( keyEvent->keyname, "Return" ) || - !strcmp( keyEvent->keyname, "KP_Enter" ) ) + !strcmp( keyEvent->keyname, "KP_Enter" ) || + !strcmp( keyEvent->keyname, "XF86Exit" ) ) { + ecore_imf_context_input_panel_hide( imfContext ); ecore_imf_context_reset( imfContext ); } } @@ -769,7 +798,7 @@ struct EventHandler::Impl ecoreKeyUpEvent.compose = keyEvent->compose; ecoreKeyUpEvent.timestamp = keyEvent->timestamp; ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers ); - ecoreKeyUpEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE; + ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent->modifiers ); ecoreKeyUpEvent.dev_name = ecore_device_name_get( keyEvent->dev ); ecoreKeyUpEvent.dev_class = static_cast( ecore_device_class_get( keyEvent->dev ) ); ecoreKeyUpEvent.dev_subclass = static_cast( ecore_device_subclass_get( keyEvent->dev ) );