}
KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &FocusIntegrationExample::OnPreFocusChange );
+
+ // Respond to key events
+ mStage.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnKeyEvent );
}
// Callback for KeyboardFocusManager
// Respond to a click anywhere on the stage
stage.GetRootLayer().TouchSignal().Connect( this, &DrawCubeController::OnTouch );
+
+ // Respond to key events
+ stage.KeyEventSignal().Connect( this, &DrawCubeController::OnKeyEvent );
}
bool OnTouch( Actor actor, const TouchData& touch )
}
/**
+ * @brief Called when any key event is received
+ *
+ * Will use this to quit the application if Back or the Escape key is received
+ * @param[in] event The key event information
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+ /**
* This function creates a cube geometry including texture coordinates.
* Also it demonstrates using the indexed draw feature by setting an index array.
*/
// Respond to a click anywhere on the stage
stage.GetRootLayer().TouchSignal().Connect( this, &DrawLineController::OnTouch );
+
+ // Respond to key events
+ stage.KeyEventSignal().Connect( this, &DrawLineController::OnKeyEvent );
}
bool OnTouch( Actor actor, const TouchData& touch )
}
/**
+ * @brief Called when any key event is received
+ *
+ * Will use this to quit the application if Back or the Escape key is received
+ * @param[in] event The key event information
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+ /**
* This function creates a line geometry made of two vertices in order
* to draw a diagonal line.
*/
// Respond to a click anywhere on the stage
stage.GetRootLayer().TouchSignal().Connect( this, &TexturedCubeController::OnTouch );
+
+ // Respond to key events
+ stage.KeyEventSignal().Connect( this, &TexturedCubeController::OnKeyEvent );
}
bool OnTouch( Actor actor, const TouchData& touch )
}
/**
+ * @brief Called when any key event is received
+ *
+ * Will use this to quit the application if Back or the Escape key is received
+ * @param[in] event The key event information
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+ /**
* @brief CreateCubeGeometry
* This function creates a cube geometry including texture coordinates.
* Also it demonstrates using the indexed draw feature by setting an index array.
// Respond to a click anywhere on the stage
stage.GetRootLayer().TouchSignal().Connect( this, &DrawTriangleController::OnTouch );
+
+ // Respond to key events
+ stage.KeyEventSignal().Connect( this, &DrawTriangleController::OnKeyEvent );
}
bool OnTouch( Actor actor, const TouchData& touch )
}
/**
+ * @brief Called when any key event is received
+ *
+ * Will use this to quit the application if Back or the Escape key is received
+ * @param[in] event The key event information
+ */
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+ /**
* This function creates a triangle geometry made of three vertices in order
* to draw a coloured triangle.
*/
Name: com.samsung.dali-demo
Summary: The OpenGLES Canvas Core Demo
-Version: 1.2.32
+Version: 1.2.33
Release: 1
Group: System/Libraries
License: Apache-2.0
cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir}
%endif
-# LICENSE
-mkdir -p %{buildroot}/usr/share/license
-cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
##############################
# Post Install
%if 0%{?enable_dali_smack_rules} && !%{with wayland}
%config %{smack_rule_dir}/%{name}.rule
%endif
-%{_datadir}/license/%{name}
+%license LICENSE