*BSD News Article 98210


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!sol.net!spool.mu.edu!newsspool.sol.net!newsfeeds.sol.net!europa.clark.net!nntprelay.mathworks.com!news.mathworks.com!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Keyboard LEDs on/off by software?
Date: 21 Jun 1997 17:21:59 GMT
Organization: Private BSD site, Dresden
Lines: 21
Message-ID: <5oh2jn$b7n@uriah.heep.sax.de>
References: <87hgetmjtt.fsf@localhost>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:43297

gorski@poboxes.com wrote:

> Does anybody know how to switch the keyboard LEDs on/off
> by software??
> Maybe there are some ioctl() functions? (or something else)

#include <machine/console.h>

int leds = ioctl(fd, KDGETLED);
ioctl(fd, KDSETLED, leds);

(That's a SysV-style ioctl, thus pass the integer value directly, not
the address of an `int' variable as in typical BSD-style ioctls.)

NB: works with both graphical console drivers.
-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)