名称 (NAME)
setleds - 设置键盘 led 标志
总览 (SYNOPSIS)
setleds [-v] [-L] [-D] [-F] [{+|-}num] [{+|-}caps] [{+|-}scroll]
描述 (DESCRIPTION)
setleds 显示改变当前虚拟终端的led 标志 (就是 NumLock,CapsLock 和ScrollLock)。如果没有参数setleds 显示当前设置。如果有参数,它设置或清除相应的 标志(不改变其它的标志)。如果有-v 选项,显示修改前后的状态。
选项 (OPTIONS)
- -F
- 这是 默认 选项。 它 只改变 虚拟 终端 的 标志 (它的 状态 可能 同 键盘的 led 一样)。
- -D
- 同时 改变 虚拟 终端 的 标志 和 默认 设置 (这样 之后 恢复 默认 设置 时不会 影响 现在的 更改)。 这对 那些 想 让 NumLock 总是 开着 的人 很有用。
- -L
- 不改变 虚拟终端 的 状态, 只改变 键盘的 led。 这样 led 就和 虚拟终端的标志 不一样了 (它 只显示 它自己 的 状态)。 setleds -L 命令(没有 更多的 参数了) 会 再次 改变 led 使它 能 反映 虚拟终端的 状态。
- -num +num
- 清除 或者 设置 NumLock。 (现在, NumLock 的 状态 只影响 小键盘, NumLock 设置 相当于 NumLock 键)
- -caps +caps
- 清除 或者 设置 CapsLock。 (现在, 当 用于 字符 时 CapsLock 设置 相当于 Shift 键。 CapsLock 设置 相当于 CapsLock 键)
- -scroll +scroll
- 清除 或者 设置 ScrollLock。 (现在, 按 ScrollLock 键 (或者 ^S/^Q) 会停止/开始终端输出。)
例子 (EXAMPLE)
可以 在 /etc/rc 中用 setleds 来 设置 NumLock 的 初始 和 缺省 状态, 比如
- INITTY=/dev/tty[1-8]
for tty in $INITTY; do- setleds -D +num < $tty
错误 (BUGS)
在 键盘 应用 模式 NumLock 键 并不反映 NumLock 标志的 状态。
参见 (SEE ALSO)
loadkeys(1).
#p#
NAME
setleds - set the keyboard leds
SYNOPSIS
setleds [-v] [-L] [-D] [-F] [{+|-}num] [{+|-}caps] [{+|-}scroll]
DESCRIPTION
Setleds reports and changes the led flag settings of a VT (namely NumLock, CapsLock and ScrollLock). Without arguments, setleds prints the current settings. With arguments, it sets or clears the indicated flags (and leaves the others unchanged). The settings before and after the change are reported if the -v flag is given.
The led flag settings are specific for each VT (and the VT corresponding to stdin is used).
By default (or with option -F), setleds will only change the VT flags (and their setting may be reflected by the keyboard leds).
With option -D, setleds will change both the VT flags and their default settings (so that a subsequent reset will not undo the change). This might be useful for people who always want to have numlock set.
With option -L, setleds will not touch the VT flags, but only change the leds. From this moment on, the leds will no longer reflect the VT flags (but display whatever is put into them). The command setleds -L (without further arguments) will restore the situation in which the leds reflect the VT flags.
One might use setleds in /etc/rc to define the initial and default state of NumLock, e.g. by
INITTY=/dev/tty[1-8]
for tty in $INITTY; do
setleds -D +num < $tty
done
OPTIONS
- -num +num
- Clear or set NumLock. (At present, the NumLock setting influences the interpretation of keypad keys. Pressing the NumLock key complements the NumLock setting.)
- -caps +caps
- Clear or set CapsLock. (At present, the CapsLock setting complements the Shift key when applied to letters. Pressing the CapsLock key complements the CapsLock setting.)
- -scroll +scroll
- Clear or set ScrollLock. (At present, pressing the ScrollLock key (or ^S/^Q) stops/starts console output.)
BUGS
In keyboard application mode the NumLock key does not influence the NumLock flag setting.
SEE ALSO
loadkeys(1)