This commit is contained in:
Tony Garnock-Jones 2016-09-11 22:12:56 -04:00
parent 863c1a7db9
commit 9a80ddfa83
1 changed files with 21 additions and 13 deletions

View File

@ -196,18 +196,26 @@
(require racket/set) (require racket/set)
(require "display-terminal.rkt") (require "display-terminal.rkt")
(define tty (default-tty)) (let ()
(define tty (default-tty))
(tty-display tty "Ho ho ho\r\n") (tty-display tty "Ho ho ho\r\n")
(let loop () (define R (glue-tbox 10 5 ":" (pen color-white color-red #f #f)))
(tty-flush tty) (define G (glue-tbox 10 5 ":" (pen color-white color-green #f #f)))
(sync (handle-evt (tty-next-key-evt tty) (define B (glue-tbox 10 5 ":" (pen color-white color-blue #f #f)))
(lambda (k)
(match k (tbox-render! B 'uhhh tty 0 0 (tty-columns tty) (tty-rows tty))
[(key #\q (== (set))) (void)] (tty-goto tty 0 0)
[_
(tty-clear-to-eol tty) (let loop ()
(tty-display tty (format "~v" k)) (tty-flush tty)
(tty-goto tty (tty-cursor-row tty) 0) (sync (handle-evt (tty-next-key-evt tty)
(loop)])))))) (lambda (k)
(match k
[(key #\q (== (set))) (void)]
[_
(tty-clear-to-eol tty)
(tty-display tty (format "~v" k))
(tty-goto tty (tty-cursor-row tty) 0)
(loop)])))))))