Subject: Disabling the keyboard 84. ***** Q: How can I disable and then enable the keyboard in my TP program? A: Here is the code. A warning! Don't experiment with ports. You can do real harm to your data and your computer if you do not know exactly what you are doing. uses Dos, Crt; { Crt only needed because of 'Delay' in the testing } var i : byte; { only needed in the testing } NormalKeyboard : procedure; {} procedure DisableKeyboard; interrupt; var port60, port61 : byte; begin port60 := Port[$60]; { KeyBoard controller data output buffer } port61 := Port[$61]; { Keyboard controller port B } Port[$61] := Port61 or $80; { clear keyboard } Port[$61] := Port61; Port[$20] := $20; { Programmable Intr. Contr. initialization } end; {} begin writeln ('Testing...'); GetIntVec ($09, @NormalKeyboard); SetIntVec ($09, @DisableKeyboard); write ('The keyboard is now disabled..'); for i := 1 to 5 do begin Delay (1000); write (i:2); end; {for} writeln; SetIntVec ($09, @NormalKeyboard); write ('The keyboard is now enabled...'); for i := 1 to 5 do begin Delay (1000); write (i:2); end; {for} end. --------------------------------------------------------------------