2011-12-19 20:47:58 +00:00
|
|
|
#lang racket/base
|
|
|
|
|
|
|
|
(require "tty-raw-extension")
|
2011-12-19 21:03:45 +00:00
|
|
|
(require "ansi.rkt")
|
2011-12-19 20:47:58 +00:00
|
|
|
|
|
|
|
(define (main)
|
|
|
|
(tty-raw!)
|
|
|
|
(let loop ()
|
|
|
|
(define ch (read-byte))
|
2011-12-19 21:03:45 +00:00
|
|
|
(display (select-graphic-rendition ch))
|
|
|
|
(printf "Byte: ~v" ch)
|
|
|
|
(display (clear-to-eol))
|
|
|
|
(display "\015\012")
|
|
|
|
(display (select-graphic-rendition))
|
2011-12-19 20:47:58 +00:00
|
|
|
;;(flush-output)
|
|
|
|
(if (member ch '(4 8 127)) ;; EOF, C-h, DEL
|
|
|
|
(exit)
|
|
|
|
(loop))))
|
|
|
|
|
|
|
|
(main)
|