<canvas width="600" height="500"></canvas>
<script>
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = 'gray';
pincel.fillRect(0, 0, 600,500);
pincel.fill();
function desenhaBola(evento) {
var shift = evento.shiftKey;
if (shift == true) {
var x = evento.pageX - tela.offsetLeft;
var y = evento.pageY - tela.offsetTop;
pincel.fillStyle = 'blue';
pincel.beginPath();
pincel.arc(x,y,20,0,2*3.314);
pincel.fill();
}else{
var x = evento.pageX - tela.offsetLeft;
var y = evento.pageY - tela.offsetTop;
pincel.fillStyle = 'blue';
pincel.beginPath();
pincel.arc(x,y,10,0,2*3.314);
pincel.fill();
}
}
tela.onclick = desenhaBola;
</script>