Yeah, it's broken in windows. Here's the workaround courtesy of Alistar Bayley. (ticket 2189)

{-# LANGUAGE ForeignFunctionInterface #-}

import Data.Char
import Control.Monad (liftM, forever)
import Foreign.C.Types

getHiddenChar = liftM (chr.fromEnum) c_getch
foreign import ccall unsafe "conio.h getch"
 c_getch :: IO CInt

main = do
  forever $ do
     c <- getHiddenChar
     putStrLn $ show (fromEnum c)

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to