Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
touchManager Class Reference

Manages touch screens (wraps the PTB TouchQueue* functions), and provides touch area management methods. More...

Detailed Description

Manages touch screens (wraps the PTB TouchQueue* functions), and provides touch area management methods.

TOUCHMANAGER – call this and setup with screen manager, then run your task. This class can handles touch windows, exclusion zones and more for multiple touch screens.

Copyright ©2014-2024 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for touchManager:

Public Member Functions

function touchManager (in varargin)
 Class constructor.
 
function setup (in me, in sM)
 
function createQueue (in me)
 
function start (in me)
 
function stop (in me)
 
function close (in me)
 
function flush (in me)
 
function eventAvail (in me)
 
function getEvent (in me)
 
function reset (in me)
 
function checkTouchWindows (in me, in windows, in panelType)
 
function isHold (in me)
 
function testHold (in me, in yesString, in noString)
 
function testHoldRelease (in me, in yesString, in noString)
 
function demo (in me, in useaudio)
 
- Public Member Functions inherited from optickaCore
function optickaCore (in varargin)
 Class constructor.
 
function get fullName (in me)
 
function getALF (in me, in subject, in sessionPrefix, in lab, in create)
 
function findAttributes (in me, in attrName, in attrValue)
 
function findAttributesandType (in me, in attrName, in attrValue, in type)
 find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
 
function findPropertyDefault (in me, in propName)
 
function clone (in me)
 Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
 
function checkSuperclasses (in List)
 
function editProperties (in me, in properties)
 method to modify a set of properties
 
function setProp (in me, in property, in value)
 method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
 
function initialiseGlobals (in me, in doReset, in doOpen)
 
function initialiseSaveFile (in me)
 Initialise Save prefix.
 
function checkPaths (in me)
 checks the paths are valid
 

Public Attributes

Property device
 which touch device to connect to?
 
Property isDummy
 use the mouse instead of the touch screen for debugging
 
Property window
 
Property exclusionZone
 
Property drainEvents
 
Property panelType
 panel type, 1 = front, 2 = back aka reverse X position
 
Property verbose
 verbosity
 
Property nSlots
 number of slots for touch events
 
- Public Attributes inherited from optickaCore
Property name
 object name
 
Property comment
 comment
 
Property verbose
 verbose logging, subclasses must assign this. This is normally logical true/false
 
Property dateStamp
 clock() dateStamp set on construction
 
Property uuid
 universal ID
 
Property paths
 storage of various paths
 
Property fullName
 The fullName is the object name combined with its uuid and class name.
 

Protected Member Functions

function calculateWindow (in me, in x, in y, in tempWindow)
 
- Protected Member Functions inherited from optickaCore
function parseArgs (in me, in args, in allowedProperties)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function addArgs (in me, in args)
 
function setPaths (in me)
 Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
 
function getFonts (in me)
 set paths for object
 
function toStructure (in me)
 Converts properties to a structure.
 
function getType (in me, in in)
 
function logOutput (in me, in in, in message, in override)
 Give a metaproperty return the likely property class.
 
function salutation (in me, in varargin)
 Prints messages dependent on verbosity.
 

Additional Inherited Members

- Static Public Member Functions inherited from optickaCore
static function makeArgs (in args)
 Converts cell args to structure array.
 
static function addDefaults (in args, in defs)
 add default options to arg input
 
static function hasKey (in in, in key)
 check if a struct / object has a propery / field
 
static function getKeys (in device)
 PTB Get key presses, stops key bouncing.
 
- Protected Attributes inherited from optickaCore
Property cloning
 are we cloning this from another object
 
Property mversion
 Matlab version number, this is transient so it is not saved.
 
Property sansFont
 sans font
 
Property monoFont
 monoFont
 
Property className
 class name
 
Property savePrefix
 save prefix generated from clock time
 
Property fullName_
 cached full name
 

Constructor & Destructor Documentation

◆ touchManager()

touchManager::touchManager ( in  varargin)

Class constructor.

Initialises the class sending any parameters to parseArgs.

Parameters
vararginare passed as a structure of properties which is parsed.
Returns
instance of the class.

Member Function Documentation

◆ calculateWindow()

function touchManager::calculateWindow ( in  me,
in  x,
in  y,
in  tempWindow 
)
protected

◆ checkTouchWindows()

function touchManager::checkTouchWindows ( in  me,
in  windows,
in  panelType 
)

◆ close()

touchManager::close ( in  me)
Parameters
choicewhich touch device to use, default uses me.device
Returns

◆ createQueue()

touchManager::createQueue ( in  me)
Parameters
choicewhich touch device to use, default uses me.device
Returns

◆ demo()

touchManager::demo ( in  me,
in  useaudio 
)
Parameters

return

◆ eventAvail()

touchManager::eventAvail ( in  me)
Parameters

return nAvail number of available events

◆ flush()

touchManager::flush ( in  me)
Parameters

return

◆ getEvent()

touchManager::getEvent ( in  me)
Parameters

return event structure

◆ isHold()

touchManager::isHold ( in  me)

This is the main function which runs touch timers and calculates the logic of whether the touch is in a region and for how long.

Parameters

return

◆ reset()

touchManager::reset ( in  me)
Parameters

return

◆ setup()

touchManager::setup ( in  me,
in  sM 
)
Parameters
sMscreenManager to use
Returns
Parameters

return

◆ start()

touchManager::start ( in  me)
Returns

◆ stop()

touchManager::stop ( in  me)
Returns

◆ testHold()

touchManager::testHold ( in  me,
in  yesString,
in  noString 
)
Parameters

return

◆ testHoldRelease()

touchManager::testHoldRelease ( in  me,
in  yesString,
in  noString 
)
Parameters

return

Member Data Documentation

◆ device

Property touchManager::device

which touch device to connect to?

◆ drainEvents

Property touchManager::drainEvents

drain the events to only get the last one? This ensures lots of events don't pile up, often you only want the current event, but potentially causes a longer delay each time getEvent is called...

◆ exclusionZone

Property touchManager::exclusionZone

Use exclusion zones where no touch allowed: [left,top,right,bottom] Add rows to generate multiple exclusion zones.

◆ isDummy

Property touchManager::isDummy

use the mouse instead of the touch screen for debugging

◆ nSlots

Property touchManager::nSlots

number of slots for touch events

◆ panelType

Property touchManager::panelType

panel type, 1 = front, 2 = back aka reverse X position

◆ verbose

Property touchManager::verbose

verbosity

◆ window

Property touchManager::window

window is a touch window, X and Y are the screen postion radius: circular when radius is 1 value, rectangular when radius = [width height]) doNegation: allows to return -100 (like exclusion) if touch is outside window. when using the testHold etc functions. negationBuffer is an area around he window to allow some margin of error... init: a timer that measures time to first touch hold: a timer that determines how long to hold release: a timer to determine the time after hold in which to release the window


The documentation for this class was generated from the following file: