From e6afc02942ffd4e3738c5a0ac28a14bbbe345ba8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 5 Apr 2013 15:49:21 +0000 Subject: [PATCH] IE doesn't default to giving focus to the puzzle canvas on a mouse click, so manually implement that behaviour. (Without it, it's quite hard to focus the canvas at all in IE.) [originally from svn r9806] --- emccpre.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emccpre.js b/emccpre.js index 430aae4..38d7815 100644 --- a/emccpre.js +++ b/emccpre.js @@ -233,6 +233,12 @@ function initPuzzle() { command(2); }; + // In IE, the canvas doesn't automatically gain focus on a mouse + // click, so make sure it does + onscreen_canvas.addEventListener("mousedown", function(event) { + onscreen_canvas.focus(); + }); + // In our dialog boxes, Return and Escape should be like pressing // OK and Cancel respectively document.addEventListener("keydown", function(event) {