#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
+#include <dali/devel-api/events/key-event-devel.h>
// INTERNAL INCLUDES
#include <events/gesture-manager.h>
{
const char * DETENT_DEVICE_NAME = "tizen_detent";
+const std::string DEFAULT_DEVICE_NAME = "";
+const DevelKeyEvent::DeviceClass::Type DEFAULT_DEVICE_CLASS = DevelKeyEvent::DeviceClass::NONE;
// DBUS accessibility
#define A11Y_BUS "org.a11y.Bus"
#ifdef DALI_ELDBUS_AVAILABLE
// Initialize ElDBus.
- DALI_LOG_INFO( gImfLogging, Debug::General, "Starting DBus Initialization" );
+ DALI_LOG_INFO( gImfLogging, Debug::General, "Starting DBus Initialization\n" );
eldbus_init();
mSessionConnection = eldbus_connection_get( ELDBUS_CONNECTION_TYPE_SESSION );
// Pass in handler in the cb_data field so we can access the accessibility adaptor within the callback.
eldbus_proxy_call( elDBusManager, A11Y_GET_ADDRESS, EcoreElDBusInitialisation, handler, -1, "" );
- DALI_LOG_INFO( gImfLogging, Debug::General, "Finished DBus Initialization" );
+ DALI_LOG_INFO( gImfLogging, Debug::General, "Finished DBus Initialization\n" );
#endif // DALI_ELDBUS_AVAILABLE
}
if ( touchEvent->window == handler->mImpl->mWindow )
{
- TouchPoint::State state ( TouchPoint::Down );
+ PointState::Type state ( PointState::DOWN );
// Check if the buttons field is set and ensure it's the primary touch button.
// If this event was triggered by buttons other than the primary button (used for touch), then
// just send an interrupted event to Core.
if ( touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
{
- state = TouchPoint::Interrupted;
+ state = PointState::INTERRUPTED;
}
- TouchPoint point( touchEvent->multi.device, state, touchEvent->x, touchEvent->y );
+ Integration::Point point;
+ point.SetDeviceId( touchEvent->multi.device );
+ point.SetState( state );
+ point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+ point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+ point.SetPressure( touchEvent->multi.pressure );
+ point.SetAngle( Degree( touchEvent->multi.angle ) );
handler->SendEvent( point, touchEvent->timestamp );
}
if ( touchEvent->window == handler->mImpl->mWindow )
{
- TouchPoint point( touchEvent->multi.device, TouchPoint::Up, touchEvent->x, touchEvent->y );
+ Integration::Point point;
+ point.SetDeviceId( touchEvent->multi.device );
+ point.SetState( PointState::UP );
+ point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+ point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+ point.SetPressure( touchEvent->multi.pressure );
+ point.SetAngle( Degree( touchEvent->multi.angle ) );
handler->SendEvent( point, touchEvent->timestamp );
}
if ( touchEvent->window == handler->mImpl->mWindow )
{
- TouchPoint point( touchEvent->multi.device, TouchPoint::Motion, touchEvent->x, touchEvent->y );
+ Integration::Point point;
+ point.SetDeviceId( touchEvent->multi.device );
+ point.SetState( PointState::MOTION );
+ point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+ point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+ point.SetPressure( touchEvent->multi.pressure );
+ point.SetAngle( Degree( touchEvent->multi.angle ) );
handler->SendEvent( point, touchEvent->timestamp );
}
Dali::ImfManager imfManager( ImfManager::Get() );
if ( imfManager )
{
- imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+ imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
}
if ( imfContext )
ecoreKeyDownEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
#ifdef ECORE_IMF_1_13
ecoreKeyDownEvent.dev_name = "";
+ ecoreKeyDownEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
+ ecoreKeyDownEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
#endif // ECORE_IMF_1_13
eventHandled = ecore_imf_context_filter_event( imfContext,
keyString = keyEvent->string;
}
- KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, KeyEvent::Down);
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS );
handler->SendEvent( keyEvent );
}
}
Ecore_Event_Key *keyEvent( (Ecore_Event_Key*)event );
bool eventHandled( false );
- // Menu, home, back button must skip ecore_imf_context_filter_event.
- static const char* menuKeyName = KeyLookup::GetKeyName( DALI_KEY_MENU );
- static const char* homeKeyName = KeyLookup::GetKeyName( DALI_KEY_HOME );
- static const char* backKeyName = KeyLookup::GetKeyName( DALI_KEY_BACK );
- if ( ( menuKeyName && strcmp( keyEvent->keyname, menuKeyName ) != 0 ) &&
- ( homeKeyName && strcmp( keyEvent->keyname, homeKeyName ) != 0 ) &&
- ( backKeyName && strcmp( keyEvent->keyname, backKeyName ) != 0 ) )
+ // Device keys like Menu, home, back button must skip ecore_imf_context_filter_event.
+ if ( ! KeyLookup::IsDeviceButton( keyEvent->keyname ) )
{
Ecore_IMF_Context* imfContext = NULL;
Dali::ImfManager imfManager( ImfManager::Get() );
if ( imfManager )
{
- imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+ imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
}
if ( imfContext )
keyString = keyEvent->string;
}
- KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, KeyEvent::Up);
- handler->SendEvent( keyEvent );
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS );
+ handler->SendEvent( keyEvent );
}
}
mGestureManager.Stop();
}
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
{
if(timeStamp < 1)
{
Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
if(type != Integration::TouchEventCombiner::DispatchNone )
{
- DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.deviceId, point.state, point.local.x, point.local.y);
+ DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y);
// First the touch and/or hover event & related gesture events are queued
if(type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth)
}
}
-void EventHandler::SendEvent(KeyEvent& keyEvent)
+void EventHandler::SendEvent(Integration::KeyEvent& keyEvent)
{
Dali::PhysicalKeyboard physicalKeyboard = PhysicalKeyboard::Get();
if ( physicalKeyboard )
{
- if ( ! KeyLookup::IsDeviceButton( keyEvent.keyPressedName.c_str() ) )
+ if ( ! KeyLookup::IsDeviceButton( keyEvent.keyName.c_str() ) )
{
GetImplementation( physicalKeyboard ).KeyReceived( keyEvent.time > 1 );
}
}
- // Create KeyEvent and send to Core.
- Integration::KeyEvent event(keyEvent.keyPressedName, keyEvent.keyPressed, keyEvent.keyCode,
- keyEvent.keyModifier, keyEvent.time, static_cast<Integration::KeyEvent::State>(keyEvent.state));
- mCoreEventInterface.QueueCoreEvent( event );
+ // Send to KeyEvent Core.
+ mCoreEventInterface.QueueCoreEvent( keyEvent );
mCoreEventInterface.ProcessCoreEvents();
}
void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
{
- SendEvent(point, timeStamp);
+ Integration::Point convertedPoint( point );
+
+ SendEvent(convertedPoint, timeStamp);
}
void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
void EventHandler::FeedKeyEvent( KeyEvent& event )
{
- SendEvent( event );
+ Integration::KeyEvent convertedEvent( event );
+ SendEvent( convertedEvent );
}
void EventHandler::FeedEvent( Integration::Event& event )
// Any touch listeners should be told of the interruption.
Integration::TouchEvent event;
- TouchPoint point(0, TouchPoint::Interrupted, 0, 0);
+ Integration::Point point;
+ point.SetState( PointState::INTERRUPTED );
event.AddPoint( point );
// First the touch event & related gesture events are queued