Difference between revisions of "Application:setKeepAwake"

From GiderosMobile
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__NOTOC__
+
'''Available since:''' Gideros 2011.6<br/>
<languages />
+
'''Class:''' [[Application]]<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Application|Application]]<br/>
+
=== Description ===
=== <translate>Description</translate> ===
+
Controls the screen dimming and device sleeping of the device.
<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 />
+
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.
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 />
+
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''.
with parameter ''true''.<br />
+
 
<br />
+
'''Note''': this function has no effect on desktop.
&lt;ul&gt;<br />
+
 
&lt;li&gt;*Note:** This function has no effect on desktop.&lt;/li&gt;<br />
+
 
&lt;/ul&gt;<br />
 
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
Application:setKeepAwake(keepAwake)
+
application:setKeepAwake(keepAwake)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''keepAwake''': (boolean) <translate>if true, screen is kept awake.</translate> <br/>
+
=== Parameters ===
=== <translate>Examples</translate> ===
+
'''keepAwake''': (boolean) if true, screen is kept awake
'''Example'''<br/>
+
 
<source lang="lua">application:setKeepAwake(true) -- disable screen dimming and device sleeping
+
=== Examples ===
application:setKeepAwake(false) -- enable screen dimming and device sleeping</source>
+
<source lang="lua">
 +
application:setKeepAwake(true) -- disable screen dimming and device sleeping
 +
application:setKeepAwake(false) -- enable screen dimming and device sleeping
 +
</source>
 +
 
 +
{{Application}}

Revision as of 00:41, 3 December 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