1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" />
7<title>ProcessHomeButton</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/applet/Overview.html">applet</a>::<a href="../../../nn/applet/CTR/Overview.html">CTR</a>::ProcessHomeButton</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14bool ProcessHomeButton(
15     void
16);
17</pre>
18    </div>
19<h2>Arguments</h2>
20    <div class="section">
21<p>None.</p>
22    </div>
23<h2>Return Values</h2>
24<div class="section">Returns a value indicating whether it is necessary to wait. </div>
25<h2>Description</h2>
26    <div class="section">
27<p>Processes transitions to the HOME Menu.</p><!-- write here --><P>
28This function is used to jump to the HOME Menu when this is required by the <a href="../../../nn/applet/CTR/IsExpectedToProcessHomeButton.html"><CODE>nn::applet::CTR::IsExpectedToProcessHomeButton</CODE></a> function.
29</P><P>
30The return value indicates whether it is necessary to wait with the <a href="../../../nn/applet/CTR/WaitForStarting.html"><CODE>nn::applet::CTR::WaitForStarting</CODE></a> function after this function is called. If this is <CODE>true</CODE>, call the function. If this is <CODE>false</CODE>, you do not need to call the function. (Of course, even if you call the function it will simply exit without waiting.)
31</P><P>
32To ensure mutual exclusion with Sleep Mode, you must call <CODE><a href="../../../nn/applet/CTR/DisableSleep.html">nn::applet::CTR::DisableSleep</a>(true)</CODE> before calling this function. You must call <CODE><a href="../../../nn/applet/CTR/EnableSleep.html">nn::applet::CTR::EnableSleep</a>(true)</CODE> after waiting and determining to finish waiting. (Note that the constraint above is particular to the current version and may change in the future.)
33</P><P>
34You must also initialize the graphics library using the <CODE>nngxInitialize</CODE> function before calling this function.
35</P><P>
36Example
37</P><PRE>
38   // HOME Button transition check
39   if ( applet::IsExpectedToProcessHomeButton() )
40   {
41       _save_my_data();
42       applet::DisableSleep(true);
43       // HOME Button transition process
44       <FONT color="red">applet::ProcessHomeButton();</FONT>
45       // Wait
46       applet::WaitForStarting();
47       if ( applet::IsExpectedToCloseApplication() )
48       {
49             _close_application();
50       }
51       applet::EnableSleep(true);
52       _recover_my_data();
53   }
54</PRE><BR /><P>If <CODE>HomeButtonCallback</CODE> has been set by the <CODE><a href="../../../nn/applet/CTR/SetHomeButtonCallback.html">nn::applet::CTR::SetHomeButtonCallback</a></CODE> function, do not call this function until after the process has left the callback.  (If you call the function beforehand, the process might become deadlocked.)
55</P><P>
56Although old versions of the library had the <CODE>nn::applet::CTR::ProcessHomeButtonIfPrepared</CODE> function, it has the exact same behavior as this function. Use this function instead.
57</P></div>
58<h2>Revision History</h2>
59    <div class="section">
60      <dl class="history">
61        <dt>2011/03/30</dt>
62<dd>	        Added note about the need for the <CODE>nngxInitialize</CODE> function.
63        </dd>
64        <dt>2011/02/17</dt>
65<dd>	        Added a cautionary note about setting the callback.<br />
66        </dd>
67        <dt>2011/01/24</dt>
68<dd>Added mention of the <CODE>DisableSleep</CODE> and <CODE>EnableSleep</CODE> functions.<br />
69        </dd>
70        <dt>2010/12/10</dt>
71<dd>Added information about the removal of <CODE>ProcessHomeButtonIfPrepared</CODE>.
72        </dd>
73        <dt>2010/11/10</dt>
74<dd>Initial version.<br />
75        </dd>
76      </dl>
77    </div>
78  <hr><p>CONFIDENTIAL</p></body>
79</html>
80