title: Capturing mouse actions
body: <p>First, some background:</p>
  
  <p>I need to develop a web app that will in background collect all mouse actions by a user (during a visit to a web page), store them in appropriate format in a file, and than have a separate replay app that will be fed with that file, and will produce something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/RbMje.jpg" alt="enter image description here"></p>
  
  <p>Curves are mouse movements, circles are either clicks or staying stationary.</p>
  
  <p>I have more or less solution for replay app.</p>
  
  <p><em>I need a solution that captures user mouse actions and saves it in a file on server.</em> </p>
  
  <p>For each user there should be separate file. Format of the file is not predetermined, but following would be reasonable:</p>
  
  <pre><code>&lt;timestamp1&gt; MOVE TO &lt;x1&gt;, &lt;y1&gt;
  &lt;timestamp2&gt; MOVE TO &lt;x2&gt;, &lt;y2&gt;
  &lt;timestamp3&gt; MOVE TO &lt;x3&gt;, &lt;y3&gt;
  &lt;timestamp4&gt; CLICK
  &lt;timestamp5&gt; RIGHT-CLICK
  &lt;timestamp6&gt; MOVE TO &lt;x6&gt;, &lt;y6&gt;
  &lt;timestamp7&gt; MOVE TO &lt;x7&gt;, &lt;y7&gt;
  </code></pre>
  
  <p>I wonder if you could help me on approach how to design and implement such mouse action capture. All best.</p>