Read mouse positions (in an xterm)

This commit is contained in:
Tony Garnock-Jones 2011-12-19 16:28:22 -05:00
parent 3a5b457c7c
commit 33cca087ad
1 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,15 @@
(define (main)
(tty-raw!)
(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)
(let loop ()
(define ch (read-byte))
(display (select-graphic-rendition ch))