summaryrefslogtreecommitdiff
path: root/tests/mouseEvent.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-07-21 10:02:53 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-07-21 10:02:53 -0400
commit3e838a5bf95222adb9add226aa3732c3c28633bc (patch)
treeb3a11523df44e927ac749c5c6aa752744cb83b5d /tests/mouseEvent.ur
parentdb71493ffd90e2668259efbb549f7a781c2530db (diff)
New event records for key and mouse handlers
Diffstat (limited to 'tests/mouseEvent.ur')
-rw-r--r--tests/mouseEvent.ur16
1 files changed, 16 insertions, 0 deletions
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>