comparison tests/mouseEvent.ur @ 1783:5bc4fbf9c0fe

New event records for key and mouse handlers
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 10:02:53 -0400
parents
children
comparison
equal deleted inserted replaced
1782:61c7eb1d3867 1783:5bc4fbf9c0fe
1 val show_mouseButton = mkShow (fn b => case b of
2 Left => "Left"
3 | Middle => "Middle"
4 | Right => "Right")
5
6 fun main () : transaction page = return <xml><body>
7 <button onclick={fn ev => alert ("ScreenX = " ^ show ev.ScreenX
8 ^ "\nScreenY = " ^ show ev.ScreenY
9 ^ "\nClientX = " ^ show ev.ClientX
10 ^ "\nClientY = " ^ show ev.ClientY
11 ^ "\nCtrlKey = " ^ show ev.CtrlKey
12 ^ "\nShiftKey = " ^ show ev.ShiftKey
13 ^ "\nAltKey = " ^ show ev.AltKey
14 ^ "\nMetaKey = " ^ show ev.MetaKey
15 ^ "\nButton = " ^ show ev.Button)}/>
16 </body></xml>