# HG changeset patch # User Adam Chlipala # Date 1343047119 14400 # Node ID 2f8b8952fe27bb19b35ab8592cc531abdcec1ddd # Parent 56b8efff64e7eacd2116d5a2957cea8d3ad3534c Add more global mouse event hooks diff -r 56b8efff64e7 -r 2f8b8952fe27 lib/js/urweb.js --- a/lib/js/urweb.js Sun Jul 22 09:42:17 2012 -0400 +++ b/lib/js/urweb.js Mon Jul 23 08:38:39 2012 -0400 @@ -504,6 +504,18 @@ uw_handler("onmousedown", f); } +function uw_onMousemove(f) { + uw_handler("onmousemove", f); +} + +function uw_onMouseout(f) { + uw_handler("onmouseout", f); +} + +function uw_onMouseover(f) { + uw_handler("onmouseover", f); +} + function uw_onMouseup(f) { uw_handler("onmouseup", f); } diff -r 56b8efff64e7 -r 2f8b8952fe27 lib/ur/basis.urs --- a/lib/ur/basis.urs Sun Jul 22 09:42:17 2012 -0400 +++ b/lib/ur/basis.urs Mon Jul 23 08:38:39 2012 -0400 @@ -981,6 +981,9 @@ val onKeypress : (keyEvent -> transaction unit) -> transaction unit val onKeyup : (keyEvent -> transaction unit) -> transaction unit val onMousedown : (mouseEvent -> transaction unit) -> transaction unit +val onMousemove : (mouseEvent -> transaction unit) -> transaction unit +val onMouseout : (mouseEvent -> transaction unit) -> transaction unit +val onMouseover : (mouseEvent -> transaction unit) -> transaction unit val onMouseup : (mouseEvent -> transaction unit) -> transaction unit (* Prevents default handling of current event *) diff -r 56b8efff64e7 -r 2f8b8952fe27 src/settings.sml --- a/src/settings.sml Sun Jul 22 09:42:17 2012 -0400 +++ b/src/settings.sml Mon Jul 23 08:38:39 2012 -0400 @@ -174,6 +174,9 @@ "onKeypress", "onKeyup", "onMousedown", + "onMousemove", + "onMouseout", + "onMouseover", "onMouseup", "preventDefault", "stopPropagation", @@ -204,6 +207,9 @@ "onKeypress", "onKeyup", "onMousedown", + "onMousemove", + "onMouseout", + "onMouseover", "onMouseup", "preventDefault", "stopPropagation", @@ -320,6 +326,9 @@ ("onKeypress", "uw_onKeypress"), ("onKeyup", "uw_onKeyup"), ("onMousedown", "uw_onMousedown"), + ("onMousemove", "uw_onMousemove"), + ("onMouseout", "uw_onMouseout"), + ("onMouseover", "uw_onMouseover"), ("onMouseup", "uw_onMouseup"), ("preventDefault", "uw_preventDefault"), ("stopPropagation", "uw_stopPropagation"), diff -r 56b8efff64e7 -r 2f8b8952fe27 tests/globalHandlers.ur --- a/tests/globalHandlers.ur Sun Jul 22 09:42:17 2012 -0400 +++ b/tests/globalHandlers.ur Mon Jul 23 08:38:39 2012 -0400 @@ -2,3 +2,9 @@ alert ("ScreenX = " ^ show ev.ScreenX ^ "\nShiftKey = " ^ show ev.ShiftKey)); onKeypress (fn ev => alert ("KeyCode = " ^ show ev.KeyCode ^ "\nShiftKey = " ^ show ev.ShiftKey))}/> + +fun busy () : transaction page = return + alert "OUT!"); + onMouseover (fn _ => alert "OVER!"); + onMousemove (fn _ => alert "MOVE!")}/> +