Skip to content

Commit 621ebf6

Browse files
committed
examples/EventWatch: show keyboard presses and handle quit
1 parent 75f0513 commit 621ebf6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/EventWatch.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,9 @@ appLoop = waitEvent >>= go
5151
| keyboardEventKeyMotion keyboardEvent == Pressed &&
5252
keysymKeycode (keyboardEventKeysym keyboardEvent) == KeycodeQ
5353
-> return ()
54+
KeyboardEvent keyboardEvent
55+
| keyboardEventKeyMotion keyboardEvent == Pressed
56+
-> print (keyboardEventKeysym keyboardEvent) >> waitEvent >>= go
57+
QuitEvent
58+
-> return ()
5459
_ -> waitEvent >>= go

0 commit comments

Comments
 (0)