system.deactivate()

Type Function
Library system.*
Return value none
Revision Release 2024.3703
Keywords multitouch
See also system.activate()

Overview

Deactivates a system-level feature such as "multitouch".

Multitouch is disabled by default, so there will be no effect unless it was previously activated via system.activate().

Syntax

system.deactivate( feature )
feature (required)

String. The system feature to be deactivated. Currently, the only supported values include:

Example

-- The following sample activates multitouch and creates a touch listener for a graphic
-- This displays the location, phase, and touch ID of each touch event
-- After 8 seconds, multitouch is then deactivated

system.activate( "multitouch" )
 
local bg = display.newRect( 0, 0, 320, 480 )
local output = native.newTextBox( 0, 20, 320, 240 )
output.size = 12
 
function showTouch( event )
    -- Display the event info on the screen
    output.text = output.text .. "\nPhase: " .. event.phase
    output.text = output.text .. "\n(" .. event.x .. "," .. event.y .. ")"
    output.text = output.text .. "\nId: " .. tostring( event.id )
end
 
bg:addEventListener( "touch", showTouch )
 
-- Deactivate multitouch after 8 seconds
timer.performWithDelay( 8000, function() system.deactivate( "multitouch" ); end )