Tweak guard; small demo
This commit is contained in:
parent
f415faab55
commit
d3f1e04bd7
|
@ -126,7 +126,8 @@
|
|||
["c" (S- 'right)]
|
||||
["d" (S- 'left)]
|
||||
["h" #:when (equal? params '(4)) (simple-key 'insert)] ;; st, http://st.suckless.org/
|
||||
["t" #:when (equal? (car params) 8) (apply screen-size-report (cdr params))]
|
||||
["t" #:when (and (= (length params) 3) (= (car params) 8))
|
||||
(apply screen-size-report (cdr params))]
|
||||
[_ (simple-key (unknown-escape-sequence lexeme))]))
|
||||
|
||||
(define (analyze-vt-O-mainchar lexeme mainchar)
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "main.rkt")
|
||||
|
||||
(define (display* . things)
|
||||
(for-each display things)
|
||||
(flush-output))
|
||||
|
||||
(define (main)
|
||||
(tty-raw!)
|
||||
|
||||
(display* (dec-soft-terminal-reset)
|
||||
(device-request-screen-size))
|
||||
|
||||
(define report (lex-lcd-input (current-input-port)))
|
||||
(printf "The reported screen size is ~a columns and ~a rows.\r\n"
|
||||
(screen-size-report-columns report)
|
||||
(screen-size-report-rows report))
|
||||
(printf "The raw report value itself is ~v.\r\n" report)
|
||||
|
||||
(display* (dec-soft-terminal-reset)))
|
||||
|
||||
(module+ main
|
||||
(main))
|
Loading…
Reference in New Issue