Zero-based row/column cursor positioning.
This commit is contained in:
parent
4f84e14e3b
commit
a5b3795f51
|
@ -45,8 +45,8 @@
|
||||||
lex-lcd-input
|
lex-lcd-input
|
||||||
24
|
24
|
||||||
80
|
80
|
||||||
1
|
0
|
||||||
1
|
0
|
||||||
color-white
|
color-white
|
||||||
color-black
|
color-black
|
||||||
#f
|
#f
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
(plumber-add-flush! (current-plumber)
|
(plumber-add-flush! (current-plumber)
|
||||||
(lambda (h)
|
(lambda (h)
|
||||||
(tty-style-reset *stdin-tty*)
|
(tty-style-reset *stdin-tty*)
|
||||||
(tty-goto *stdin-tty* (tty-rows *stdin-tty*) 1))))
|
(tty-goto *stdin-tty* (- (tty-rows *stdin-tty*) 1) 0))))
|
||||||
*stdin-tty*)
|
*stdin-tty*)
|
||||||
|
|
||||||
(define (tty-display tty . items)
|
(define (tty-display tty . items)
|
||||||
|
@ -63,9 +63,9 @@
|
||||||
(flush-output (tty-output tty)))
|
(flush-output (tty-output tty)))
|
||||||
|
|
||||||
(define (tty-goto tty row0 column0)
|
(define (tty-goto tty row0 column0)
|
||||||
(define row (max 1 (min (tty-rows tty) row0)))
|
(define row (max 0 (min (- (tty-rows tty) 1) row0)))
|
||||||
(define column (max 1 (min (tty-columns tty) column0)))
|
(define column (max 0 (min (- (tty-columns tty) 1) column0)))
|
||||||
(tty-display tty (goto row column))
|
(tty-display tty (goto (+ row 1) (+ column 1)))
|
||||||
(set-tty-cursor-row! tty row)
|
(set-tty-cursor-row! tty row)
|
||||||
(set-tty-cursor-column! tty column)
|
(set-tty-cursor-column! tty column)
|
||||||
tty)
|
tty)
|
||||||
|
@ -73,8 +73,8 @@
|
||||||
(define (tty-clear tty)
|
(define (tty-clear tty)
|
||||||
(tty-style tty) ;; applies style from tty
|
(tty-style tty) ;; applies style from tty
|
||||||
(tty-display tty (clear-screen/home))
|
(tty-display tty (clear-screen/home))
|
||||||
(set-tty-cursor-row! tty 1)
|
(set-tty-cursor-row! tty 0)
|
||||||
(set-tty-cursor-column! tty 1)
|
(set-tty-cursor-column! tty 0)
|
||||||
tty)
|
tty)
|
||||||
|
|
||||||
(define (tty-style tty
|
(define (tty-style tty
|
||||||
|
|
Loading…
Reference in New Issue