home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!bigboote.WPI.EDU!nntp!tomster
- From: tomster@bigwpi.WPI.EDU (Thomas Richard Dibble)
- Newsgroups: comp.lang.c
- Subject: Re: Telling if the SHIFT key is down.
- Date: 21 Jan 93 22:36:54
- Organization: ZikZak Corporation
- Lines: 39
- Message-ID: <TOMSTER.93Jan21223654@bigwpi.WPI.EDU>
- References: <00966E8E.9CED30C0@Msu.oscs.montana.edu>
- NNTP-Posting-Host: bigwpi.wpi.edu
- In-reply-to: ooprb@Msu.oscs.montana.edu's message of Thu, 21 Jan 1993 04:02:10 GMT
-
- >>>>> On Thu, 21 Jan 1993 04:02:10 GMT, ooprb@Msu.oscs.montana.edu said:
-
- o> Thank you in advance for any help.
-
- o> REQUEST: With Dos 5.0 and Borland 3.0, I would like to tell if
- o> the shift key (ignoring all other keys presses) is being held
- o> down on the go - not waiting for any key press.
-
- o> TRIED: I've tried kbhit() and bioskey(0/1) with no success.
-
- o> WHAT FOR: I'm writting a program that updates numbers by the
- o> press of a mouse button. I would like to change the value by a
- o> different amount if the shift key is being pressed when a mouse
- o> button is pressed.
-
- simple --
- "
- unsigned char far *key_flags = MK_FP(0, 0x417);
- "
-
- when key_flags == 0x2a the left shift is depressed, 0x36 means right
- shift. also, an inportb(0x60) will give you the same info, but the
- returned byte will have bit 1 (the least significant bit) set for one
- key and bit 2 set for the other (I forget which is which).
-
- I would consider the other poster's advice and abandone the idea of
- keyboard-modifying the mouse unless it is absolutely necessary (ie,
- you already are using both buttons).
-
- o> Rocky B. - ooprb@trex.oscs.montana.edu
-
- ---- tomster@wpi.wpi.edu
-
- --
- /****************************************************************************\
- | "I sometimes used to try to catch her, : FROM: tomster@wpi.wpi.edu |
- | but never even caught her name." : TO: who(m)ever reads it |
- | ---- the cure : CC: programming language |
- \vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv/
-