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>IsExpectedToProcessPowerButton</title> 8 </head> 9 <body> 10<h1><CODE>nn::applet::CTR::IsExpectedToProcessPowerButton</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14bool IsExpectedToProcessPowerButton( 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">A value of <CODE>true</CODE> indicates that the POWER Button was pressed and a value of <CODE>false</CODE> indicates that it was not. </div> 25<h2>Description</h2> 26 <div class="section"> 27<p>Finds the state of the POWER Button.</p><!-- write here --><P><FONT COLOR="red">Although this function was planned to be removed in SDK 0.14.9, it was determined to be necessary upon further review of the shutdown sequence for the POWER Button. Though this is inconvenient, it is required to implement POWER Button handling.</FONT></P><P> 28A return value of <CODE>true</CODE> indicates that the POWER Button was pressed. In this case, the application must immediately call the <a href="../../../nn/applet/CTR/ProcessPowerButton.html"><CODE>nn::applet::CTR::ProcessPowerButton</CODE></a> function and then wait with the <a href="../../../nn/applet/CTR/WaitForStarting.html"><CODE>nn::applet::CTR::WaitForStarting</CODE></a> function. 29</P><P> 30A value of <CODE>false</CODE> indicates that a POWER Button press was not detected. In this case, do nothing. 31</P><P> 32Call this function periodically (usually every frame). 33</P><P> 34Example 35</P><PRE> 36 if ( <FONT color="red">applet::IsExpectedToProcessPowerButton()</FONT> ) 37 { 38 applet::ProcessPowerButton(); 39 applet::WaitForStarting(); 40 if ( applet::IsExpectedToCloseApplication() ) 41 { 42 _close_application(); 43 } 44 } 45</PRE></div> 46<h2>Revision History</h2> 47 <div class="section"> 48 <dl class="history"> 49 <dt>2010/12/09</dt> 50<dd>This function was deemed necessary following a review of the shutdown sequence for the POWER Button. 51 </dd> 52 <dt>2010/11/10</dt> 53<dd>Initial version.<br /> 54 </dd> 55 </dl> 56 </div> 57 <hr><p>CONFIDENTIAL</p></body> 58</html>