Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!andrew.cmu.edu!nf0i+ From: nf0i+@andrew.cmu.edu (Norman William Franke, III) Newsgroups: comp.sys.mac.programmer Subject: Extended Keyboard lights Message-ID: <4Y=dhMy00WB_0A11Bk@andrew.cmu.edu> Date: 27 Mar 89 20:36:40 GMT Organization: Class of '92, Carnegie Mellon, Pittsburgh, PA Lines: 37 I am trying to write a program to turn on the "num lock" & "scroll lock" lights on the ADB Extended keyboard. So I'm guessing they are stored somewhere in the registers. I wrote this little program in LightSpeed Pascal to try to read register 3 (device id). But it seems to crash the system sometimes and I have no idea why. Can someone please tell me what I'm doing wrong? And what bits Apple stores the data for the lights in what register? Thanks a lot. program ADB; uses OSIntf; const addr = 2; var err, rootCommand, command: integer; info: ADBDataBlock; datastr, buffer: str255; procedure nothing; begin end; begin err := GetADBInfo(info, addr); datastr := '..'; buffer := '..'; rootCommand := addr * 16 + 12; command := rootCommand + 3; with info do err := ADBOp(@datastr, @nothing, @buffer, command); writeln(ord(buffer[1]), ord(buffer[2])); end. Norman Franke nf0i+@andrew.cmu.edu