home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!cs.utexas.edu!usc!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!pacific.mps.ohio-state.edu!davis
- From: davis@pacific.mps.ohio-state.edu ("John E. Davis")
- Subject: int 9h
- Message-ID: <DAVIS.92Sep11115609@pacific.mps.ohio-state.edu>
- Sender: news@pacific.mps.ohio-state.edu
- Nntp-Posting-Host: pacific.mps.ohio-state.edu
- Reply-To: davis@pacific.mps.ohio-state.edu (John E. Davis)
- Organization: "Dept. of Physics, The Ohio State University"
- Date: Fri, 11 Sep 1992 16:56:09 GMT
- Lines: 44
-
- Hi,
-
- I need to know how to do something very simple: intercept interrupt 9
- (keyboard ready), set a flag if a certain key was pressed otherwise call the
- old interrupt nine handler. I know how to do everything, EXCEPT reading the
- key directly from the keyboard. So I have: (BCC++ 3.0)
-
- void interrupt (*oldint9)();
- extern volatile int KeyBoard_Flag;
- extern int Interrupt_Char; /* probably a scan code needed */
-
- void init_int9_handler(void)
- {
- oldint9 = getvect(9);
- setvect(9, int9_handler);
- }
-
- void restore_int9_handler(void)
- {
- setvect(9, oldint9);
- }
-
- void interrupt int9_handler(void)
- {
- if (/* peek at key from keyboard */ == Interrupt_Char)
- KeyBoard_Flag = 1;
- else
- (*oldint9)();
- }
-
-
- In the last routine, I need to know how to complete the if statement.
-
- Any comments or suggestions will be greatly appreciated.
-
- Thanks,
- --
- _____________
- #___/John E. Davis\_________________________________________________________
- #
- # internet: davis@amy.tch.harvard.edu
- # bitnet: davis@ohstpy
- # office: 617-735-6746
- #
-