Conclusion

In this tutorial, we just covered the basics of working with the mouse. If there is anything you take out of this, the section on getting the correct mouse position is the one you should keep in mind. It isn’t obvious that your clientX and clientY properties aren’t entirely adequate for getting your mouse position, and the solution for that isn’t very obvious either. Now that you know about this issue, though, you can safely avoid it without running into any sort of problems!