TikTok for Developers

Developer Docs

Last updated October 1, 2026

Touch

Exposes device-level hardware interactions for touch events.

TTMinis.game.onTouchStart(listener)

Registers a listener for touch start events.

Parameters

Field

Type

Description

Required

listener

function

The listener function for touch start events. Called with a response object.

Yes

Response object

Field

Type

Description

touches

list<object>

The list of Touch objects for all current touch points

changedTouches

list<object>

The list of Touch objects that triggered this event

timeStamp

int64

The timestamp when the event was triggered

Example

const listener = function (res) {
  console.log("Touch start:", res.touches);
};

TTMinis.game.onTouchStart(listener);

TTMinis.game.onTouchMove(listener)

Registers a listener for touch move events.

Parameters

Field

Type

Description

Required

listener

function

The listener function for touch move events. Called with a response object.

Yes

Response object

Field

Type

Description

touches

list<object>

The list of Touch objects for all current touch points

changedTouches

list<object>

The list of Touch objects that triggered this event

timeStamp

int64

The timestamp when the event was triggered

Example

const listener = function (res) {
  console.log("Touch move:", res.touches);
};

TTMinis.game.onTouchMove(listener);

TTMinis.game.onTouchEnd(listener)

Registers a listener for touch end events.

Parameters

Field

Type

Description

Required

listener

function

The listener function for touch end events. Called with a response object.

Yes

Response object

Field

Type

Description

touches

list<object>

The list of Touch objects for all current touch points

changedTouches

list<object>

The list of Touch objects that triggered this event

timeStamp

int64

The timestamp when the event was triggered

Example

const listener = function (res) {
  console.log("Touch end:", res.touches);
};

TTMinis.game.onTouchEnd(listener);

TTMinis.game.onTouchCancel(listener)

Registers a listener for touch cancel events.

Parameters

Field

Type

Description

Required

listener

function

The listener function for touch cancel events. Called with a response object.

Yes

Response object

Field

Type

Description

touches

list<object>

The list of Touch objects for all current touch points

changedTouches

list<object>

The list of Touch objects that triggered this event

timeStamp

int64

The timestamp when the event was triggered

Example

const listener = function (res) {
  console.log("Touch cancel:", res.touches);
};

TTMinis.game.onTouchCancel(listener);

TTMinis.game.offTouchStart(listener)

Removes the listener for touch start events.

Parameters

Field

Type

Description

Required

listener

function

The listener function passed to onTouchStart. If not provided, all listeners are removed. Must be the same function object used during registration.

No

Example

const listener = function (res) {
  console.log(res);
};

TTMinis.game.onTouchStart(listener);
TTMinis.game.offTouchStart(listener); // Must pass the same function object used during registration

TTMinis.game.offTouchMove(listener)

Removes the listener for touch move events.

Parameters

Field

Type

Description

Required

listener

function

The listener function passed to onTouchMove. If not provided, all listeners are removed. Must be the same function object used during registration.

No

Example

const listener = function (res) {
  console.log(res);
};

TTMinis.game.onTouchMove(listener);
TTMinis.game.offTouchMove(listener); // Must pass the same function object used during registration

TTMinis.game.offTouchEnd(listener)

Removes the listener for touch end events.

Parameters

Field

Type

Description

Required

listener

function

The listener function passed to onTouchEnd. If not provided, all listeners are removed. Must be the same function object used during registration.

No

Example

const listener = function (res) {
  console.log(res);
};

TTMinis.game.onTouchEnd(listener);
TTMinis.game.offTouchEnd(listener); // Must pass the same function object used during registration

TTMinis.game.offTouchCancel(listener)

Removes the listener for touch cancel events.

Parameters

Field

Type

Description

Required

listener

function

The listener function passed to onTouchCancel. If not provided, all listeners are removed. Must be the same function object used during registration.

No

Example

const listener = function (res) {
  console.log(res);
};

TTMinis.game.onTouchCancel(listener);
TTMinis.game.offTouchCancel(listener); // Must pass the same function object used during registration
TikTok for Developers