Set nodelay mode once and for all during window creation

This commit is contained in:
mainzelm 2006-04-07 09:41:08 +00:00
parent 40eed873a2
commit 406aeafd2e
1 changed files with 6 additions and 5 deletions

View File

@ -503,9 +503,12 @@
(import-lambda-definition newwin-internal (import-lambda-definition newwin-internal
(height width starty startx) (height width starty startx)
"scsh_newwin") "scsh_newwin")
(define (newwin h w x y) (define (newwin h w x y)
(make-window (or (newwin-internal h w x y) (let ((win (make-window (or (newwin-internal h w x y)
(raise-curses-error "newwin")))) (raise-curses-error "newwin")))))
(nodelay win #t)
win))
(import-lambda-definition delwin-internal (import-lambda-definition delwin-internal
@ -915,13 +918,11 @@
(win) (win)
"scsh_wgetch") "scsh_wgetch")
(define (wgetch win) (define (wgetch win)
(nodelay win #t)
(let ((ch (wgetch-internal (window-c-pointer win)))) (let ((ch (wgetch-internal (window-c-pointer win))))
(if (not (= err ch)) (if (not (= err ch))
ch ch
(begin (begin
(select-port-channels #f (current-input-port)) (select-port-channels #f (current-input-port))
(nodelay win #f)
(wgetch-internal (window-c-pointer win)))))) (wgetch-internal (window-c-pointer win))))))