matthew ephraim

Experiments

This is a collection of programming experiments and projects that I want to share with other people. If you find anything useful, feel free to take it and use it.

JavaScript Mouse tracker

In usability studies, programs like Camtasia are used to record a user's on screen activity while they complete a set of computer based tasks. A while ago, I was looking for a program that would allow me to remote record a user's activity on a web page without the user needing to install any special software. When I didn't find anything, I decided to spend a few hours trying to write my own using JavaScript.

Using the MouseMovie.Tracker class you can create a new mouse tracker. Calling the start() method starts the tracker's internal timeline. The tracker stops recording when the stop() method is called. MouseMovie.Animate takes in a timeline and animates the movements recorded in the timeline. MouseMovie.Trace will draw a simple trace of the movements that were made on the screen.

JavaScript
/* Create a new tracker, start it and stop it and then use 
the timeline to animate and trace the mouse path. */
var MyTracker = new MouseMovie.Tracker(); 
MyTracker.start(); 
MyTracker.stop(); 
MouseMovie.Animate({TimeLine : MyTracker.TimeLine});
MouseMovie.Trace(MyTracker.TimeLine);

Currently, there is no way to persist a tracker's data to a database or file, and the tracker will only record data for a single page. When I have time, I plan to expand the tracker into a more complete tool. You can see a demo of the current code here.