Hotspot class¶
This defines a touch-sensitive area on screen, that invokes certain operations when touched.
The area can be also configured to invoke the operation only if touched for a certain period of time.
The invoked operation can be a function to call, an event to dispatch, or both.
Methods and properties:¶
-
class
trajtracker.movement.
Hotspot
(event_manager=None, area=None, min_touch_duration=0, on_touched_dispatch_event=None, on_touched_callback=None, enabled=True, name='')¶ -
__init__
(event_manager=None, area=None, min_touch_duration=0, on_touched_dispatch_event=None, on_touched_callback=None, enabled=True, name='')¶
-
area
¶ The area that should be touched
Type: Any shape - from expyriment, or from trajtracker, or any other class with an overlapping_with_position() method
-
enabled
¶ Whether the hotspot is currently enabled (active) or not. Default = True.
-
log_level
¶ Logging level of this object: trajtracker.log_none, log_error (default), log_warn, log_info, log_debug, log_trace
-
min_touch_duration
¶ The area will be considered as touched only when touched for at least this time :type: float (seconds)
-
on_touched_callback
¶ A function to call when the hotspot is touched.
The function should expect time_in_trial as a single argument.
-
on_touched_dispatch_event
¶ An event to dispatch when the hotspot is touched.
To use this, you must set event_manager in the constructor
Type: str
-
touched
¶ Indicates whether the hotspot was touched during this trial (any time after reset() was called) :return: bool
-
update_xyt
(position, time_in_trial, time_in_session=None)¶ Parameters: - position –
- time_in_trial –
- time_in_session – used only when working with an event manager (for dispatching an event)
Returns:
-