Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!bbn.com!mit-eddie!uw-beaver!milton!ogicse!pdxgate!parsely!percy!3cpu!edrury From: edrury@3cpu.UUCP (Ed Drury) Newsgroups: comp.lang.c Subject: Re: getchar() Message-ID: <176@3cpu.UUCP> Date: 10 Mar 91 00:01:36 GMT References: <1991Mar5.063644.8459@cs.mcgill.ca> <1991Mar5.220902.19196@ux1.cso.uiuc.edu> <1991Mar6.165835.10237@cs.mcgill.ca> <5CTOV6E@methan.chemie.fu-berlin.de> Reply-To: edrury@.UUCP (Ed Drury) Organization: 3cpu.UUCP Lines: 28 In article <5CTOV6E@methan.chemie.fu-berlin.de> kirste@methan.chemie.fu-berlin.de (Burkhard Kirste) writes: >storm@cs.mcgill.ca (Marc WANDSCHNEIDER) writes: > >>> Your problem is that getchar() does not recognize ANY input until >>>you hit Enter. >> [ "yes, but..." stuff deleted ] oh yes, much more complicated, you have to use #include rather than #include -- but the question as I understand it was how to impliment "hot" keys under DOS using C which is not portably done under DOS by reading scan codes -- but is portably done by using pccurses or a series of #define KEY_UP etc ... union k { char ch[2]; unsigned i; } key; ... if(!key.ch[0]) { /* it's a 'hot' one */ switch(key.ch[1]){ ... } Ed