[Haskell-cafe] Trapping getChar before echo
mikehartl at web.de
Sun Jan 31 05:12:43 EST 2010
main = do
hSetEcho stdin False
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
where scanLine = do
c <- hGetChar stdin
putChar . toUpper $ c
Am Sonntag, den 31.01.2010, 19:17 +1030 schrieb Mark Spezzano:
> Is there any way of trapping keystrokes in Haskell, modifying them, and then echoing?
> Basically I want to give the user a prompt like:
> and then have whatever they type appear in UPPERCASE regardless of whether caps lock was on or not.
> By default Haskell seems to echo characters in whatever case they were typed. I want to sneak in a toUpper in before the Chars get echoed.
> Mark Spezzano
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe