home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:20043 comp.os.msdos.programmer:12325
- Newsgroups: comp.lang.c,comp.os.msdos.programmer
- Path: sparky!uunet!munnari.oz.au!uniwa!cujo!cc.curtin.edu.au!tsuanian
- From: tsuanian@cc.curtin.edu.au
- Subject: Re: Reading the arrow keys... how?
- Message-ID: <1993Jan22.101809.1@cc.curtin.edu.au>
- Lines: 26
- Sender: news@cujo.curtin.edu.au (News Manager)
- Organization: Curtin University of Technology
- References: <1jmeupINN4g9@savoy.cc.williams.edu>
- Date: Fri, 22 Jan 1993 01:18:09 GMT
-
- In article <1jmeupINN4g9@savoy.cc.williams.edu>, 93gke@williams.edu (Just Ask The Axis) writes:
- > I am trying to read the arrow keys from a PC keyboard in C. So far
- > the calls to getch(), getc(), getchar(), have been unsuccessful
- > because the keys don't seem to have a corresponding ASCII code (they
- > seem to send 2 characters..?) I also need to read some regular keys
- > like Q,S, etc...
- > Could someone tell me how to read them directly, please.
- >
- > Greg Ennis
- > 93gke@cs.williams.edu
- >
-
-
- Keys such as arrow keys, function keys, etc do not have an ASCII
- code. When one of these keys are pressed, it gives of two numbers.
- The first is 00 and the next is it's scan code. I think any decent
- MS DOS handbook should tell you what the scan codes are. but if
- you have any problems I'll see what I can dig up.
- Can't remember the exact code I used to read the codes, but I'm
- pretty sure it was a combination of kbhit() and getch().
-
- Ian
- --
- Internet: TSUANIAN@cc.curtin.edu.au
- Bitnet: TSUANIAN%cc.curtin.edu.au@cunyvm.bitnet
- UUCP : uunet!munnari.oz!cc.curtin.edu.au!TSUANIAN
-