Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!cgl!socrates.ucsf.edu!kneller From: kneller@socrates.ucsf.edu (Don Kneller%Langridge) Newsgroups: comp.sys.ibm.pc Subject: Re: control-P = PrtSc on PC/AT's Message-ID: <10121@cgl.ucsf.EDU> Date: Tue, 17-Mar-87 17:47:04 EST Article-I.D.: cgl.10121 Posted: Tue Mar 17 17:47:04 1987 Date-Received: Thu, 19-Mar-87 02:38:34 EST References: <243@fornax.uucp> Sender: daemon@cgl.ucsf.EDU Reply-To: kneller@cgl.ucsf.edu Organization: UCSF Computer Graphics Lab Lines: 35 In article <243@fornax.uucp> chapman@fornax.uucp (John Chapman) writes: > We have a terminal driver which maps certain keys to our functions, and > we want to use control-P. Apparently DOS maps control-P to PrtSc, and > if you don't have a PRN device, this goes into a slow, abnoxious loop > telling you it can't write to the PRN device. I can't find this key > mapping (^P) anywhere in the DOS documentation. Does anyone out there > know how to disable this key mapping? > It's quite simple to disable the DOS interpretation of ^P and PrtSc (and as bonuses: ^S is disabled, and screen IO via DOS calls is faster). Basically, you want to change the input routines to use "raw" mode. This is done with the DOS IOCTL interrupt (sorry, don't have the number at hand). Use the IOCTL interrupt to determine the flags for the standard input device (device number 0). Save the original flags, set the "raw" bit (0x80, I think), then use the IOCTL interrupt to set the new flags. This will disable ^P, PrtSc and ^S completely and they will be treated as normal characters by DOS. Also, DOS won't check for ^C in the input buffer everytime a character is output to the screen, so screen IO using DOS calls will be faster (subjectively about 2-3 times as fast). When working on PC HACK, I thought I would have to also change the standard output device (device number 1) to raw mode to get faster IO, but this is unnecessary. Make sure you restore the original flags before your program exits since DOS doesn't do it for you. Otherwise ^S won't pause and ^C won't stop a "dir". ----- Don Kneller UUCP: ...ucbvax!ucsfcgl!kneller ARPA: kneller@cgl.ucsf.edu BITNET: kneller@ucsfcgl.BITNET