The system is very simple.
The current prototype pointer uses a small LED and battery, it has a switch that turns the LED on when the pointer is squeezed.
When the LED is switched off (or is not detected by the camera) the recorded movements are moved to the left and a new drawing point will start the next time the light is detected.
Code is heavily based on the tracking.js library - see: https://trackingjs.com/ and is based off one of their example applications.
A video of how it works (at this point):
Hi Lee.
Thanks for your comments.
I actually have another project that I wrote that provides a maths interface and a diagram drawing application along the lines you suggest.
I should put it up on the Hackaday site but have never got round to it.
It uses mathjax https://www.mathjax.org/ javascript stuff to do the equation and symbol display bits and relies on simple (one finger) keystrokes to drive both the maths and diagram drawing interface.
It was initially meant to be the display component for the light pen idea here but it turned out to work better for the intended user with just a keyboard interface. It initially used a trained neural net to get input from things like the Light Pen but that has since been disabled because as mentioned - for the intended user the keyboard input worked better.
By mapping symbols to widely spaced keyboard letters I avoid the need for 2 key inputs or close accuracy of hitting keys (eg shift = for the minus symbol is replaced by 'p' for plus etc) and it also provides the ability to draw diagrams without using a mouse but by steering "to and from" cursors with keys.
The code for the application is at https://github.com/jonkster/mathscribe
cheers
Jon