racket-ansi/ansi/test-raw.rkt

29 lines
673 B
Racket
Raw Normal View History

#lang racket/base
2014-12-17 16:54:44 +00:00
(require "private/tty-raw-extension")
2014-12-17 17:01:40 +00:00
(require "main.rkt")
(require racket/set)
(require racket/match)
(define (main)
(tty-raw!)
2011-12-19 21:28:22 +00:00
(plumber-add-flush! (current-plumber)
(lambda (handle)
(display (reset-mode x11-any-event-mouse-tracking-mode))))
2011-12-19 21:28:22 +00:00
(for-each display (list (set-mode x11-any-event-mouse-tracking-mode)))
2014-12-17 17:01:40 +00:00
(display "Type keys. Press control-D to exit.\r\n")
(let loop ()
2014-12-17 17:01:40 +00:00
(flush-output)
(match (lex-lcd-input (current-input-port))
[(? eof-object?) (void)]
[(== (key #\D (set 'control))) (void)]
[key
(printf "Key: ~v\r\n" key)
(loop)])))
(main)