TouchTriggerBase

class TouchTriggerBase[source]

Bases: object

Base class for defining custom touch trigger behavior.

Override this class to implement specific actions when a touch event is received on the touchscreen.

You have access to self.task, so any variable or function defined in the task can be used to specify the actions to perform.

__init__() None[source]

Initializes the TouchTriggerBase instance.

Methods

trigger(x: int, y: int, timestamp: float) None[source]

Called whenever a touch event passes the debounce interval.

Parameters:
  • x (int) – Touch x position in screen pixels.

  • y (int) – Touch y position in screen pixels.

  • timestamp (float) – Monotonic timestamp of the touch event (seconds).