minor beautification of keyhandling

This commit is contained in:
Knut Forkalsrud 2010-02-13 12:34:11 -08:00
parent 4622a67f9e
commit fd8a5a2ce1

View file

@ -6,7 +6,7 @@ var ctx;
var locationx;
var locationy;
var autoscale = false;
var radius = 1; // the radius of the circle whe put the photo inside
var radius = 1; // the radius of the circle where put the photo inside
var zoomfactor = 1;
var baseCoordZoom;
var trX = 0;
@ -100,8 +100,7 @@ function mouseWheel(event) {
mouseMove(event);
}
document.onkeydown = function(event) {
function keyhandler(event) {
var keyCode;
var doDraw = false;
@ -127,5 +126,8 @@ document.onkeydown = function(event) {
if (doDraw) {
draw();
}
}
}
document.onkeypress = keyhandler;
document.onkeydown = keyhandler;