system.activate()

Description:

Activates a system level feature, such as multitouch. Use system.deactivate to disable a feature.

Syntax:

system.activate( feature )

Example:

The following sample activates multitouch and creates a touch listener for a background graphic that displays the location, phase, and ID of each touch event.

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)

Parameters:

feature
String: Specifies the system feature to be activated. Currently, the only supported value is "multitouch".

Returns:

Nothing.

Remarks:

Note: Multitouch does not work correctly on some Android devices (e.g., NexusOne, HTC Incredible, etc.). This can be demonstrated in Drag Me Multitouch sample app. This is a limitation of the current Android platforms and not Corona.

Supported on operating systems and platforms for build numbers shown:
  • Mac OS X:
    Corona SDK 1.0
  • Windows:
    Corona SDK 2.0
  • iOS:
    Corona SDK 1.0 (limited)
  • Android:
    Corona SDK 2.0

Replies

maykelsb
User offline. Last seen 6 years 4 weeks ago. Offline
Joined: 5 Apr 2011

Things get a little messy, but here is this topic, there are some info regarding how to handle multi-touch and how things work with multitouch turned on or turned off: http://developer.anscamobile.com/forum/2010/11/07/disable-multitouch

Hope it helps people looking for system.deactive("multitouch");

IceVAN
User offline. Last seen 5 years 15 weeks ago. Offline
Joined: 19 Jan 2011

system.deactivate( "multitouch" )

Hidden system method. I try it and run perfect!!!

Tom
User offline. Last seen 4 years 6 weeks ago. Offline
Joined: 13 Jul 2010

You found an API that we forgot to document. Thanks for bringing it to our attention.