Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
|
Manages touch screens (wraps the PTB TouchQueue* functions), and provides touch area management methods. More...
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
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 | |
touchManager::touchManager | ( | in | varargin | ) |
Class constructor.
Initialises the class sending any parameters to parseArgs.
varargin | are passed as a structure of properties which is parsed. |
|
protected |
function touchManager::checkTouchWindows | ( | in | me, |
in | windows, | ||
in | panelType | ||
) |
touchManager::close | ( | in | me | ) |
choice | which touch device to use, default uses me.device |
touchManager::createQueue | ( | in | me | ) |
choice | which touch device to use, default uses me.device |
touchManager::demo | ( | in | me, |
in | useaudio | ||
) |
return
touchManager::eventAvail | ( | in | me | ) |
return nAvail number of available events
touchManager::flush | ( | in | me | ) |
return
touchManager::getEvent | ( | in | me | ) |
return event structure
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.
return
touchManager::reset | ( | in | me | ) |
return
touchManager::setup | ( | in | me, |
in | sM | ||
) |
touchManager::start | ( | in | me | ) |
touchManager::stop | ( | in | me | ) |
touchManager::testHold | ( | in | me, |
in | yesString, | ||
in | noString | ||
) |
return
touchManager::testHoldRelease | ( | in | me, |
in | yesString, | ||
in | noString | ||
) |
return
Property touchManager::device |
which touch device to connect to?
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...
Property touchManager::exclusionZone |
Use exclusion zones where no touch allowed: [left,top,right,bottom] Add rows to generate multiple exclusion zones.
Property touchManager::isDummy |
use the mouse instead of the touch screen for debugging
Property touchManager::nSlots |
number of slots for touch events
Property touchManager::panelType |
panel type, 1 = front, 2 = back aka reverse X position
Property touchManager::verbose |
verbosity
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