
31 Mar
2009
31 Mar
'09
3:38 p.m.
I ran the following program:
module Main where
main = do putStrLn "Key" c <- getChar print c main
Unfortunately, it doesn't do what I was hoping. Specifically, it only returns any data when I hit [return]. It also seems to be giving me a command history somehow. Special keys (e.g., arrow keys, backspace, escape) don't get through to the application. I'm trying to write a program that uses individual keys as commands. What's the correct way to get this to work?