Mercurial > urweb
diff tests/event.ur @ 895:ae9e22822ec5
Key events get key code input
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 18 Jul 2009 12:53:26 -0400 |
parents | a3f58978ff32 |
children |
line wrap: on
line diff
--- a/tests/event.ur Sat Jul 18 12:37:19 2009 -0400 +++ b/tests/event.ur Sat Jul 18 12:53:26 2009 -0400 @@ -7,8 +7,8 @@ <span onmousedown={set s "Mouse down"} onmouseup={set s "Mouse up"}>SPAN</span> <span onmouseout={set s "Mouse out"} onmouseover={set s "Mouse over"}>SPAN</span> <span onmousemove={set s "Mouse move"}>SPAN</span> - <button onkeydown={set s "Key down"} onkeyup={set s "Key up"}/> - <button onkeypress={set s "Key press"}/> + <button onkeydown={fn k => set s ("Key down: " ^ show k)} onkeyup={fn _ => set s "Key up"}/> + <button onkeypress={fn _ => set s "Key press"}/> <br/> <br/>