Cursor hook: Only when dragging slowly?

I'm trying to have a hook function react to a user-dragged cursor on a graph, while it is being dragged (event "cursormoved", eventCode 7, IP8). However, it seems that the hook is only triggered when the cursor is dragged rather slowly, or dragging is stopped. Is there a way to tune the "response" of the hook?

Is the cursor a free cursor?

I would guess that a normal cursor doesn't generate a cursor moved event until you allow it to latch on to a new point, but a free cursor should be more responsive.

In reply to by johnweeks

Thanks Tony and John for nudging me in the right direction.

I was working with image cursors (should have specified). They don't seem to have the latching behavior as trace cursors do.

 

In any case, my problem could be resolved by a simple DoUpdate. It seems that when I kept dragging too quickly, Igor just got caught up in processing hooks and deferred updating the graphs. It was doing what I wanted all along, but I just couldn't see it.

Ah. Image cursors do have the "latching" behavior- they stick to the middle of an image cell. You must be using free cursors.

Screen updates are suppressed during function execution because drawing the screen can be very slow. DoUpdate forces a screen update even if a function is running. Indeed, if a function runs long, a hook function can cause real trouble. You may wish to try to extract some small subset of what your hook does, deferring heavy computation for some later time. I'm not sure exactly how you might do that, partly because I don't know what your hook function does, but also because you are getting into pretty difficult territory.