nn::applet::CTR::IsExpectedToProcessHomeButton Function

Syntax

bool IsExpectedToProcessHomeButton(
     void
);

Parameters

None.

Return Values

Returns whether there was a processing request. If true, the HOME Button must be processed.

Description

Determines whether there has been a request to process the HOME Button.

A return value of true indicates that either the HOME Button was pressed to jump to the HOME Menu, or another applet made a similar request to jump to the HOME Menu.

In such cases, call the nn::applet::CTR::ProcessHomeButton function to process the HOME Button. Then call nn::applet::CTR::WaitForStarting to wait if necessary.

Example

   // HOME Button transition check
   if ( applet::IsExpectedToProcessHomeButton() )
   {
       _save_my_data();

       // HOME Button transition process
       applet::ProcessHomeButton();

       // Wait
       applet::WaitForStarting();

       if( applet::IsExpectedToCloseApplication() )
       {
             _close_application();
       }

       _recover_my_data();
   }

Prevent other applet-transition functions from being called between this function and nn::applet::CTR::ProcessHomeButton. If there is an inconsistency in the internal state, for example because of an attempt to preload library applets from another thread between these two function calls, a warning is generated on an assertion.

This example assumes that determination functions such as this one and the function for actually making the transition are called successively in the same thread, but depending on the implementation you may be able to call them in different threads. However, be very careful that the determination thread does not continue executing after execution control is passed.

Revision History

2012/11/09
Added a note about calling the determination function and transition functions in different threads.
2011/11/01
Added a note related to calling applet-transition functions between this function and ProcessHomeButton.
2011/06/14
Deleted the ClearHomeButtonState function from an example.
2010/11/10
Initial version.

CONFIDENTIAL