To allow quitting example with escape or back key
Change-Id: Icaa30d4991ee2f65e8c10e4fc136f52de05168cd
buttonsTable.AddChild( button3, Toolkit::TableView::CellPosition( 2, 0 ) );
mContentLayer.Add(buttonsTable);
+
+ Stage::GetCurrent().KeyEventSignal().Connect(this, &ImageViewController::OnKeyEvent);
}
private:
return true;
}
+ /**
+ * 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;