nn::applet::CTR::ProcessHomeButtonAndWait Functionvoid ProcessHomeButtonAndWait();
None.
Processes HOME Menu transition and goes into standby until activated.
This function was designed to be used as follows. Only call this function if the nn::applet::CTR::IsExpectedToProcessHomeButton function returns true. After this function returns, make sure to check whether to exit the application using the nn::applet::CTR::IsExpectedToCloseApplication function.
if ( nn::applet::CTR::IsExpectedToProcessHomeButton() )
{
// Perform processing as needed here before transition to the HOME Menu.
nn::applet::CTR::ProcessHomeButtonAndWait();
if ( nn::applet::CTR::IsExpectedToCloseApplication )
{
// Leave the main loop, and perform termination processing
}
// Perform processing as needed here after returning from the HOME Menu.
}
This function performs the following processing internally.
// Disable sleep
bool e = IS_SLEEP_ENABLED(); // pseudocode: Check if sleep is enabled.
if ( e )
{
nn::applet::CTR::DisableSleep();
}
// Process HOME button
nn::applet::CTR::ProcessHomeButton();
nn::applet::CTR::WaitForStarting();
// Enable sleep if necessary
if ( e )
{
nn::applet::CTR::EnableSleep();
}
There is no need to take the sleep-enabled status into account when calling this function. This is because although it will return to Sleep Mode regardless of the return value of the nn::applet::CTR::IsExpectedToCloseApplication function, the sleep-related callback will not be called if the application termination flag is true.
In addition, you must initialize the graphics library using the nngxInitialize function before calling this function.
nngxInitialize function.
CONFIDENTIAL