loadkeys 中文man页面

系统
Loadkeys 读取 由 filename... 指定的 文件 内容. 它的 主要目的 是 为 控制台 调入 内核键盘映射表(kernel keymap).

名称 (NAME)

loadkeys - 调入键盘翻译表

总览 (SYNOPSIS)

loadkeys [ -d --default ] [ -h --help ] [ -q --quiet ] [ -v --verbose [ -v --verbose ]...] [ -m --mktable ] [ -c --clearcompose ] [ -s --clearstrings ] [ filename... ]

描述 (DESCRIPTION)

Loadkeys 读取 由 filename... 指定的 文件 内容. 它的 主要目的 是 为 控制台 调入 内核键盘映射表(kernel keymap).

设为缺省 (RESET TO DEFAULT)

如果 指定了 -d (或 --default ) 选项, loadkeys 调入 缺省的 键盘映射 文件 defkeymap.map, 可能 在 /usr/share/keymaps/usr/src/linux/drivers/char 目录 下. (前者 可能是 用户定义的, 而 后者 是 针对 PC 机 qwerty 键盘 的 映射 - 也许 你 不需要.) 某些情况下, 如果 遇上 奇怪的 键盘映射 (把 减号 '-' 弄成了 某种 陌生的 修饰组合), 你 只要 轻松的 键入 `loadkeys defkeymap' 就可以了.

(译注: qwerty 是一种常用的 PC 键盘布局, 由 键盘 字母区 左上角 的 连续横向 六个 字母键 得名)

调入内核键盘映射 (KERNEL KEYMAP)

loadkeys 的 主要作用 是 调入 或 修改 键盘驱动程序 的 翻译表. 当 指出了 文件名 的 时候, 标准输入 用 短横线(-) 表示. 如果 没有指出 文件名, loadkeys 就 从 标准输入 读取 数据.

对于 许多 国家 和 各种 键盘类型, 系统 已经 提供了 对应的 键盘映射表, 只需 用一条 诸如 `loadkeys uk' 的 命令 就可以 满足 需要. 而且 很容易设计 自己的 键盘映射表. 用户 必须 识别 哪些 符号 属于 哪些 键. 可以 用 showkey(1) 命令 查出 键值(keycode), 手册页 keymaps(5) 对 键盘映射表 格式 做了 说明, 也可以 参考 dumpkeys(1) 命令 输出 的 内容.

调入内核 ACCENT 表

如果 输入文件 没有 定义 任何 组合键(compose key), 内核 accent 表 就 保持 不变, 除非 使用了 -c (或 --clearcompose ) 选项, 此时 内核 accent 表 被 清空. 如果 输入文件 定义了 组合键, 那么 清除 原有 定义, 换成 新的 定义. 内核 accent 表 是 一组 表项 (缺省为 68 项), 用来 描述 区分符(dead diacritical sign) 和 组合键 怎么 工作. 例如, 这行

compose ',' 'c' to ccedilla

表示 <ComposeKey><,><c> 组合 产生 <ccedilla>. 使用 命令 `dumpkeys --compose-only' 能够 查看 当前 accent 表.

(译注: Compose 键 可以 用 dumpkeys 命令 查出, 我的 系统上 是 ctrl+句号, 因此 相继 按下 'ctrl-.', ',', 'c' 就可以 产生 上述的 'ccedilla'.)

调入内核字符串表 (KERNEL STRING TABLE)

选项 -s (或 --clearstrings ) 用于 清除 内核字符串表. 如果 不使用 这个 选项, loadkeys 只会 添加 或 调换 字符串, 而不是 清除 它们. (因而 需要 选项 -s 实现 友好定义 状态.) 内核字符串表 是 一组 命名 字符串, 就象 F31. 例如, 你 可以 使 功能键 F5 (普通 PC 键盘上 有) 产生 字符串 `Hello!', 使 Shift+F5 产生 `Goodbye!':

keycode 63 = F70 F71
string F70 = "Hello!"
string F71 = "Goodbye!"

把 这三行 加进 键盘映射表 即可. 缺省的 功能键 定义 大多是来自 VT100 终端 的 转码序列 (escape sequence).

创建内核源文件表 (KERNEL SOURCE TABLE)

如果 给出了 -m (或 --mktable ) 选项, loadkeys 在 标准输出 产生 一个文件, 可以 用做 /usr/src/linux/drivers/char/defkeymap.c, 它 定义了 内核的 缺省 键盘编联 (但 不影响 当前 键盘映射).

选项 (OPTION)

-h --help
在 标准错误 上 显示 版本号 和 简短 的 用法, 然后 结束.
-v --verbose
显示 更新 细节, 用的越多, 细节越细.
-q --quiet
不要 显示 一般信息.
-c --clearcompose
清除 内核的 组合键表 (就是 accent 表). 如果 没有 使用 这个选项, 而且输入文件 没有 定义 组合键, 内核组合键表 保持 不变.
-s --clearstrings
清除 内核的 字符串表. 如果 没有 使用 这个选项, loadkeys 将 添加 或 调换 字符串, 而不是 删除 它们.

文件 (FILE)

/usr/lib/kbd/keymaps/ 键盘映射文件 的 缺省目录.

/usr/lib/kbd/keymaps/defkeymap.kmap-d 选项 调入的 缺省 键盘映射文件. (译注: 对于 比较 新的 系统 请查看 /usr/lib/kbd/keymaps/i386/qwerty/, 注意 这里 最后面的 两个 目录, 前者 是 系统平台, 后者 是 键盘类型)

BUGS

任何人 只要有 对 /dev/console 的 读访问权 就能够 运行 loadkeys , 从而 改变 键盘布局, 使 它 可能 无法使用. 键盘翻译表 由 所有 虚拟控制台共用, 所以 任何 对 键盘编联 的 改变 会 同时 影响 所有的 虚拟控制台.

注意, 由于 改变 能够 影响 所有的 虚拟控制台, 因此 它 比 用户的 会话期 更长. 这意味着 即使 在 登录 提示 阶段, 键值编联 也会 影响 用户 的 使用.

缺省的 键盘映射 应该 编译在 内核中. ( /usr/src/linux/drivers/char/defkeymap.c ).

另见 (SEE ALSO)

dumpkeys(1), kbd_mode(1), keymaps(5).

#p#

NAME

loadkeys - load keyboard translation tables  

SYNOPSIS

loadkeys [ -c --clearcompose ] [ -d --default ] [ -h --help ] [ -m --mktable ] [ -s --clearstrings ] [ -v --verbose ] [ filename... ]

DESCRIPTION

The program loadkeys reads the file or files specified by filename.... Its main purpose is to load the kernel keymap for the console.  

RESET TO DEFAULT

If the -d (or --default ) option is given, loadkeys loads a default keymap, probably the file defkeymap.map either in /lib/kbd/keymaps or in /usr/src/linux/drivers/char. (Probably the former was user-defined, while the latter is a qwerty keyboard map for PCs - maybe not what was desired.) Sometimes, with a strange keymap loaded (with the minus on some obscure unknown modifier combination) it is easier to type `loadkeys defkeymap'.  

LOAD KERNEL KEYMAP

The main function of loadkeys is to load or modify the keyboard driver's translation tables. When specifying the file names, standard input can be denoted by dash (-). If no file is specified, the data is read from the standard input.

For many countries and keyboard types appropriate keymaps are available already, and a command like `loadkeys uk' might do what you want. On the other hand, it is easy to construct one's own keymap. The user has to tell what symbols belong to each key. She can find the keycode for a key by use of showkey(1), while the keymap format is given in keymaps(5) and can also be seen from the output of dumpkeys(1).  

LOAD KERNEL ACCENT TABLE

If the input file does not contain any compose key definitions, the kernel accent table is left unchanged, unless the -c (or --clearcompose ) option is given, in which case the kernel accent table is emptied. If the input file does contain compose key definitions, then all old definitions are removed, and replaced by the specified new entries. The kernel accent table is a sequence of (by default 68) entries describing how dead diacritical signs and compose keys behave. For example, a line

compose ',' 'c' to ccedilla

means that <ComposeKey><,><c> must be combined to <ccedilla>. The current content of this table can be see using `dumpkeys --compose-only'.  

LOAD KERNEL STRING TABLE

The option -s (or --clearstrings ) clears the kernel string table. If this option is not given, loadkeys will only add or replace strings, not remove them. (Thus, the option -s is required to reach a well-defined state.) The kernel string table is a sequence of strings with names like F31. One can make function key F5 (on an ordinary PC keyboard) produce the text `Hello!', and Shift+F5 `Goodbye!' using lines

keycode 63 = F70 F71
string F70 = "Hello!"
string F71 = "Goodbye!"

in the keymap. The default bindings for the function keys are certain escape sequences mostly inspired by the VT100 terminal.  

CREATE KERNEL SOURCE TABLE

If the -m (or --mktable ) option is given loadkeys prints to the standard output a file that may be used as /usr/src/linux/drivers/char/defkeymap.c, specifying the default key bindings for a kernel (and does not modify the current keymap).  

OTHER OPTIONS

-h --help
loadkeys prints its version number and a short usage message to the programs standard error output and exits.

WARNING

Note that anyone having read access to /dev/console can run loadkeys and thus change the keyboard layout, possibly making it unusable. Note that the keyboard translation table is common for all the virtual consoles, so any changes to the keyboard bindings affect all the virtual consoles simultaneously.

Note that because the changes affect all the virtual consoles, they also outlive your session. This means that even at the login prompt the key bindings may not be what the user expects.  

FILES

/lib/kbd/keymaps
default directory for keymaps
/usr/src/linux/drivers/char/defkeymap.map
default kernel keymap

SEE ALSO

dumpkeys(1), keymaps(5)

责任编辑:韩亚珊 来源: www.linuxforum.net/man-pages/
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 15:39:42

fcloseall中文man

2011-08-25 15:00:15

cfgetispeed中文man

2011-08-19 18:35:50

issue中文man

2011-08-25 17:03:51

pclose中文man

2011-08-25 17:40:25

setvbuf中文man

2011-08-23 14:21:16

poweroff中文man

2011-08-24 15:52:59

intro中文man

2011-08-23 13:40:31

2011-08-25 15:54:08

ferror中文man

2011-08-25 17:24:54

puts中文man

2011-08-25 18:34:55

ungetc中文man

2011-08-23 10:03:40

useradd中文man

2011-08-23 10:29:02

chpasswd中文man

2011-08-23 10:34:22

convertquot中文man

2011-08-23 15:39:34

rpmbuild中文man

2011-08-24 15:48:38

INSERT中文man
点赞
收藏

51CTO技术栈公众号