cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/18/17:31:19

From: firewind <firewind AT metroid DOT dyn DOT ml DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How do I write to the keyboard LEDs?
Date: 18 Oct 1997 17:42:49 GMT
Organization: Netcom
Lines: 31
Message-ID: <62asep$scg@sjx-ixn9.ix.netcom.com>
References: <3448485f DOT 6144679 AT news DOT demon DOT co DOT uk>
NNTP-Posting-Host: elp-tx1-15.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Sam. <sam AT greenaum DOT demon DOT co DOT ARSE!ARSE!ARSE!uk> wrote:
> How do I write to the keyboard LEDs? I know this is possible, is there
> a simple function to do it? I can read them with _bios_keyboard, can
> it do the job?

Ralf Brown's Interrupt List, in ports.lst, under valid commands to the
keyboard controller (port 0x0060):

 EDh    double  this is a two part command to control the state of the
                  NumLock, CpasLock and ScrollLock LEDs
                The second byte contains the state to set LEDs.
                    bit 7-3     reserved. should be set to 0.
                    bit 2 = 0   Caps Lock LED off
                    bit 1 = 0   Num Lock LED off
                    bit 0 = 0   Scroll Lock LED off

How to use this, is to set a two-byte variable (I think you're going to want
to use a long (which is equivilant to an int, ie, they're both 32-bits long
under DJGPP) here) with the first byte 0xED and the second byte according to 
what you want to do to the LEDs. Then, call

outportl(0x0060, var);

to send the data.

-- 
[- 				 firewind	                            -]
[-   email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work)  -]
[- 	    "You're just jealous because the voices talk to -me-."          -]
[-                   Have a good day, and enjoy your C.		            -]
[-          (on a crusade of grumpiness where grumpiness is due)            -]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019