changeset 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 3636d0eeb39c
children e8a84494d2c0
files demo/more/versioned1.urp src/monoize.sml
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/demo/more/versioned1.urp	Sat Jan 14 23:02:34 2012 +0400
+++ b/demo/more/versioned1.urp	Sun Jan 15 14:45:06 2012 -0500
@@ -1,4 +1,3 @@
-debug
 library versioned
 database dbname=test
 sql versioned1.sql
--- 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