Mail Archives: djgpp/1997/10/18/17:31:19
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 -