From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA18032; Mon, 5 Aug 2002 12:12:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA18147 for ; Mon, 5 Aug 2002 12:12:36 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from jlonline.com ([61.155.13.241]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g75ACZD18202 for ; Mon, 5 Aug 2002 12:12:35 +0200 (MET DST) Received: from public1.ptt.js.cn([218.2.166.169]) by js.cn(AIMC 2.9.5.2) with SMTP id jm503d4e7013; Mon, 05 Aug 2002 18:06:36 +0800 Message-ID: <3D4E4F1A.2050207@public1.ptt.js.cn> Date: Mon, 05 Aug 2002 18:10:34 +0800 From: zw User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1b) Gecko/20020804 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] read a key press Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I want to write a small echo program (for self amusement). It's like that everytime I press a character key, there's a hook function got called. Somewhat like a event loop. I found Stream can't do this. Stream only begins to parse the input from keyboard after I press Ctrl-D. read_char from Pervasive can't do this either. It only begins to do stuff after I press the Return key. What I want is a read function that read instantly after a charcter key being pressed. Can you give me some recommendations? Thanks in advance. zw ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners