From: vporguen@unlinfo.unl.edu (victor porguen)
Newsgroups: comp.archives.msdos.d
Subject: Al Berg special: how to inactivate Alt-X
Date: 7 Jan 1993 04:40:13 GMT
Organization: University of Nebraska--Lincoln	
Distribution: world
NNTP-Posting-Host: unlinfo.unl.edu

 
Also sprach der Network Emergency Response Dude, 
alberg@netlan.jpr.com (Al Berg):

> I am seeking a program that will allow me to (temporarily) disable 
> certain keystrokes from being passed to an application (ie user 
> presses Alt-X and it goes to the bit bucket before the app gets 
> it).  I envision this being a TSR that I can load and unload as 
> needed.

This is mostly easy to do in theory, but there may be a problem in 
practice if the program that is loaded after the TSR hooks Int 09h 
(the keyboard Interrupt) or installs its own keyboard handler, then 
special (sneaky) measures must be taken to bypass such insolence.

On the assumption that your program DOES NOT hook Int 09h (most of 
them don't), here's a little TSR called `NO-ALT-X' that will 
intercept the Alt-X keypress and convert it into an audio beep only.
Your application will not see the Alt-X. 

Try it and see if it works with your application. If not, it 
probably means your app is grabbing Int 9 and we'll have to design 
something different to take care of that. Let me know. I've tried
it with Procomm, Qedit, Qmodem and Telix - all of which use Alt-X
as the Exit key combination - worked every time.

NO-ALT-X is a well-behaved TSR which monitors Int 9 to intercept
the Alt-X keystroke and also monitors Int 2F to check whether it's
already resident (using a silly ID string!); if so, it will not 
install itself twice. You should be able to load it high, etc. under 
DOS 5, although it's only a couple of hundred bytes long anyway.  
Unloading is not implemented yet - that will come in the next 
version.   

( However, if you use the PC Magazine INSTALL/REMOVE utilities by 
 Jeff Prosise, you will be able to install and remove this little 
 TSR from memory easily and without any problem...)

-----------------------start program-----------------------------

NO-ALT-X.COM   
------------
Intercepts the Alt-X keystroke and converts it to an audio beep.
Dedicated to the hackers of the world - you may use, copy, store, 
disassemble, mangle, modify and/or distribute this program for any 
legal purpose with no payment to anyone. 
                                   
B8 78 56 BB BC 9A CD 2F 3D BC 9A 75 0C BA BB 01 B4 09 CD 21 B8 01 
4C CD 21 B8 2F 35 CD 21 89 1E 6C 01 8C 06 6E 01 BA 5D 01 B8 2F 25 
CD 21 33 C0 8E D8 C4 06 24 00 2E A3 A0 01 2E 8C 06 A2 01 FA C7 06 
24 00 70 01 8C 0E 26 00 FB 8C C8 8E D8 8E C0 BA A4 01 B4 09 CD 21 
BA DB 01 CD 27 3D 78 56 75 09 81 FB BC 9A 75 03 8B C3 CF EA 00 00 
00 00 50 1E 33 C0 8E D8 F6 06 17 04 08 74 20 E4 60 3C 2D 75 1A B8 
07 0E CD 10 E4 61 88 C4 0C 80 E6 61 88 E0 E6 61 FA B0 20 E6 20 FB 
1F 58 CF 1F 58 EA 00 00 00 00 4E 4F 2D 41 4C 54 2D 58 20 69 73 20 
69 6E 73 74 61 6C 6C 65 64 2E 24 4E 4F 2D 41 4C 54 2D 58 20 69 73 
20 61 6C 72 65 61 64 79 20 69 6E 73 74 61 6C 6C 65 64 2E 24 00 

;checksum 1592

------------------------end program------------------------------

Let me know if it works :-) 


Newsgroups: comp.archives.msdos.d