Blame docs/doc/kbd.FAQ-10.html

Packit Service 50ad14
Packit Service 50ad14
<HTML>
Packit Service 50ad14
<HEAD>
Packit Service 50ad14
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
Packit Service 50ad14
 <TITLE>The Linux keyboard and console HOWTO: The keyboard LEDs</TITLE>
Packit Service 50ad14
 <LINK HREF="kbd.FAQ-11.html" REL=next>
Packit Service 50ad14
 <LINK HREF="kbd.FAQ-9.html" REL=previous>
Packit Service 50ad14
 <LINK HREF="kbd.FAQ.html#toc10" REL=contents>
Packit Service 50ad14
</HEAD>
Packit Service 50ad14
<BODY>
Packit Service 50ad14
Next
Packit Service 50ad14
Previous
Packit Service 50ad14
Contents
Packit Service 50ad14

Packit Service 50ad14

10. The keyboard LEDs

Packit Service 50ad14
Packit Service 50ad14

Packit Service 50ad14
Packit Service 50ad14
LEDs, keyboard
Packit Service 50ad14
-->
Packit Service 50ad14
Packit Service 50ad14
Packit Service 50ad14
keyboard!LEDs on
Packit Service 50ad14
-->
Packit Service 50ad14

1. There are per-tty keyboard flags:

Packit Service 50ad14
each VC has its own NumLock, CapsLock, ScrollLock.
Packit Service 50ad14
By default these keyboard flags are shown in the LEDs.
Packit Service 50ad14
The usual way to change them is by pressing the corresponding key.
Packit Service 50ad14
(Side remark: pressing the NumLock key when in application key mode
Packit Service 50ad14
will not change the NumLock status, but produce an escape sequence.
Packit Service 50ad14
If you want the NumLock key to always change the Numlock status,
Packit Service 50ad14
bind it to Bare_Num_Lock.)
Packit Service 50ad14

2. Next, there are per-tty default keyboard flags,

Packit Service 50ad14
to initialize the keyboard flags when a reset occurs.
Packit Service 50ad14
Thus if you want NumLock on all the time, that is possible.
Packit Service 50ad14
The usual way to change them is by `setleds -D ...'.
Packit Service 50ad14

3. There is the possibility that the leds do not reflect

Packit Service 50ad14
the keyboard flags, but something else.
Packit Service 50ad14

3A. This something else can be three bits somewhere in the kernel -

Packit Service 50ad14
which can be used if you want to monitor some hardware or software
Packit Service 50ad14
status bit(s). If you want this, edit the kernel source to call
Packit Service 50ad14
register_leds() somewhere.
Packit Service 50ad14

3B. This something else can also be whatever some user program wants

Packit Service 50ad14
to show in the LEDs. Thus, people who like such things can make
Packit Service 50ad14
nice patterns of lights. If you want this, use the KDSETLED ioctl.
Packit Service 50ad14

This latter use is not per-tty, but the choice between former

Packit Service 50ad14
and latter use is per-tty.
Packit Service 50ad14

Summarizing: Each tty has a flag kbd->ledmode.

Packit Service 50ad14
If this has the value LED_SHOW_FLAGS then the keyboard flags
Packit Service 50ad14
(NumLock etc.) of that tty are shown.
Packit Service 50ad14
If this has the value LED_SHOW_MEM then three selected memory
Packit Service 50ad14
addresses are shown.
Packit Service 50ad14
If this has the value LED_SHOW_IOCTL then the leds show whatever
Packit Service 50ad14
value was last assigned to them using the KDSETLED ioctl.
Packit Service 50ad14

One may add that X uses ioctl's to set the LEDs, but fails

Packit Service 50ad14
to reset its VT when it exits, so after using X there may
Packit Service 50ad14
be one VT that is not in the default LED_SHOW_FLAGS state.
Packit Service 50ad14
This can be fixed by doing `setleds -L' on that VT.
Packit Service 50ad14
See setleds(1).
Packit Service 50ad14

Packit Service 50ad14

Packit Service 50ad14
Next
Packit Service 50ad14
Previous
Packit Service 50ad14
Contents
Packit Service 50ad14
</BODY>
Packit Service 50ad14
</HTML>