Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!ernie.viewlogic.com!m2c!umvlsi!dime!aspasia!eli From: eli@aspasia.gang.umass.edu (Eli Brandt) Newsgroups: comp.lang.pascal Subject: Re: Keyboard lights Message-ID: <22707@dime.cs.umass.edu> Date: 16 Nov 90 17:59:21 GMT References: <2526@oucsace.cs.OHIOU.EDU> Sender: news@dime.cs.umass.edu Reply-To: eli@aspasia.CS.UMASS.EDU (Eli Brandt) Organization: University of Massachusetts, Amherst Lines: 60 In article <2526@oucsace.cs.OHIOU.EDU> rsandfor@oucsace.cs.ohiou.edu (Robert Sandford) writes: >on or off. It seems to work only on 101 keyboards though. Others >it will just set either the num lock on or off but the light will >not change. If anyone knows how to make the lights flash please E-mail >the info, I probably need to reset something, because when I put the >capson and capsoff i can't get it to flash on and off. So any ideas on how >i would aprreciate it. > >PROGRAM Key_lights; >USES CRT; > >VAR s:string; > >PROCEDURE CapsOn; >BEGIN > Mem[$40:$17]:=mem[$40:$17] OR $40 >END; > >PROCEDURE CapsOff; >BEGIN > Mem[$40:$17]:=mem[$40:$17] AND $BF >END; > >PROCEDURE NumOn; >BEGIN > Mem[$40:$17]:=mem[$40:$17] OR $20 >END; > >PROCEDURE NumOff; >BEGIN > Mem[$40:$17]:=mem[$40:$17] AND $DF >END; > >PROCEDURE ScrollOn; >BEGIN > Mem[$40:$17]:=mem[$40:$17] OR $10 >END; > >PROCEDURE ScrollOff; >BEGIN > Mem[$40:$17]:=mem[$40:$17] AND $EF >END; > >BEGIN > CapsOn; > Scrollon; > Numon; >END. On my keyboard, at least (an IBM "enhanced" eight-pounder), there are two different sets of bits. There is the one you're using, which flips both the keyboard state and the LED, and there's another which flips just the LED's. If you use the second one it's very easy to get the true state out of sync with the indicator light, which can be annoying. The problem is that many "compatible" BIOS's/keyboards don't seem to implement this properly. Try playing around with the other byte, which I think is located at $84. (For God's sake don't just write to that location without seeing what it is; I've probably got it wrong) Eli