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!)
|
2011-12-19 21:28:22 +00:00
|
|
|
|
|
|
|
(define old-exit-handler (exit-handler))
|
|
|
|
(exit-handler (lambda (v)
|
|
|
|
(display (reset-mode x11-any-event-mouse-tracking-mode))
|
|
|
|
(old-exit-handler v)))
|
|
|
|
|
|
|
|
(for-each display (list (set-mode x11-any-event-mouse-tracking-mode)))
|
|
|
|
(flush-output)
|
|
|
|
|
2011-12-19 20:47:58 +00:00
|
|
|
(let loop ()
|
|
|
|
(define ch (read-byte))
|
2011-12-19 21:03:45 +00:00
|
|
|
(display (select-graphic-rendition ch))
|
|
|
|
(display (clear-to-eol))
|
2011-12-19 21:08:01 +00:00
|
|
|
(printf "Byte: ~v\015\012" ch)
|
2011-12-19 21:03:45 +00:00
|
|
|
(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)
|