Difference between revisions of "Application:setKeepAwake"

From GiderosMobile
m (Text replacement - "</source" to "</syntaxhighlight")
 
(3 intermediate revisions by 2 users 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 />
+
<syntaxhighlight lang="lua">
<br /></translate>
+
application:setKeepAwake(keepAwake)
<source lang="lua">
+
</syntaxhighlight>
Application:setKeepAwake(keepAwake)
+
 
</source>
+
=== Parameters ===
=== <translate>Parameters</translate> ===
+
'''keepAwake''': (boolean) if true, screen is kept awake
'''keepAwake''': (boolean) <translate>if true, screen is kept awake.</translate> <br/>
+
 
=== <translate>Examples</translate> ===
+
=== Examples ===
'''Example'''<br/>
+
<syntaxhighlight 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
 +
</syntaxhighlight>
 +
 
 +
{{Application}}

Latest revision as of 18:14, 12 July 2023

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