Difference between revisions of "Application:setKeepAwake"

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

Revision as of 02:08, 13 June 2019


Available since: Gideros 2011.6
Class: Application

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 are controlled by accelerometer or gyroscope only. For these kind of applications, the screen should be kept awake by calling this function with parameter true.

  • Note: this function has no effect on desktop.


application:setKeepAwake(keepAwake)

Parameters

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

Examples

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