Handle click events on a canvas element