FingerLiftedValidator class

Validate that finger is not lifted in mid-trial.

Using this validator

Note that unlike other validators, this one does not have a update_xyt() function (i.e., you do not notify it continuously about the finger position). Instead, it has an update_touching() function, which you use to continuously notify the validator whether the finger is touching the screen.

The validator can suffer short finger-off-screen durations without issuing an error (see max_offscreen_duration). This is useful, for example, when using touchpads with inaccurate touch detection: such devices may occasionally lose the touch information and report that the finger is not touching the screen.

Methods and properties:

class trajtracker.validators.FingerLiftedValidator(enabled=True, max_offscreen_duration=0)
__init__(enabled=True, max_offscreen_duration=0)

Constructor

Parameters:
disable_event

The event on which the object should be disabled. This will work only when the object is registered to an EventManager

Type:Event
enable_event

The event on which the object should be enabled. This will work only when the object is registered to an EventManager

Type:Event
enabled

Whether the object is currently functioning or disabled

Type:bool
log_level

Logging level of this object: trajtracker.log_none, log_error (default), log_warn, log_info, log_debug, log_trace

max_offscreen_duration

The maximal duration (in seconds) that the finger is allowed to remain off-screen in mid trial.

Type:number
reset(time=None)

Called when a trial starts - reset any previous movement

update_touching(touching, time_in_trial, time_in_session)

Validate movement.

Parameters:
  • touching (bool) – Whether the finger is currently touching the screen (or mouse is clicked)
  • time_in_trial – Time from start of trial
  • time_in_session – Time from start of session
Returns:

None if all OK; ExperimentError object if error