From d6b3145853e65b4dd9e0a78e3f008275c464bcec Mon Sep 17 00:00:00 2001 From: suhyung Eom Date: Wed, 10 Aug 2016 17:54:58 +0900 Subject: [PATCH] Implement detent event handler for wayland Signed-off-by: suhyung Eom Change-Id: I4c04e73b6ff5e1331e1dde41f19e59444201b61f --- adaptors/ecore/wayland/event-handler-ecore-wl.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp index 1d38c49..84a8aa2 100644 --- a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp +++ b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp @@ -193,6 +193,8 @@ struct EventHandler::Impl mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, handler ) ); mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, handler ) ); + // Register Detent event + mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetent, handler) ); #ifndef DALI_PROFILE_UBUNTU // Register Vconf notify - font name and size vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler ); @@ -649,6 +651,22 @@ struct EventHandler::Impl return ECORE_CALLBACK_PASS_ON; } + /** + * Called when detent event is recevied + */ + static Eina_Bool EcoreEventDetent( void* data, int type, void* event ) + { + DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDetent\n" ); + EventHandler* handler( (EventHandler*)data ); + Ecore_Event_Detent_Rotate *e((Ecore_Event_Detent_Rotate *)event); + int direction = (e->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1; + int timeStamp = e->timestamp; + + WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2(0.0f, 0.0f), direction, timeStamp ); + handler->SendWheelEvent( wheelEvent ); + return ECORE_CALLBACK_PASS_ON; + } + ///////////////////////////////////////////////////////////////////////////////////////////////// // Font Callbacks ///////////////////////////////////////////////////////////////////////////////////////////////// -- 2.7.4