Commits

David Jones committed c886403

foo.

Comments (0)

Files changed (2)

       if k.KeyChar = ' ' then
          f.Close()
       else
+         Application.DoEvents()
          loop ()
    loop ()
    
+#r "System.Drawing.dll"
+
+#load "Shapes.fs"
+#load "SimpleGraphics.fs"
+
+open System.Windows.Forms
+
+let keyDown (f:Form) =
+    f.KeyDown
+    |> Observable.map (fun k ->
+        char k.KeyValue)
+
+    
+let untilSpace (f:Form) =
+    f.KeyDown
+    |> Observable.add (fun k ->
+        if k.KeyValue = int ' ' then
+            f.Close())
+
+    
+let run f =
+    untilSpace f
+    while not f.IsDisposed do
+        Application.DoEvents()
+        
+    
+