I've tried this example and it just lets me type in anything in CAPITALS, which
is nice, but Delete key doesn't delete and the arrow keys unfortunately let me
manoeuvre the cursor all over the screen. Also the biggest problem is that
Enter doesn't terminate the input session.
Isn't there a
It might be worth looking at something like a curses library.
On Mon, Feb 1, 2010 at 4:45 PM, Mark Spezzano
mark.spezz...@chariot.net.au wrote:
I've tried this example and it just lets me type in anything in CAPITALS,
which is nice, but Delete key doesn't delete and the arrow keys
Hi,
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
Hi Mark,
http://haskell.org/hoogle/?hoogle=set+echo
Thanks, Neil
On Sun, Jan 31, 2010 at 8:47 AM, Mark Spezzano
mark.spezz...@chariot.net.au wrote:
Hi,
Is there any way of trapping keystrokes in Haskell, modifying them, and then
echoing?
Basically I want to give the user a prompt like:
import System.IO
import Data.Char
main = do
hSetEcho stdin False
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
scanLine
where scanLine = do
c - hGetChar stdin
putChar . toUpper $ c
scanLine
Am Sonntag, den 31.01.2010,
Michael Hartl wrote:
import System.IO
import Data.Char
main = do
hSetEcho stdin False
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
scanLine
where scanLine = do
c - hGetChar stdin
putChar . toUpper $ c
scanLine