summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/globalHandlers.ur4
-rw-r--r--tests/keyEvent.ur7
-rw-r--r--tests/mouseEvent.ur16
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/globalHandlers.ur b/tests/globalHandlers.ur
new file mode 100644
index 00000000..2b4fba7b
--- /dev/null
+++ b/tests/globalHandlers.ur
@@ -0,0 +1,4 @@
+fun main () : transaction page = return <xml>
+ <body onload={onDblclick (fn ev => alert ("ScreenX = " ^ show ev.ScreenX ^ "\nShiftKey = " ^ show ev.ShiftKey));
+ onKeypress (fn ev => alert ("KeyCode = " ^ show ev.KeyCode ^ "\nShiftKey = " ^ show ev.ShiftKey))}/>
+</xml>
diff --git a/tests/keyEvent.ur b/tests/keyEvent.ur
new file mode 100644
index 00000000..875e2b68
--- /dev/null
+++ b/tests/keyEvent.ur
@@ -0,0 +1,7 @@
+fun main () : transaction page = return <xml><body>
+ <ctextbox onkeypress={fn ev => alert ("KeyCode = " ^ show ev.KeyCode
+ ^ "\nCtrlKey = " ^ show ev.CtrlKey
+ ^ "\nShiftKey = " ^ show ev.ShiftKey
+ ^ "\nAltKey = " ^ show ev.AltKey
+ ^ "\nMetaKey = " ^ show ev.MetaKey)}/>
+</body></xml>
diff --git a/tests/mouseEvent.ur b/tests/mouseEvent.ur
new file mode 100644
index 00000000..2192e0b0
--- /dev/null
+++ b/tests/mouseEvent.ur
@@ -0,0 +1,16 @@
+val show_mouseButton = mkShow (fn b => case b of
+ Left => "Left"
+ | Middle => "Middle"
+ | Right => "Right")
+
+fun main () : transaction page = return <xml><body>
+ <button onclick={fn ev => alert ("ScreenX = " ^ show ev.ScreenX
+ ^ "\nScreenY = " ^ show ev.ScreenY
+ ^ "\nClientX = " ^ show ev.ClientX
+ ^ "\nClientY = " ^ show ev.ClientY
+ ^ "\nCtrlKey = " ^ show ev.CtrlKey
+ ^ "\nShiftKey = " ^ show ev.ShiftKey
+ ^ "\nAltKey = " ^ show ev.AltKey
+ ^ "\nMetaKey = " ^ show ev.MetaKey
+ ^ "\nButton = " ^ show ev.Button)}/>
+</body></xml>