- PikkaCho Kit is a elegant handler for Matlab & PsychToolBox events
- it also supply object-oriended programming wrap over PsychToolBox
- As the picture indicates, the PikkaCho Kit is also a cute and lovely Kit:)
- before initialize the PCRunloop instance, it is recommended to use
Screen('OpenWindow', 0, [0 0 0])
to open a window with PsychToolBox(because PTB may draw the big big yellow triangle to warn you about some sync problems, and that will disturb the time record of PCKit), but you can also explicitly set the PCRunloop.startTime before call the PCRunloop.run method. - use
runloop = PCRunloop(@(obj)endJudger, @()endCallBack);
to initialize a PCRunloop instance, and theendJudger
is a function that return a boolean to indicate whether the runloop is end and theendCallBack
will be called after the runloop is ended. - initialize an event using
event = PCEvent(eventName,@()fireJudger,repeated);
eventName
is used to identify the event, so don't let different event to have the same eventName.fireJudger
is a function that return a boolean to indicate whether the event is fired. Andrepeated
indicate whether the event will be destroyed after fist fire. - then add the event to runloop using
runloop.register(event, @()callback);
thecallback
is a function that will be called when the event's fireJudger return true. - Notice: you can register many callback on the same event by calling
runloop.register()
many times. And PCKit will call the callback one by one when fireJudger returns true, in the order they are registered. Again, Don't let two event have the same eventName! - you can also check out the example in the repo to understand how to use PCKit~
- FixationPoint(cross, oval)
- Oval
- Rectangle
- initialize an object by calling its constructor, like
fixationPoint = PCFixationPoint(w,...
PCdeg2pix(0.5, SCREEN_SIZE_INCH, VIEW_DISTANCE), ...
PCdeg2pix(0.5, SCREEN_SIZE_INCH, VIEW_DISTANCE), ...
PCFixationPointType.oval);
- then call its draw() method, like
fixationPoint.draw();
, it will draw itself at the buffer, which means you need toScreen('Flip', w)
after you draw every object you need