Change-Id: I6f22c86547e6cc364a3bb09f8530c609e668d554
return GetImplementation(*this).KeyEventSignal();
}
return GetImplementation(*this).KeyEventSignal();
}
+Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
+{
+ return GetImplementation(*this).KeyEventGeneratedSignal();
+}
+
Scene::TouchSignalType& Scene::TouchSignal()
{
return GetImplementation(*this).TouchSignal();
Scene::TouchSignalType& Scene::TouchSignal()
{
return GetImplementation(*this).TouchSignal();
public:
typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type
typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type
public:
typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type
typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type
+ typedef Signal< bool (const Dali::KeyEvent&) > KeyEventGeneratedSignalType; ///< key event generated signal type
typedef Signal< void (const Dali::TouchData&) > TouchSignalType; ///< Touch signal type
typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type
typedef Signal< void (const Dali::TouchData&) > TouchSignalType; ///< Touch signal type
typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type
KeyEventSignalType& KeyEventSignal();
/**
KeyEventSignalType& KeyEventSignal();
/**
+ * @brief The user would connect to this signal to get a KeyEvent when KeyEvent is generated.
+ *
+ * @return The return is true if KeyEvent is consumed, otherwise false.
+ */
+ KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
+
+ /**
* @brief This signal is emitted when the screen is touched and when the touch ends
* (i.e. the down & up touch events only).
*
* @brief This signal is emitted when the screen is touched and when the touch ends
* (i.e. the down & up touch events only).
*
+bool Scene::EmitKeyEventGeneratedSignal(const KeyEvent& event)
+{
+ // Emit the KeyEventGenerated signal when KeyEvent is generated
+ return mKeyEventGeneratedSignal.Emit( event );
+}
+
void Scene::EmitEventProcessingFinishedSignal()
{
if ( !mEventProcessingFinishedSignal.Empty() )
void Scene::EmitEventProcessingFinishedSignal()
{
if ( !mEventProcessingFinishedSignal.Empty() )
return mKeyEventSignal;
}
return mKeyEventSignal;
}
+Integration::Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
+{
+ return mKeyEventGeneratedSignal;
+}
+
Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
{
return mEventProcessingFinishedSignal;
Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
{
return mEventProcessingFinishedSignal;
void EmitKeyEventSignal(const KeyEvent& event);
/**
void EmitKeyEventSignal(const KeyEvent& event);
/**
+ * Used by the KeyEventProcessor to emit KeyEventGenerated signals.
+ * @param[in] event The key event.
+ * @return The return is true if KeyEvent is consumed, otherwise false.
+ */
+ bool EmitKeyEventGeneratedSignal(const KeyEvent& event);
+
+ /**
* Emits the event processing finished signal.
*
* @see Dali::Scene::SignalEventProcessingFinished()
* Emits the event processing finished signal.
*
* @see Dali::Scene::SignalEventProcessingFinished()
*/
Integration::Scene::KeyEventSignalType& KeyEventSignal();
*/
Integration::Scene::KeyEventSignalType& KeyEventSignal();
+ /**
+ * @copydoc Integration::Scene::KeyEventGeneratedSignal()
+ */
+ Integration::Scene::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
+
/**
* @copydoc Integration::Scene::SignalEventProcessingFinished()
*/
/**
* @copydoc Integration::Scene::SignalEventProcessingFinished()
*/
// The key event signal
Integration::Scene::KeyEventSignalType mKeyEventSignal;
// The key event signal
Integration::Scene::KeyEventSignalType mKeyEventSignal;
+ Integration::Scene::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
// The event processing finished signal
Integration::Scene::EventProcessingFinishedSignalType mEventProcessingFinishedSignal;
// The event processing finished signal
Integration::Scene::EventProcessingFinishedSignalType mEventProcessingFinishedSignal;
#include <dali/internal/event/common/scene-impl.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/internal/event/common/scene-impl.h>
#include <dali/integration-api/events/key-event-integ.h>
GetImplementation( &keyEvent )->SetDeviceSubclass( event.deviceSubclass );
// Emit the key event signal from the scene.
GetImplementation( &keyEvent )->SetDeviceSubclass( event.deviceSubclass );
// Emit the key event signal from the scene.
- mScene.EmitKeyEventSignal( keyEvent );
+ bool consumed = mScene.EmitKeyEventGeneratedSignal( keyEvent );
+ if( !consumed )
+ {
+ mScene.EmitKeyEventSignal(keyEvent);
+ }
+
}
} // namespace Internal
}
} // namespace Internal