diff src/monoize.sml @ 1680:5b2c7b9f6017

Fix fetching of keycodes for key events
author Adam Chlipala <adam@chlipala.net>
date Sun, 15 Jan 2012 14:45:06 -0500
parents a12186d99e4f
children ac141fbb313a
line wrap: on
line diff
--- a/src/monoize.sml	Sat Jan 14 23:02:34 2012 +0400
+++ b/src/monoize.sml	Sun Jan 15 14:45:06 2012 -0500
@@ -3247,11 +3247,11 @@
                                              in
                                                  case x of
                                                      "Onkeyup" =>
-                                                     SOME (strcat [str ("((function(c){addOnKeyUp(d,function(){window.uw_event=window.event;return c();});})(exec("),
+                                                     SOME (strcat [str ("((function(c){addOnKeyUp(d,function(ev){window.uw_event=ev?ev:window.event;return c();});})(exec("),
                                                                    (L'.EJavaScript (L'.Script, e), loc),
                                                                    str ")));"])
                                                    | _ =>
-                                                     SOME (strcat [str ("((function(c){d." ^ lowercaseFirst x ^ "=function(){window.uw_event=window.event;return c();};})(exec("),
+                                                     SOME (strcat [str ("((function(c){d." ^ lowercaseFirst x ^ "=function(ev){window.uw_event=ev?ev:window.event;return c();};})(exec("),
                                                                    (L'.EJavaScript (L'.Script, e), loc),
                                                                    str ")));"])
                                              end