- A wall with no boards or furniture before it would be ideal.
- Point the webcam at the wall at such a distance that ideally all of the wall is covered by the webcam image.
- Have a program read the video stream from the camera and do the analytics to recognize clicks, double clicks, positioning and maybe even gestures.
Reading of a video stream and fetching the frames from that would be pretty much straight forward and maybe can be found here:
Versatile WebCam C# library[
^]. Since laser pointers are rather bright and mostly have a distinctive color fetching the position of the laser dot on the frame should also pose no problem. If your laserpointer has a button with which it can be turned on and off you could easily emulate the mouse with that. Turning the laser off for a certain TBD amount of time would be registered as a click and the same goes for the double click. The click as well as the double click should be triggered when the laser finally comes back on.
This article might also serve you well:
Real-Time Object Tracker in C++[
^] by
Chesnokov Yuriy[
^]
Best Regards,
—MRB