[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Trapping getChar before echo

Subject: Re: [Haskell-cafe] Trapping getChar before echo
From: Andrew Coppin
Date: Sun, 31 Jan 2010 12:57:44 +0000
Michael Hartl wrote:
import System.IO
import Data.Char

main = do
  hSetEcho stdin False
  hSetBuffering stdin NoBuffering
  hSetBuffering stdout NoBuffering
where scanLine = do c <- hGetChar stdin
              putChar . toUpper $ c
Last time I tried something like this [on Windows], it didn't seem to
work. I wanted to trap arrow keys and so forth, but they seem to be
being used for input history. (I.e., pressing the up-arrow produces
previously-entered lines of text, and none of this appears to be
reaching the Haskell program itself.) Has this changed since I tried it
last year?
Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>