[comp.sys.mac.hypercard] Event Tracking in HyperCard

IRV.KANODE@f53.n114.z1.fidonet.org (IRV KANODE) (03/29/90)

In an article on 3/28/90    pevans@umd5.umd.edu writes:
        
>We are currently investigating different ways of capturing data while
>people are using HyperCard stacks.  Ideally we would like to capture
>everything that happens i.e.  key strokes and mouseclicks and store
>this with a time stamp.
        
The exact scripting you need depends upon your HyperCard stack.  However,
it is easy to do about 80% of what you probably need done.  Following are
simple scripts to track various events.  The event tracking field is a bg
field named "Events".   Timing is done in "ticks" (1/60 second).  Create a 
stack with a card field named "Text", a background field named "Events",
and a button (name doesn't matter).  Put the following scripts in the Text 
field, the button, and the stack.
        
        
---Track Mouse in Field, and Changes to a Fields Contents
         (The field is named "Text" and this is the field script.)
        
on mouseEnter
    global StartingTicksVariable, FldOneVariable
    put the ticks into StartingTicksVariable
    put cd fld Text into FldOneVariable
end mouseEnter
        
on MouseLeave
    global StartingTicksVariable, FldOneVariable
    put the ticks into EndingTicksVariable
    put the short name of me & " " after bg fld Events
    --identify field
    put EndingTicksVariable - StartingTicksVariable after bg fld Events
    --Log the number of ticks the mouse was in the field
    If cd fld Text  FldOneVariable then
        --If the field was changed, log the new contents
        put " " & cd fld Text & RETURN after bg fld Events
    else
        put RETURN after bg fld Events
    end if
end mouseLeave
===================================
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!53!IRV.KANODE
Internet: IRV.KANODE@f53.n114.z1.fidonet.org