MCL event timing

Michael Schoelles mikejs at cs.gmu.edu
Thu Apr 24 12:28:47 EDT 1997


To ACT-R users:

Subject: Timing of mouse clicks in MCL

  In MCL it is possible to time mouse clicks with an accuracy in the
17 - 20 ms range.  The *current-event* variable is bound by the MCL
routine event-dispatch after its call to #_WaitNextEvent. *current-event* 
holds the event record to be processed, and is valid only during the 
event processing. The event record for a mouse click contains a four-byte 
field named "when".  The "when" field of the event record contains the 
time the event was posted to the event queue by the MAC OS. This time is 
expressed as the number of ticks system startup. One tick represents 
16.6ms (60 ticks per seconds).

 The statement:
    (pref *current-event* :EventRecord.when)

will return the value described above.  By placing this instruction in a
view-click-event-handler the time of the click is obtained no matter how
long after the actual click the view-click-event-handler executes
(because the event record has been sitting on the event queue).  The
accuracy is also subject to the variability in the time from the actual
hardware interrupt til the event is posted on the event queue (however
this should be small compared to the tick interval. I don't know the 
details of this timing.)


Mike Schoelles









More information about the ACT-R-users mailing list