Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
894:a3f58978ff32 | 895:ae9e22822ec5 |
---|---|
5 <button onblur={set s "Blur 2"} onfocus={set s "Focus 2"} onclick={set s "Click 2"}/> | 5 <button onblur={set s "Blur 2"} onfocus={set s "Focus 2"} onclick={set s "Click 2"}/> |
6 <span onclick={set s "Click"} ondblclick={set s "Double-click"}>SPAN</span> | 6 <span onclick={set s "Click"} ondblclick={set s "Double-click"}>SPAN</span> |
7 <span onmousedown={set s "Mouse down"} onmouseup={set s "Mouse up"}>SPAN</span> | 7 <span onmousedown={set s "Mouse down"} onmouseup={set s "Mouse up"}>SPAN</span> |
8 <span onmouseout={set s "Mouse out"} onmouseover={set s "Mouse over"}>SPAN</span> | 8 <span onmouseout={set s "Mouse out"} onmouseover={set s "Mouse over"}>SPAN</span> |
9 <span onmousemove={set s "Mouse move"}>SPAN</span> | 9 <span onmousemove={set s "Mouse move"}>SPAN</span> |
10 <button onkeydown={set s "Key down"} onkeyup={set s "Key up"}/> | 10 <button onkeydown={fn k => set s ("Key down: " ^ show k)} onkeyup={fn _ => set s "Key up"}/> |
11 <button onkeypress={set s "Key press"}/> | 11 <button onkeypress={fn _ => set s "Key press"}/> |
12 <br/> | 12 <br/> |
13 <br/> | 13 <br/> |
14 | 14 |
15 <dyn signal={s <- signal s; return <xml>{[s]}</xml>}/> | 15 <dyn signal={s <- signal s; return <xml>{[s]}</xml>}/> |
16 </body></xml> | 16 </body></xml> |