If I draw a shape on a GWT canvas (rectangle, circle, whatever), how can I add a EventListener like MouseClick, MouseOver etc to that drawing?
Canvas canvas = Canvas.createIfSupported();
Context2d context = canvas.getContext2d();
context.beginPath();
context.moveTo(..;
context.lineTo(..);
//...
context.stroke();
context.fill();
How can I detect clicks only on this drawing?
Canvas provides raster graphics and does not know anything about your figures. So you have two options:
Add event listener to the whole canvas and use some function to determine if (x; y) event point belongs to your figure.
Use SVG instead. With SVG you can create vector figures and add listeners to them.