Article View: comp.os.msdos.programmer
Article #2291Re: Testing for ALT keypress
From: Joel Spolsky
Date: Wed, 19 Sep 1990 03:57
Date: Wed, 19 Sep 1990 03:57
15 lines
1343 bytes
1343 bytes
In article <Fdatuc52@cs.psu.edu> 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
Technical Details
Message-ID:
<26242@cs.yale.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!yale!cs.yale.edu!spolsky-joelReferences:
<Fdatuc52@cs.psu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <Fdatuc52@cs.psu.edu> 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