void Create( Application& application )
{
Stage stage = Stage::GetCurrent();
+ stage.KeyEventSignal().Connect(this, &SimpleTextFieldExample::OnKeyEvent);
stage.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) );
TextField field = TextField::New();
stage.Add( field );
}
+ /**
+ * Main key event handler
+ */
+ void OnKeyEvent(const KeyEvent& event)
+ {
+ if(event.state == KeyEvent::Down)
+ {
+ if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
private:
Application& mApplication;