nn::applet::CTR::IsExpectedToProcessHomeButton Function

Syntax

bool IsExpectedToProcessHomeButton(
     void
);

Arguments

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 some other applet made a similar request to jump to the HOME Menu.

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

Example

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

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

       // Await
       applet::WaitForStarting();

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

       _recover_my_data();
   }

Prevent applet-transition functions from being called between this function and nn::applet::CTR::ProcessHomeButton. For example, if you attempt to preload library applets from another thread between these two function calls, an assert statement will trigger a warning because of an inconsistency in internal states.

Also, it was originally assumed that determination functions, such as this one, and actual transition operation functions would be called in sequence from the same thread, but it is possible to have a mechanism where they are respectively called from separate threads. In such cases, however, sufficient care is needed such that there is nothing following the transition target operation during the working of the determination thread.

Revision History

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

CONFIDENTIAL