Demo fancy output and raw input at the same time
This commit is contained in:
parent
c3d9c0d6ad
commit
b1f22df932
|
@ -1,12 +1,17 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "tty-raw-extension")
|
||||
(require "ansi.rkt")
|
||||
|
||||
(define (main)
|
||||
(tty-raw!)
|
||||
(let loop ()
|
||||
(define ch (read-byte))
|
||||
(printf "Byte: ~v\015\012" ch)
|
||||
(display (select-graphic-rendition ch))
|
||||
(printf "Byte: ~v" ch)
|
||||
(display (clear-to-eol))
|
||||
(display "\015\012")
|
||||
(display (select-graphic-rendition))
|
||||
;;(flush-output)
|
||||
(if (member ch '(4 8 127)) ;; EOF, C-h, DEL
|
||||
(exit)
|
||||
|
|
Loading…
Reference in New Issue