[Haskell-cafe] Problem with hscurses

david48 dav.vire+haskell at gmail.com
Tue Sep 16 11:31:56 EDT 2008

the getCh funtion is supposed to return an interpreted Key with values
like KeyChar c, KeyReturn, KeyBackspace, etc.

but in fact, it only ever returns KeyChar c values !

am I doing anything wrong ?

Here's an example program :

module Main where

import UI.HSCurses.Curses
import Text.Printf
import System.IO

main = do
  hSetBuffering stdout NoBuffering
  withCurses test1

withCurses f = do
  echo False
  cBreak True
  res <- f
  return res

test1 = do
  c <- getCh
  printf "Touche : %s\r\n" (show c)

More information about the Haskell-Cafe mailing list