Path: utzoo!attcan!uunet!cs.utexas.edu!yale!cs.yale.edu!spolsky-joel From: spolsky-joel@cs.yale.edu (Joel Spolsky) Newsgroups: comp.os.msdos.programmer Subject: Re: Testing for ALT keypress Message-ID: <26242@cs.yale.edu> Date: 19 Sep 90 03:57:30 GMT References: Sender: news@cs.yale.edu Distribution: comp Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Lines: 15 Nntp-Posting-Host: zoo-gw.cs.yale.edu Originator: spolsky@suned.CS.Yale.Edu In article melling@cs.psu.edu (Michael D Mellinger) writes: >I am trying to test when a user presses ALT-h, but am not having much >luck. I found these two library routines in the Microsoft C 6.0 >library reference manual, but they don't seem to do the trick for ALT >key sequences(They work fine for Cntrl and Shift keys, however). I >was masking ch with 0xff to get the proper ascii character and testing >bit 3 in altpress. Is there something else that I have to do? You're doing it wrong; bioskey returns scancodes for the ALT keys, not ASCII values. It sets the low byte of the result to 0. Look at the *high* byte of the result, that reflects the keyboard scancode of the ALT-key combination pressed. Joel Spolsky spolsky@cs.yale.edu Silence = Death