unbuffered raw keyboard input on Windows

Hello. I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console. Although Haskell provides this capability in the standard libraries (using hSetEcho and hSetBuffering from System.IO), it does not work on Windows due to a bug (http://hackage.haskell.org/trac/ghc/ticket/2189). I have tried installing packages like vty, hscurses, and ncurses, but they did not install on Windows. Which workarounds are available for that? Romildo

You could try the SDL package to support user input.
2011/7/6 José Romildo Malaquias
Hello.
I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console.
Although Haskell provides this capability in the standard libraries (using hSetEcho and hSetBuffering from System.IO), it does not work on Windows due to a bug (http://hackage.haskell.org/trac/ghc/ticket/2189).
I have tried installing packages like vty, hscurses, and ncurses, but they did not install on Windows.
Which workarounds are available for that?
Romildo
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Jul 06, 2011 at 02:48:47PM -0700, David Barbour wrote:
You could try the SDL package to support user input.
Unfortunatly it does not run on a terminal.
2011/7/6 José Romildo Malaquias
Hello.
I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console.
Although Haskell provides this capability in the standard libraries (using hSetEcho and hSetBuffering from System.IO), it does not work on Windows due to a bug (http://hackage.haskell.org/trac/ghc/ticket/2189).
I have tried installing packages like vty, hscurses, and ncurses, but they did not install on Windows.
Which workarounds are available for that?
Romildo
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

2011/7/10 José Romildo Malaquias
On Wed, Jul 06, 2011 at 02:48:47PM -0700, David Barbour wrote:
You could try the SDL package to support user input.
Unfortunatly it does not run on a terminal.
http://www.gamedev.net/topic/340894-how-do-i-keep-sdl-from-outputting-stdout...

On Wed, Jul 06, 2011 at 06:46:32PM -0300, José Romildo Malaquias wrote:
Hello.
I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console.
Although Haskell provides this capability in the standard libraries (using hSetEcho and hSetBuffering from System.IO), it does not work on Windows due to a bug (http://hackage.haskell.org/trac/ghc/ticket/2189).
I have tried installing packages like vty, hscurses, and ncurses, but they did not install on Windows.
Considering that there are curses for Windows (pdcurses[1] and the latest ncurses[2]), would it be too difficult to port such libraries to Windows? [1] http://pdcurses.sourceforge.net/ [2] http://www.gnu.org/software/ncurses/ Romildo
participants (2)
-
David Barbour
-
José Romildo Malaquias