Window can get KeyEvent even if control already use it.
Change-Id: I41631b5b3aef393e3e0134419b38acea20aed84a
return GetImplementation(*this).KeyEventSignal();
}
+Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
+{
+ return GetImplementation(*this).KeyEventGeneratedSignal();
+}
+
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
+ 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
*/
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).
mKeyEventSignal.Emit( event );
}
+bool Scene::EmitKeyEventGeneratedSignal(const KeyEvent& event)
+{
+ // Emit the KeyEventGenerated signal when KeyEvent is generated
+ return mKeyEventGeneratedSignal.Emit( event );
+}
+
void Scene::EmitEventProcessingFinishedSignal()
{
mEventProcessingFinishedSignal.Emit();
return mKeyEventSignal;
}
+Integration::Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
+{
+ return mKeyEventGeneratedSignal;
+}
+
Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
{
return mEventProcessingFinishedSignal;
*/
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.
*
*/
Integration::Scene::KeyEventSignalType& KeyEventSignal();
+ /**
+ * @copydoc Integration::Scene::KeyEventGeneratedSignal()
+ */
+ Integration::Scene::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
+
/**
* @copydoc Integration::Scene::SignalEventProcessingFinished()
*/
// The key event signal
Integration::Scene::KeyEventSignalType mKeyEventSignal;
+ Integration::Scene::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
// 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>
+
namespace Dali
{
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