Difference between revisions of "Application:setKeepAwake"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
<br />
+
<translate><br />
 
Controls the screen dimming and device sleeping of the device. When the application has no touches as user input for some period,<br />
 
Controls the screen dimming and device sleeping of the device. When the application has no touches as user input for some period,<br />
 
the system puts the device into a sleep state where the screen dims. However some applications have no input and controlled<br />
 
the system puts the device into a sleep state where the screen dims. However some applications have no input and controlled<br />
 
by accelerometer or gyroscope only. For these kind applications, the screen should be kept awake by calling this function<br />
 
by accelerometer or gyroscope only. For these kind applications, the screen should be kept awake by calling this function<br />
with parameter `true`.<br />
+
with parameter [[[true]]].<br />
 
<br />
 
<br />
 
&lt;ul&gt;<br />
 
&lt;ul&gt;<br />
 
&lt;li&gt;*Note:** This function has no effect on desktop.&lt;/li&gt;<br />
 
&lt;li&gt;*Note:** This function has no effect on desktop.&lt;/li&gt;<br />
 
&lt;/ul&gt;<br />
 
&lt;/ul&gt;<br />
<br />
+
<br /></translate>
 
<source lang="lua">
 
<source lang="lua">
 
  Application:setKeepAwake(keepAwake)
 
  Application:setKeepAwake(keepAwake)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''keepAwake''': (boolean) if true, screen is kept awake. <br/>
+
'''keepAwake''': (boolean) <translate>if true, screen is kept awake.</translate> <br/>
 
=== Examples ===
 
=== Examples ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">application:setKeepAwake(true) -- disable screen dimming and device sleeping<br />
+
<source lang="lua">application:setKeepAwake(true) -- disable screen dimming and device sleeping
application:setKeepAwake(false) -- enable screen dimming and device sleeping<br /></source>
+
application:setKeepAwake(false) -- enable screen dimming and device sleeping</source>

Revision as of 14:34, 23 August 2018

Available since: Gideros 2011.6

Description


Controls the screen dimming and device sleeping of the device. When the application has no touches as user input for some period,
the system puts the device into a sleep state where the screen dims. However some applications have no input and controlled
by accelerometer or gyroscope only. For these kind applications, the screen should be kept awake by calling this function
with parameter [[[true]]].

<ul>
<li>*Note:** This function has no effect on desktop.</li>
</ul>

 Application:setKeepAwake(keepAwake)

Parameters

keepAwake: (boolean) if true, screen is kept awake.

Examples

Example

application:setKeepAwake(true)	-- disable screen dimming and device sleeping
application:setKeepAwake(false)	-- enable screen dimming and device sleeping