add files about keymaps and xmodmap

This commit is contained in:
geekard
2012-11-19 20:58:04 +08:00
parent 6642e173f9
commit 411a288513
17 changed files with 3033 additions and 88 deletions

Binary file not shown.

View File

@@ -1,10 +1,10 @@
[History]
list=[["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2874,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5757\u7f13\u51b2\u533a\u548c\u5757\u7f13\u51b2\u533a\u5934",356,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5757\u7f13\u51b2\u533a\u548c\u5757\u7f13\u51b2\u533a\u5934:buffer cache",2108,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:Virtual file system",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:The Virtual File System in Linux",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:Linux\u6587\u4ef6\u7cfb\u7edfFAQ",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:GIO",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:Filesystem in Userspace (FUSE)",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:The Virtual File System in Linux",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5757\u7f13\u51b2\u533a\u548c\u5757\u7f13\u51b2\u533a\u5934",356,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5757\u7f13\u51b2\u533a\u548c\u5757\u7f13\u51b2\u533a\u5934:buffer cache",2108,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5982\u4f55\u5b9e\u73b0\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf",15137,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u89e3\u6790 Linux \u4e2d\u7684 VFS \u6587\u4ef6\u7cfb\u7edf\u673a\u5236",0,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76",1434,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2874,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf",0,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2874,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76",1434,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2875,null],["\u5185\u6838\u5f00\u53d1:Linux2.6.16\u7684\u542f\u52a8\u8fc7\u7a0b",0,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2493,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76",2075,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2493,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76",5340,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:The Page Cache FAQ",null,null]]
list=[["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",4502,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",187,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",145,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki KEYMAPS",1701,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",187,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",145,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",877,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",145,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",944,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",125,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki KEYMAPS",2508,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",637,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",914,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",914,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",914,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",983,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",2995,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps:personal.map",178,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",4928,null]]
current=24
recent=[["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:The Virtual File System in Linux",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5757\u7f13\u51b2\u533a\u548c\u5757\u7f13\u51b2\u533a\u5934",356,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5757\u7f13\u51b2\u533a\u548c\u5757\u7f13\u51b2\u533a\u5934:buffer cache",2108,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u5982\u4f55\u5b9e\u73b0\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf",15137,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf:\u89e3\u6790 Linux \u4e2d\u7684 VFS \u6587\u4ef6\u7cfb\u7edf\u673a\u5236",0,null],["\u5185\u6838\u5f00\u53d1:linux\u6587\u4ef6\u7cfb\u7edf",0,null],["\u5185\u6838\u5f00\u53d1:Linux2.6.16\u7684\u542f\u52a8\u8fc7\u7a0b",0,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:Page Cache",2493,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76",5340,null],["\u5185\u6838\u5f00\u53d1:Linux Cache \u673a\u5236\u63a2\u7a76:The Page Cache FAQ",null,null]]
recent=[["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04",43,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:\u66f4\u6539\u952e\u76d8\u5e03\u5c40(vitual terminal\u548cX\u7a0b\u5e8f)",0,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps:dumpkeys",75,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps:dumpkeys -l",14500,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki KEYMAPS",2508,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps",13256,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:wiki xmodmap",2995,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:keymaps:personal.map",178,null],["Utils:\u952e\u76d8\u5e03\u5c40\u548c\u6309\u952e\u6620\u5c04:xmodmap",4928,null]]
[MainWindow]
windowsize=[1600,836]
windowsize=[1278,779]
show_sidepane=True
sidepane_pos=316
show_menubar=True
@@ -16,10 +16,15 @@ show_statusbar_fullscreen=False
pathbar_type=recent
pathbar_type_fullscreen=none
readonly=False
windowpos=[-4,-4]
windowpos=[0,19]
toolbar_style=None
toolbar_size=tiny
active_tabs=["Index",null,null,"Attachments"]
toggle_panes=[]
left_pane=[true,222,"Index"]
right_pane=[false,200,null]
top_pane=[false,200,null]
bottom_pane=[false,200,null]
[ImportPageDialog]
windowsize=[500,400]

View File

@@ -2,9 +2,9 @@ Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2011-11-17T17:36:30+08:00
====== Fcitx ======
====== Fcitx--过时 ======
Created Thursday 17 November 2011
https://wiki.archlinux.org/index.php/Fcitx_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29
https://wiki.archlinux.org/index.php/Fcitx_%28简体中文%29
==== Contents ====
@@ -31,14 +31,13 @@ Fcitx (Free Chinese Input Toy for X) ──即小企鹅输入法 ,它是一个
使用 FCITX 之前,你必须先进行环境设定,不过这并不难.
打开你主文件夹(/home/XXX下的 .bashrc文件添加以下几行
打开你主文件夹(/home/XXX下的 .bashrc文件添加以下几行
#setup** XIM environment**, needn't if use SCIM as gtk-immodules
#setup** XIM environment**, needn't if use SCIM as gtk-immodules
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
注意如果使用scim则上述的xim需改为scim因为 fxitx基于xim而scim不是。
重新登录以使其生效.
注意如果使用scim则上述的xim需改为scim因为 fxitx基于xim而scim不是。重新登录以使其生效.
重新登录后,打开一个终端, 输入:
@@ -108,7 +107,7 @@ export QT_IM_MODULE=xim
关于 locale 的详情,请参阅 Google.
=== 注意: ===
=== 注意: ===
其实在英文环境下并__不需要__将 LC_CTYPE 变量设为中文的locale(但是**emacs例外**)。也就是说,完全不用设置 locale ,也能照样使用中文输入法。如果 ~/.bashrc or ~/.xinitrc 文件中,已经有了:

View File

@@ -0,0 +1,110 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T10:18:22+08:00
====== fcitx ======
Created Monday 19 November 2012
https://wiki.archlinux.org/index.php/Fcitx_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
Fcitx (Flexible Input Method Framework) ──即小企鹅输入法,它是一个以 GPL 方式发布的输入法平台(即原来的 G 五笔),包括五笔、拼音(全拼和双拼)、二笔、区位等输入模块,支持简入繁出,是在 Linux 操作系统中常用的中文输入法。它的优点是,短小精悍、跟程序的兼容性比较好。
===== 安装 FCITX =====
它在 extra 库中,可以用以下命令安装:
# pacman -S fcitx
__自从4.1.0, Fcitx提供了它自己的input method module, fcitx-gtk2, fcitx-gtk3 and fcitx-qt, 建议使用它们而不是直接使用xim。方法是下面定义环境变量时GTK_IM_MODULE和QT_IM_MODULE值为fcitx而不是xim。__
为了在gtk与qt程序中获得良好的输入体验(例如光标跟随与显示预编辑字符串)并避免一些xim无法解决的bug, 请根据需要安装对应的输入法模块
**# pacman -S fcitx-gtk2 fcitx-gtk3 fcitx-qt**
风波因云帆论坛有人批评Fcitx代码写的很差作者于2007年7月10日决定终止了本项目。但随即有人宣布接手。现在该项目代码已经转移到了 GitHub 上面https://github.com/fcitx/fcitx )。
当前的最新版本是其 git 版,即 fcitx-git。可以从 AUR 上安装 (已包含全部输入法模块)
$ yaourt -S fcitx-git
===== 使用 FCITX 输入中文 =====
使用 FCITX 之前,你必须先进行环境设定:
如果你采用KDMGDMLightDM在~/.xprofile中加入(没有则新建一个)
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
采用startx启动或者Slim(使用.xinitrc的场合):在~/.xinitrc中加入
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
重新登录后,打开一个终端, 输入:
fcitx &
为检验 fcitx 是否正常运行, 打开一个程序,比如 leafpad, 按 CTRL+Space 激活 FCITX 并试着输入几个字.
===== 跟随桌面环境自动启动 =====
对于支持 xdg 标准的桌面环境,例如 gnomekdexfcelxdeFcitx包已经包含了用于自动启动的 desktop 文件 /etc/xdg/autostart/fcitx-autostart.desktop 如果需要禁用自动启动或者调整自动启动的参数, 请用桌面环境提供的自动启动工具配置或者复制自动启动文件到用户目录后手动编辑
cp /etc/xdg/autostart/fcitx-autostart.desktop ~/.config/autostart/
===== 全局配置文件说明 =====
默认情况下fcitx配置文件的存放位置尽量接近XDG标准用户配置目录一般为~/.config/fcitx首次运行时fcitx会自动创建该目录)。
Fcitx从4.0开始提供了图形界面的配置程序, 其AUR包分别为__fcitx-configtool__(基于gtk3), fcitx-configtool-gtk2(基于gtk2), kcm-fcitx(基于KDE的KCM). 不再推荐手动编辑配置文件以免出现问题.
===== 常用快捷键 =====
=== 内置快捷键 ===
ctrl+5 重启
ctrl+6 删除词语
ctrl+7 增加词语
可配置快捷键,请编辑~/.config/fcitx/config
Warning: 建议使用图形界面,如果直接编辑配置文件,请务必小心
=== [Hotkey] ===
#中英文切换
SwitchKey=L_CTRL
#全角半角
FullWidthSwitchKey=SHIFT_SPACE
#符号切换
PuncSwitchKey=CTRL_.
=== [Output] ===
#切换到英文时,编码上屏
SendTextWhenSwitchEng=True
==== 禁用输入法 ====
或许你并不希望看到一些输入法,比如双拼。那么你可以在配置界面里禁用相应的输入法
==== 扩充拼音词库 ====
用户配置拼音词库是在~/.config/fcitx/pinyin下其中pybase.mb是拼音单字库 pyphrase.mb拼音词库如果这两文件没有那么fcitx就读取此目录/usr/share/fcitx/pinyin,将你下载的词库放置到此目录后重启ctrl+5fcitx就可以了。
mv pybase.mb pyphrase.mb ~/.config/fcitx/pinyin/
Vim
如果你经常在vim下使用fcitx,那么在~/.vimrc 添加如下代码可实现退出插入模式时关闭fcitx进入插入模式时启用fcitx
"##### auto fcitx ###########
let g:input_toggle = 1
function! Fcitx2en()
let s:input_status = system("fcitx-remote")
if s:input_status == 2
let g:input_toggle = 1
let l:a = system("fcitx-remote -c")
endif
endfunction
function! Fcitx2zh()
let s:input_status = system("fcitx-remote")
if s:input_status != 2 && g:input_toggle == 1
let l:a = system("fcitx-remote -o")
let g:input_toggle = 0
endif
endfunction
set timeoutlen=150
"退出插入模式
autocmd InsertLeave * call Fcitx2en()
"进入插入模式
autocmd InsertEnter * call Fcitx2zh()
"##### auto fcitx end ######
Troubleshooting:
==== 注意: ====
当LC_CTYPE为英文时, 会出现Emacs下无法使用输入法的情况, 如出现此情况, 请在__启动Emacs时将LC_CTYPE设为zh_CN.UTF-8__. (终端下使用emacs无此问题, 输入法会由终端程序处理).
===== 输入法模块input module =====
Warning: 即使未安装输入法模块, 一般还是可以在大部分程序中使用输入法, 不过很可能出现从无法光标跟随, 无法显示预编辑字符串, 到无法输入甚至程序卡死等情况. 如无特殊情况请安装全部输入法模块
Warning: firefox升级到13后可能与xim发生冲突造成菜单无法弹出等问题安装fcitx-gtk2可以解决.

View File

@@ -0,0 +1,802 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T10:36:25+08:00
====== 小企鹅输入法 ======
Created Monday 19 November 2012
http://fcitx.github.com/handbook/fcitx.html
版权 © 2005, 2006, 2007, 2008, 2009, 2010 Yuking
摘要
小企鹅中文输入法Free Chinese Input Toy for Xfcitx 是一个以GPL方式发布的输入法框架 编写它的目是为桌面环境提供一个灵活的输入方案。
===== 术语表 =====
候选字词窗口
也叫候选词窗口或者候选窗口。
在非英文直接上屏的输入情况下, fcitx 会根据你输入的编码列出一个或者多个候选字或词, 这个显示候选词的窗口就叫候选字词窗口。
软键盘
在主窗口上点击软键盘按钮会出现软键盘。 利用软键盘可以输入一些特殊字符, 比如半角全角英文字符和标点、希腊字母、俄文字母、数字序号、数学符号、数字符号、日文平假名、日文片假名、制表符等。
上屏
输入的文字实际输入到屏幕上。 比如,在候选字词窗口上选择一个字或词后,被选择的字或词实际输入到了屏幕上的文本框内。
通知区域
见系统托盘.
托盘
见系统托盘.
托盘图标
见系统托盘图标.
系统托盘
桌面环境中常用来显示通知的区域,通常位于桌面的右上角或者右下角。
系统托盘图标
程序显示在托盘中的图标, 特指 fcitx 在托盘中显示的图标。 可以通过用鼠标点击它来控制程序的行为。
参见系统托盘图标。
主窗口
fcitx 启动后,出现的一个左侧带有徽标的窗口, 在徽标后面依次可能有一些按钮, 比如显示当前的输入法、简繁状态、全角半角状态、中文标点状态、软键盘和联想状态等的按钮。
===== 部分 I. 软件概述 =====
小企鹅中文输入法Free Chinese Input Toy for Xfcitx是一个以 GPL 方式发布的__输入法框架__ 编写它的目是为桌面环境提供一个灵活的输入方案。
本程序目前可以支持__XIM和GTK2GTK3QT4的IM Module__可为支持 XIM 的 X 应用程序提供输入服务(__自从4.1.0, Fcitx提供了它自己的input method module, fcitx-gtk2, fcitx-gtk3 and fcitx-qt, 建议使用它们而不是直接使用xim。方法是下面定义环境变量时GTK_IM_MODULE和QT_IM_MODULE值为fcitx而不是xim。,注意fcitx自带的im以来DBus所以在启动fcitx前需确保DBus已经启动__)。 fcitx 的源码包内提供了区位和全/简/双拼,并支持基于码表的输入法(自带五笔、二笔和仓颉等输入码表)。
您可以从 http://fcitx.googlecode.com 下载最新的发布版本。
如果您有兴趣尝试 fcitx 最新功能, 可以用以下方式从代码仓库中获取代码(这样得到的代码可能并非是正式发布的版本):
hg clone https://fcitx.googlecode.com/hg/ fcitx
===== 部分 II. 安装配置 =====
fcitx 通常以源码的方式发布,您需要编译安装后才能使用。具体参见附录中的编译安装流程。
===== 1.2. 从预编译包安装 =====
各发行版如果提供了预编译的 fcitx用户可以从对应的软件源直接下载预编译的 fcitx 包进行安装。
===== 第 2 章 配置环境 =====
各大发行版都有提供自己的__输入法选择工具__并且在打包时提供了额外的配置脚本。 在具体使用的时候请尽量使用发行版提供的工具而不是自己配置输入法。__下面的im是input module的缩写一般为xim.但是由于fcitx提供了自己的input module(需要在编译时指定相关的参数)所以其值也可以是fcitx.__
Fedora使用im-chooser图形界面
DebianUbuntuim-switch执行 im-switch __-s fcitx__im-config图形界面
OpenSUSE~/.profile中加入export INPUT_METHOD="fcitx"
如果你并非使用以上列出的发行版,那么你可以按照你启动桌面的方式选择配置。
采用KDMGDMLightDM在~/.xprofile中加入(没有则新建一个)
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx # 或者是xim取决于你是否编译了对应的输入法模块
export QT_IM_MODULE=fcitx # 或者是xim取决于你是否编译了对应的输入法模块
采用startx启动或者Slim(使用.xinitrc的场合):在~/.xinitrc中加入
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx # 或者是xim取决于你是否编译了对应的输入法模块
export QT_IM_MODULE=fcitx # 或者是xim取决于你是否编译了对应的输入法模块
如果你需要使用im module(即上面提到的fcitx-gtk2, fcitx-gtk3, fcitx-qt)__你需要保证dbus正确初始化__。如果你的fcitx启动输出中包含了dbus相关的错误请在你的启动脚本开头加入
eval `dbus-launch --sh-syntax --exit-with-session`
===== 第 3 章 跟随桌面环境自动启动 =====
对于支持 xdg 标准的桌面环境,例如 gnomekdexfcelxde 可以将文件 安装目录/share/applications/fcitx.desktop 建立符号链接或者复制到 ~/.config/autostart/ 或者 /etc/xdg/autostart/usr/local/etc/xdg/autostart/ 目录里:
ln -s 安装目录/share/applications/fcitx.desktop ~/.config/autostart/fcitx.desktop
如果你采用独立的窗口管理器例如OpenboxXMonad等等。 不建议在~/.xinitrc 当中直接执行fcitx而建议是采用这些窗口管理器的自动启动机制。 如果你希望使用IM Module但是无法正确初始化DBusIM Module依靠DBus进行通信那将可能导致无法在GTK和QT程序中启用输入法。
===== 第 4 章 全局配置文件说明 =====
默认情况下fcitx配置文件的存放位置尽量接近XDG标准用户配置目录一般为~/.config/fcitx首次运行时fcitx会自动创建该目录)配置文件名为config。fcitx从4.0开始可以安装配置程序进行配置,程序将自动修改配置文件中的内容。
配置文件在安装了fcitx-config-gtk之后基于gtk的配置编辑器或者kcm-fcitx基于KDE的KCM Module的配置编辑器可以不用手动编辑。
如果您需要进行手动编辑,请参考配置文件中的注释,以及对应的配置文件描述文件
===== 部分 III. 功能说明 =====
目录
5. 输入法
5.1. 拼音输入法
5.1.1. 常用字表
5.1.2. 双拼输入
5.1.3. 以词定字
5.1.4. 特殊符号输入
5.1.5. 制作拼音库
5.2. 区位输入法
5.3. 码表输入法
5.3.1. 制作码表
5.3.2. 反查拼音
6. 中文标点
7. 快速输入
8. 系统托盘图标
9. 皮肤
10. 通过命令控制Fcitx
11. 其它功能
第 5 章 输入法
目录
5.1. 拼音输入法
5.1.1. 常用字表
5.1.2. 双拼输入
5.1.3. 以词定字
5.1.4. 特殊符号输入
5.1.5. 制作拼音库
5.2. 区位输入法
5.3. 码表输入法
5.3.1. 制作码表
5.3.2. 反查拼音
5.1. 拼音输入法
支持全/简/双拼,双拼可自定义键盘方案
支持常用字表
特殊符号输入
完善的预编辑
支持以词定字
模糊拼音
5.1.1. 常用字表
设置常用字表的目的是为了方便录入某些常用字。
在候选字中,处于该表中的字总是排在其它字的前面。 fcitx的默认常用字表是空的。您可以用左ctrl+8/7来添加/删除常用字。 例如您希望录入“d”时“的”总放在第一个可以按一下操作
进入拼音状态。
输入“d”用翻页键-=/,.查找“的”字直到它显示在候选字表中按ctrl+8 然后按“的”前面的数字序号即可。
按上述操作可以为某个拼音编码设置多个常用字。您可以设置常用字表内的字频调节方式。
5.1.2. 双拼输入
如果在配置文件中打开双拼选项,即可进行双拼输入。 程序默认采用自然码的双拼方案,您也可以自定义键盘方案。 如果需要自定义,请将存放双拼方案的文件放在 ~/.config/fcitx下并重命名为sp.dat。 程序源码包中的data目录下有一个名为sp.dat的文件该文件已经定义了一些双拼方案 修改“默认方案”即可以使用用户指定的方案。请注意,模糊拼音的设置也会在双拼中生效。
5.1.3. 以词定字
fcitx支持“以词定字”以方便录入某些排序比较靠后的字。 利用SHIFT_<词组序号>,按以词定字键(默认为'['/']')选择该词组的第一个或最后一个字。
比如在默认设置下如果需要录入“亥”字可以输入“jh” 按翻页键让词组“己亥”显示在输入条上, 然后按SHIFT_<它前面的序号> 再按‘]’即可(如果按‘[’则是输出“已”字)。
5.1.4. 特殊符号输入
为了录入特殊符号,您必须将特殊符号按下列格式放在一个文件中:
<编码> <符号>
每个符号占一行。 编码部分必须是英文小写字母且经拼音解析后的长度不应超过10个汉字(如zzz是3个汉字长度 而zhangzhangzhang也是3个汉字长度) fcitx的源码包中有一个例子(文件pySym.mb)。
编辑好特殊符号后将其保存为文件pySym.mb并放在 ~/.config/fcitx 中重新启动fcitx即可。
建议:特殊符号的编码应该足够长,免得影响正常的汉字录入。
注意:如果定义的编码与常用字表的编码相同,该特殊符号将无法使用。
如果要录入“西安”这样的词组,请用单引号作为分隔符(xi'an)。
5.1.5. 制作拼音库
在tools目录下提供了一个制作拼音库的工具createPYMB。用法如下
./createPYMB {拼音单字库} {拼音词组库}
该工具将在当前目录下生成pybase.mb和pyphrase.mb 将它复制到您的fcitx安装目录下的share/fcitx/data中替换原有文件 或者放到~/.config/fcitx/pinyin 可以重命名但后缀需要是mb即可。
在源码包的data目录下包括了单字库和词组库文件名为gbkpy.org和pyPhrase.org。 它们都是文本文件。一般说来单字库无需更改您可以将自己的词组加入到pyPhrase.org中从而生成自己的词库。
5.2. 区位输入法
fcitx支持0~9的区位输入。
5.3. 码表输入法
fcitx支持用户自定义码表输入法。
系统的码表放置在prefix/share/fcitx/data/table/*.conf 用户的码表和配置放置在~/.config/fcitx/table/*.conf
该文件用“[CodeTable]”来区分不同的码表。其它设置说明如下:
[CodeTable]
Name名称显示在程序主窗口的输入法名称。
IconName图标名称皮肤中对应图标文件名。
File码表文件该码表输入法的码表文件名程序会先查找 ~/.config/fcitx/table然后在安装目录中找。
AdjustOrder调频与拼音中的相应设置意义一样。
Priority优先级码表输入法的优先级排序。
UsePY使用拼音是否使用临时拼音输入。
PYKey拼音键如果“拼音”选项打开则以该字母起头的输入按全拼处理。
AutoSend自动上屏当输入达到最大码表且只有一个候选词时是否自动上屏。
NoneMatchAutoSend空码自动上屏空码时出空码前的内容。比如说abcd是空码而abc不是那么打abcd时就将abc的内容自动上屏d留在提示行中待处理。
UseMatchingKey使用模糊键是否使用模糊(通配符)输入。
MatchingKey模糊键模糊键(通配符)。
AutoPhrase自动词组是否使用自动组词功能(后面有详细说明)。
AutoPhraseLength自动词组长度。
AutoPhrasePhrase词组参与自动造词指定录入的词组是否参与自动组词。
SaveAutoPhrase保存自动词组设定自动生成的词组被选择多少次后才被保存。0表示不保存。
ExactMatch精确匹配是否只在候选字表中显示精确匹配的结果。
PromptTableCode提示编码是否提示录入字/词的编码。
Symbol符号设置该选项则开启特殊符号输入功能。
SymbolFile符号文件特殊符号所在的文件。
Enabled是否启用该码表。
码表输入法提供了两种在线造词方法(词组最长为10个汉字)
在中文输入方式下按CTRL_8则利用将刚刚输入的内容造词默认为最近输入法两个字可以用左右方向键的增加或减少词组中的字数。
自动组词:将需要造的词按单字连续输入后,再按它的组词规则连续输入编码,程序会提示用户这个新词。 如果此时按空格或它前面的序号则将这个新词输入到用户程序中,您可以设置这个新词是否进入词库。 如果不想录入该词,继续进行下一次输入即可(fcitx会记录最近2048个输入的汉字)。
如果想删除词库中的词先让该词显示中输入条上按CTRL_7并按提示操作即可或是当程序提示有该词组时按CTRL_DEL删除。
如果想调整词库中词的顺序按CTRL_6并按提示操作即可。(如果调频设置为1或2您可能看不到有什么变化)。
5.3.1. 制作码表
data目录下包括制造码表的工具txt2mb和mb2txt。 前者是将码表源文件转换为码表输入法所需的格式;后者是将码表文件转换为文本文件。码表源文件格式如下:
;fcitx 版本 0x03 码表文件
键码=abcdefghijklmnopqrstuvwxy
码长=4
规避字符=;iuv
拼音=@
拼音长度=12
[组词规则]
e2=p11+p12+p21+p22
e3=p11+p21+p31+p32
a4=p11+p21+p31+n11
[数据]
a 工
a 戈
a 或
a 其
@a 阿
@a 啊
@a 呵
键码:表示该码表输入法需要用的键;
码长:指该码表输入法最长码长;
规避字符:在象二笔这样的码表输入法中,某些字符如果出现在编码的第一个,表示特殊用途,虽然可以组成单字,但却不参与组词。如果有这样的字符,可以列在这个地方,以免自动造词出错;
拼音:以此字母开头的为拼音;
拼音长度:表示该码表中拼音的最长长度;
[组词规则]:表示自动组词的规则,如果没该标志,则不能在线造词;
组词规则的数目应该比码长小1。
等号左边为词组的汉字个数。其中e表示“等于”a表示“大于等于”(只能有这两个设置)。
等号右边为规则其中p指正序n指逆序。如p11指第一个字的第一个编码n11则是指最后一个字的第一个编码。
[数据]:该标志以下为该码表输入法的数据,按“编码<空格>对应的汉字”。这部分无需排序。
按上述格式制作好编码后利用txt2mb将其转换为fcitx需要的格式
./txt2mb {源文件} {目标文件}
然后将目标文件复制到~/.config/fcitx/table中 并在~/.config/fcitx/table/中建立对应conf文件 然后在中文输入状态下按CTRL_5重新读入配置文件即可。
如果希望将已经制作好的码表文件转换为文本文件,可以:
./mb2txt {码表文件} [ > 文本文件]
生成的文本文件将形如上述码表源文件的格式。
在码表输入法模式下,只输入单个“拼音键”指定的字符可以重复上次的录入。
5.3.2. 反查拼音
如果不知道某个汉字的读音可以先用码表输入法录入这个字然后按反查拼音的热键默认为CTRL_ALT_E就可以查到该字的读音。
第 6 章 中文标点
fcitx的中文标点由一个文本文件设置您可以根据自己的需要修改。 该文件即<fcitx的安装目录>/share/fcitx/data/punc.mb或用户配置目录下的punc.mb。格式如下
对应的英文符号 中文标点 <中文标点>
其中英文符号应该是类似“&*()”这样的符号,而中文标点最长为两个汉字,最多有两组,中间由空格隔开。如:
_ ……
" “ ”
第 7 章 快速输入
当配置文件中的“分号键行为”设置为2时按下分号键则进入快速输入模式。 在这种模式下,您可以设置某些常用短语或符号的快速录入规则。
为了使用该功能,您需要将常用短语和符号按如下格式编辑
<字符组合> <短语>
并保存在用户配置目录data/QuickPhrase.mb或fcitx的安装目录下的share/data一个短语一行。如
zg 中华人民共和国
h http
第 8 章 系统托盘图标
当启用系统托盘图标的选项时,启动 fcitx 后系统托盘区域显示一个托盘图标,您可以通过用鼠标点击它来控制程序的行为:
单击右键可以显示菜单,左键激活输入法。
第 9 章 皮肤
fcitx从4.0开始支持皮肤功能,皮肤安装在 ~/.config/fcitx/skin用户目录 和PREFIX/share/fcitx/skin下面。 皮肤的配置需要建立一个目录放置所有相关文件,以及放置一个名为 fcitx_skin.conf的配置文件。 如果您需要创建一个新的皮肤,建议参考自带已有的三个皮肤的配置。并使用配置工具帮助配置。
对于Fcitx皮肤的图片来说采用了和CSS类似的盒模型每个图片分为9个区域边界区域采用距离上右的边界的四个值确定。Fcitx的皮肤里面的数字是全部是采用像素作为单位包括字体大小以免定位受到dpi的影响
菜单的是完全默认的盒模型,中间区域的大小完全根据菜单内容大大小进行变化修改。
输入条有两种模式(横,竖)
在横排模式下输入条的高度为Margin Top + Margin Bottom + Output Pos需要注意的是Output Pos是相对于中间区域的纵坐标而不是相对于整个输入框的位置。在竖排模式下 Output Pos代表的是第一行左下角的纵坐标的位置。
主窗口由于其中的按钮个数是可以由插件加入的因此从4.1之后也开始采用盒模型。默认情况图标保持单排。高度是图标图片中的最大值。对于还想要实现4.0时候不规则的排列的人来说可以通过Placement这个属性进行设置规则是图标名称:横坐标,纵坐标;图标名称:横坐标,纵坐标....每一项之间由分号分隔。没有出现在Placement当中的图标或者对应图片文件无法加载的图标不会显示。除了输入法图标和logo图标之外剩下的图标的图片名称是固定的一律按照“状态名称_active.png” “状态名称_inactive.png”。在Placement中logo采用的名称是logo输入法指示图标采用的名称是im。在采用了Placement属性进行布局时主窗口的大小就是主窗口图片的大小和Margin边距无关。下面是一个Placement的范例。
Placement=logo:4,30;punc:49,30;chttrans:27,53;fullwidth:20,5;im:45,4
Fcitx自带的属性图标的名称如下logoimvkchttranspuncfullwidthlegend。
第 10 章 通过命令控制Fcitx
fcitx提供了一个基于socket的工具fcitx-remote可以用于控制fcitx
具体命令参数参见fcitx-remote -h 和 man
一个实用的例子是用它自动控制vim的输入状态
let g:input_toggle = 1
function! Fcitx2en()
let s:input_status = system("fcitx-remote")
if s:input_status == 2
let g:input_toggle = 1
let l:a = system("fcitx-remote -c")
endif
endfunction
function! Fcitx2zh()
let s:input_status = system("fcitx-remote")
if s:input_status != 2 && g:input_toggle == 1
let l:a = system("fcitx-remote -o")
let g:input_toggle = 0
endif
endfunction
set timeoutlen=150
autocmd InsertLeave * call Fcitx2en()
"autocmd InsertEnter * call Fcitx2zh()
将上面的代码加入 ~/.vimrc 中,可以实现退出插入模式时自动关闭输入法。去掉最后一行的注释可以实现进入插入模式自动启用输入法。
第 11 章 其它功能
可以任意拖动fcitx显示的图标和输入条当处于光标跟随模式时输入条的位置将根据用户程序输入点而决定
可以用鼠标左键单击输入条的相应部分切换输入法/改变标点状态/改变全半角设置/改变联想状态/在简繁输出间切换。
支持UTF8方式下的中文输入。
在主窗口上按鼠标右键可以切换主窗口的显示模式。有两种:简洁模式和完整模式。
按CTRL_5可以重新读取配置文件向fcitx发送SIGHUP也可以重新读取配置文件。
在联想方式下,按第二选择键输出半角空格,按第三选择键输出全角空格。
单击企鹅图标可以改变输入法的状态。
===== 部分 IV. 附录 =====
目录
12. 热键
13. 相关项目
14. 编译安装流程
14.1. 依赖
14.2. 安装
14.3. 卸载
15. 常见问题
第 12 章 热键
您可在fcitx的配置文件中使用以下热键
LCTRL LSHIFT LALT
RCTRL RSHIFT RALT
INSERT
HOME END
PGUP PGDN
CTRL_CTRL CTRL_LSHIFT CTRL_LALT CTRL_RSHIFT CTRL_RALT
SHIFT_LCTRL SHIFT_SHIFT SHIFT_LALT SHIFT_RCTRL SHIFT_RALT
ALT_LCTRL ALT_LSHIFT ALT_ALT ALT_RCTRL ALT_RSHIFT
其中L前缀表示左键R前缀表示右键。 如果需要CTRL/ALT+<字母/数字>的组合键直接写入数字或字母即可如CTRL_K等。
第 13 章 相关项目
目前一些相关的子项目分别host在Fcitx的googlecode和github上。
fcitx-googlepinyinAndroid上的Google拼音的非官方移植。GoogleCode
fcitx-sunpinyinFcitx的Sunpinyin支持GoogleCode
fcitx-cloudpinyin为Fcitx的拼音输入法增加一个来自SogouQQ或Google云输入法的候选词。Github
fcitx-ui-lightfcitx-classic-ui的再fork使用Xft和Xlib进行渲染提供类似Fcitx 3.6 时代的界面支持Github
fcitx-handwriting采用zinnia的Fcitx手写支持。Github
fcitx-config基于GTK的配置工具GoogleCode
kcm-fcitx基于KDE的配置工具Github
fcitx-fbterm提供fbterm下的输入支持。Github
===== 第 14 章 编译安装流程 =====
摘要
fcitx 通常以源码的形式发布,您需要编译安装后才能使用。
目录
14.1. 依赖
14.2. 安装
14.3. 卸载
14.1. 依赖
编译 fcitx 按照您需要的功能,需要(且不限于)以下包及其对应开发包,开发包在发行版中多以-dev或者-devel结尾
gcc
gtk2gtk3的IM Module需要gtk2gtk3以及__dbus-glib__
qt的IM Module需要qt4libicu
fcitx-classic-ui支持皮肤的默认界面fcitx-vk虚拟键盘需要libx11xlibcairo可选项为pango
fcitx-kimpanel-ui需要dbus
fcitx-chttrans简繁转换可选项为OpenCC
14.2. 安装
首先下载 fcitx 的源码包,文件名为 fcitx-4.1.0.tar.bz2存放在某个临时的目录中如 /temp )。执行:
cd <临时目录>
tar jxvf fcitx-4.1.0.tar.bz2
这样会在临时目录(如 /temp )目录下建立目录 fcitx-4.1.0,所有的源码都在该目录中。
执行以下命令编译安装:
cd fcitx-4.1.0
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<安装目录>
make && make install
cmake 可选项On/Off
-__DENABLE_DBUS__
如果禁用DBus同时不会编译任何的IM Module
-DENABLE_CAIRO
如果禁用将无法使用fcitx-classic-ui
-DENABLE_PANGO
如果禁用,将不使用 pango 进行字体绘制,将只能支持单一字体显示(在字符集不足时)。
-DENABLE_TABLE
如果禁用,将不编译及生成码表相关数据
-__DENABLE_GTK2_IM_MODULE__
如果禁用将不编译GTK2的IM Module
-__DENABLE_GTK3_IM_MODULE__
如果禁用将不编译GTK3的IM Module
-__DENABLE_QT_IM_MODULE__
如果禁用将不编译QT4的IM Module
-DENABLE_OPENCC
如果禁用将不使用OpenCC作为简繁转换的后端
14.3. 卸载
如果你 cmake 之后产生的文件都还在。 用 root 权限执行 make uninstall 即可卸载了。 如果 cmake 之后的目录已经被你删除了那就把代码重新下载下来cmake 之后 make uninstall。
第 15 章 常见问题
15.1. 遭遇了4.1之前不曾遇到的输入问题(非输入法不能启用,而是例如删除文本错误,或者已经启用输入法但是无法输入)
15.2. 编译时说找不到文件X11/Xlib.h
15.3. 编译安装完成后按ctrl_space无法打开fcitx的输入条啊
15.4. 界面的颜色怎么那么难看?
15.5. 我将fcitx加到gnome的自动启动后gnome怎么启动那么慢
15.6. 为什么有时候fcitx会卡几秒
15.7. 为什么我只按了一个键,输入条上却出现两个相同的字符?
15.8. 当我使用en_US.UTF-8时为什么无法激活fcitx
15.9. fcitx的默认字体并不是我常用字体
15.10. 有些皮肤周围为什么有不透明的黑边
15.11. fcitx启动后图标背景为黑色但关闭后手动启动背景颜色正常
15.12. 有时Firefox中输入的第一个字母会丢失
15.13. fcitx在某些的程序中无法光标跟随/光标跟随存在问题
15.14. 在flash中无法输入
15.15. 我对于fcitx拼音词库很不满
15.16. 我是kde4用户kimpanel的问题太多了可是我又想界面协调
15.17. 我想输入日语怎么办?
15.18. 我想输入颜文字
15.19. 我在使用vnc/nomachine远程连接时fcitx好像不太好使
15.20. 我发现了 fcitx 的 bug 怎么办?
15.1.
遭遇了4.1之前不曾遇到的输入问题(非输入法不能启用,而是例如删除文本错误,或者已经启用输入法但是无法输入)
如果是gtk或者qt程序的问题请先尝试ctrl+alt+p关掉预编辑嵌入模式。
如果是x程序请尝试关掉xim的On The Spot支持需要重启输入法
15.2.
编译时说找不到文件X11/Xlib.h
这个信息是说编译程序没有找到X的头文件一般是因为您没有安装X的开发包在RH/MDK中名为XF*-devel-*或xorg-*-devel-*)。
15.3.
编译安装完成后按ctrl_space无法打开fcitx的输入条啊
这个的原因有很多并且十分复杂。你可能需要一一排查以下情况:
如果其他程序可以成功使用fcitx只有单独某个程序不能使用那么也许是ctrl space的快捷键被抢占了想办法设置保证不冲突。
如果一类程序GTK或者QT或者全部的程序都不能输入你需要检查环境变量。
打开一个终端,输入
echo $XMODIFIERS
echo $GTK_IM_MODULE
echo $QT_IM_MODULE
检查是不是你想要的值。具体值参见配置环境。 如果是先尝试从终端中启动程序看是否可以输入。如果不可以有以下可能你的locale没有生成需要通过 locale -a 查看你当期的locale是否存在。
对于GTK程序可以通过 gtk-query-immodules-2.0/gtk-query-immodules-3.0 检查是否有 xim 以及 fcitx 。如果有,但是不能输入,你也许应该继续检查 /etc/gtk-2.0/gtk.immodules 和 /usr/lib/gtk-3.0/3.0.0/immodules.cache 不同发行版和cpu架构可能路径不同 是否和之前的命令输出相同。如果没有 xim 模块这一般出现在opensuse上因为它单独打包了xim的im module
如果终端中启动的程序可以但是桌面启动的程序不行那么你的环境变量可能仅仅设置在shell里面而不是启动桌面的时候设置的环境变量可以管用的位置有 ~/.xprofile 通过gdm或者kdm启动时或者 ~/.xinitrc 通过slim或者startx启动时
检查 GTK 程序使用的输入模块。首先开启一个普通的gtk程序不可以是firefox比如gtk-demo就是一个不错的选择。在输入框右键单击在输入法菜单里面检查是否是xim或者fcitx如果不是那么说明gtk没有选择fcitx支持的方式进行输入。需要设置 GTK_IM_MODULE=xim 或者 fcitx 4.1以后)才可以。
检查 QT 程序使用的输入模块。执行qtconfig 看选中的输入法模块可以使用的是xim和fcitxxim在 4.0.1之前只支持over the spot。 还可能存在的问题就是 /usr/share/X11/locale/ 没有你的locale在一些自行编译的嵌入式系统上可能出现
检查是否正在使用fcitx im module 最简单的办法是执行 dbus-monitor观察是否有org.fcitx.Fcitx 的内容。
15.4.
界面的颜色怎么那么难看?
欢迎你贡献你自己觉得更好的配色。
15.5.
我将fcitx加到gnome的自动启动后gnome怎么启动那么慢
把~/.gnome2/session-manual里面0,Priority=31的31换成50即可。
15.6.
为什么有时候fcitx会卡几秒
fcitx是在第一次输入时读入码表如果码表比较大的话读入的时间可能会比较久一些感觉有些卡但后面输入就不会再有这种现象了如果切换了输入法的话切换后的第一次输入也会重新读入码表
15.7.
为什么我只按了一个键,输入条上却出现两个相同的字符?
这种情况一般出现在KDE中。应该是QT的XIM支持出现问题。出现这个现象时请在窗口管理器的标题栏按鼠标右键弹出系统菜单然后按ctrl_space关闭输入法重新回到应用程序就可以了。
15.8.
当我使用en_US.UTF-8时为什么无法激活fcitx
参加前面的环境配置和faq
15.9.
fcitx的默认字体并不是我常用字体
由于fcitx并没有使用一些高层的字体处理默认字体仅仅是利用Fontconfig找到的一个系统当中的中文字体并无优先级关系也不服从/etc/fonts.conf。 可以通过配置文件指定具体的字体解决。或者你应该考虑编译时enable-pango这样字体设置就有更好的支持了。
15.10.
有些皮肤周围为什么有不透明的黑边
由于Xserver需要可以支持混成的窗口管理器才能处理真透明效果因此需要对窗口管理器本身进行设置。相应的开启混成之后会消耗更多的CPU和GPU性能因此是否开启这个效果请自己权衡。
分为以下情况:
Gnome
Metacity可以支持混成但由于不是所有的显卡和驱动程序都能很好地支持混成因此混成在gnome中默认是未开启的。如果你的显卡和驱动程序支持3D加速则可以开启之。
使用gconf-editor进行编辑编辑/apps/metacity/general/compositing_manager设置为真即可。
或者直接使用下面的命令启用:
gconftool-2 -s --type bool /apps/metacity/general/compositing_manager true
如果你想禁用它修改“true”为“false”并重新执行该命令。
KDE4
Kwin可以支持混成在系统设置桌面效果内设置。
XFCE
Xfwm4支持混成在高级窗口管理器内进行设置。
Compiz
Compiz >= 0.9.0可能默认没有开启混成可以通过安装ccsm进行配置。
其他
其他窗口管理器可以通过一个额外的混成管理器xcompmgr进行混成管理。只需要安装它即可。另外也可以将之前所述的窗口管理器在不开启混成的情形下同时使用xcompmgr但相应的可能不如原生的效果那么好。
15.11.
fcitx启动后图标背景为黑色但关闭后手动启动背景颜色正常
你可以通过设置DelayStart延迟几秒启动fcitx在支持混成的窗口管理器和面板启动之后再启动fcitx。
15.12.
有时Firefox中输入的第一个字母会丢失
请使用GTK IM Module参见环境配置
15.13.
fcitx在某些的程序中无法光标跟随/光标跟随存在问题
请使用IM Module以及调整xim的style参见环境配置
15.14.
在flash中无法输入
请使用GTK IM Module参见环境配置
15.15.
我对于fcitx拼音词库很不满
有两个折中的解决方案。
利用createPYMB创建自己的词库放在~/.config/fcitx/pinyin下面。
尝试fcitx-sunpinyinsunpinyin是一个基于语言模型的pinyin开源输入法项目对于整句输入有很大提升。
15.16.
我是kde4用户kimpanel的问题太多了可是我又想界面协调
你可以尝试这里的小工具http://csslayer.tk/wordpress/fcitx开发/fcitx-skingenerator/
15.17.
我想输入日语怎么办?
你可以尝试这里http://forum.ubuntu.org.cn/viewtopic.php?f=8&t=290712&start=0 5楼的码表。 或者请等待基于anthy的fcitx的输入法wrapper这个项目目前在计划中。
15.18.
我想输入颜文字
fcitx的QuickPhrase?在你有想象力的前提下可以发挥很多功能例如用来输入颜文字例如用来根据Latex的标记输入特殊符号。
15.19.
我在使用vnc/nomachine远程连接时fcitx好像不太好使
vnc下fcitx似乎确实有问题但我们尚未验证是否这是基于xim的通病。 nomachine/nx下是没有问题的不过由于你可能是使用windows进行远程连接那么ctrl+space会被windows的输入法抢走而不会传递到远程的计算机上你可以考虑将fcitx 的输入法切换快捷键设置为shift+space。在linux的nx客户端没有问题。
15.20.
我发现了 fcitx 的 bug 怎么办?
确认你发现的问题不在常见问题列表里。
在 Issues 中查询, 确认尚未有人报告该问题; 如果已经有人报告了该问题, 但是你想补充更多信息, 可以回复进行补充。
如果确认了不是已知问题,那么不必拘束,在 Issues 中 New issue 提交 bug 的详细情况,我们将尽快确认。
如果是导致 fcitx 退出的错误, 你可以查看 ~/.config/fcitx/log/crash.log 中是否有相关信息, 同时将这个信息和你的 fcitx 已经编译的二进制文件发上来。
致谢
fcitx3.1.x 及以前的版本)使用了来自于 cjkvinput 项目的五笔 86 码表,请参看源码中的 doc/cjkvinput.txt。
fcitx-3.2 使用了拼音佳佳 4.0 的拼音词库,并根据该词库制作了五笔 86 的词库。详情请参看源码包中的 doc/pinyin.txt。
fcitx-3.3.X 以后使用了 kardinal@linuxsir 制作的五笔 86 词库(稍做修改)。
fcitx-3.6.4fcitx-4.0.0 及以后的版本采用了 open-phrase 词库。
本程序参考了 rfinput-2.x 的源码,在此向其作者 Zhao yang zyang@redflag-linux.com致谢。
感谢 www.linuxsir.org 的北南南北为 fcitx 提供一个家。同时,他与小凡为 gWuBi/fcitx 的推广和测试做了很多工作。
感谢 xsim 的作者楚狂、scim 的 james_su 提供了宝贵的技术支持;
感谢二笔输入法(ebf)的作者 tram他为 fcitx 做了很多工作。
感谢 winix 多次为 gWuBi/fcitx 提出宝贵的意见和建议。
感谢 windrose 精心测试了双拼功能。
感谢 Wang Yin 为拼音输入提出了宝贵的意见。
感谢 Xie Yanbo 制作了安装配置脚本。
感谢 t3swing 为 fcitx 编写了皮肤功能。
感谢 Jarryson 和 Ukyoi 为 fcitx 制作了皮肤。
同时感谢所有其它测试 gWuBi/fcitx 的朋友,非常感谢。

View File

@@ -0,0 +1,38 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T10:51:12+08:00
====== 解析输入法环境变量 ======
Created Monday 19 November 2012
http://blog.csdn.net/kevinxtq/article/details/2289738
我们配置输入法时,都是习惯性的在输入法启动前导出环境变量:
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=SCIM
他们有何用意呢??
我们常用的输入法有以下几种:
1. XIM (X输入法, 所有 X 图形程序都是可用的)
2. GTK input moduleGTK输入模块, 专给 GTK+2/GTK+3/Gnome 程序用的GTK+ 1 不适用)
3. QT input moduleQT输入模块, 专给 QT/KDE 程序用的)
XMODIFIERS实际上是指定 __X图形程序的输入法__.
GTK_IM_MODULE 则是指定GTK+2的程序默认所用的输入法模块.
有关GTK+2 所有输入法模块都安装在 __/usr/lib/gtk-2.0/2.4.0/immodules/__ 目录下.可以使用gtk-query-immodules-2.0来取得GTK2可以使用的Input Method Module。
关于他们之间的关系,我们有一个比较直观的经验就是, 当我们因为设置XMODIFIERS失误(比如在有些情况下scim小写),导致X输入法没法使用时,我们在gnome-terminal里单击鼠标右 键,移动到 "输入法",再选择 "SCIM Input Method"时,我们在gnome-terminal下却是可以输入中文的. 当然前提是我们已经安装scim-gtk2-immodule包.
一般情况下__XMODIFIERS的优先级高于GTK_IM_MODULE__ ,即当我们同时设定这两个环境变量,在GTK+2的应用程序里优先使用的是XMODIFIERS指定的X输入法.
GTK immodule 比起 XIM 有很多好处:
1. 不受 locale 限制
2. 完全不用设定,随时可用,会自动调用 IM server
3. 可以任意切换各种不同 IM server随时可改,无需重启X.
4. 真正支援游标跟随.
但是因为 c++ 的兼容性问题使 scim-gtk2-immodule 跟许多程序相冲突,故而在目前,如果我们使用scim的话,还不能流畅享受到GTK 输入模块的种种妙处,只能使用 Scim for XIM.
mozilla, firefox, thunderbird 等不是正规的 GTK+ 2没办法用鼠标动态选择输入法. 如果你仅仅使用GTK immodule的话, 一定要使用GTK_IM_MODULE指定默认的GTK 输入模块.

View File

@@ -0,0 +1,10 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-02T13:37:45+08:00
====== 黑客辞典 ======
Created Friday 02 November 2012
grub gfx = graphics, 两者的读音差不多。
VESA = Video Electronics Standards Association
VBE = VESA BIOS Extensions

7
Zim/Utils/grub.txt Normal file
View File

@@ -0,0 +1,7 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-09T21:20:10+08:00
====== grub ======
Created Friday 09 November 2012

View File

@@ -1,77 +0,0 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-03-18T16:10:36+08:00
====== xmodmap ======
Created Sunday 18 March 2012
http://lins05.mysmth.net/2011/04/24/67/
===== Linux改键利器Xmodmap 的简单教程 =====
Linux改键利器Xmodmap 的简单教程 适用对象:
* Emacs用户需要交换 CapsLock 和 left Ctrl的人
* 其他有改键需要的人
* 喜欢瞎折腾的人
对于一般用户,如果没有特殊的需要,可能从未听说过`Xmodmap`这个程序。即使听说,也跟 xinit/Xsession/X 一样蒙着一层神秘的面纱。今天我由于迫切地想把左边的windows键给屏蔽掉原因就说来话长了Goolge了半天没有找到一个现成的答案唯一的线索是可以使用xmodmap来实现。 最后不得不一行行地读 xmodmap的man二十分钟之后发现原来如此简单。心血来潮之际写一个简单的教程以xb心中的得意之情同时以后也可以作为自己和别人的参考。
===== 提出问题: =====
如何交换CapsLock和左边的Ctrl键 答:
xmodmap -e "remove **lock** = Caps_Lock" ;
xmodmap -e "remove **control** = Control_L";
xmodmap -e "add control = Caps_Lock";
xmodmap -e "add lock = Control_L"
后面的内容是具体的教程,前面是提供给只需要一个做法而不需要了解具体的原理的。如果你属于此类,完全可以不看后面的内容了。 不过原理很简单而且一旦学会改键就跟grep一个正则表达式差不多简单。
===== 分析问题: =====
看到这里的人,应该是有耐心理解下面三个概念的: keycode/keysym/modifier 这三个概念是键盘相关的、层次从低到高的三个名词。
===== keycode =====
一般的键盘上有102或者105键每一个键被按下时会产生一个特有类型、主板能够分辨的电信号传输给主板主板给不同的电信号定下不同的编号这就是所谓的keycode。 这些电信号是__在生产键盘时就定死了的__比如左边的Ctrl键产生的keycode是37。CapsLock键产生的keycode是66。 要查找某个按键的keycode可以在term中用__`xev`__程序来查看。xev使用很简单它运行时你按下一个键term中就会显示这个键的许多信息其中就有keycode。 这些keycode是硬件决定的你我无法改变。总之记住__一个按键产生的keycode是不可能在软件中改变的__。
===== keysym =====
操作系统按照统一的规范给不同的keycode映射为不同的含义这个映射后的含义的术语就叫做keysym。比如你在emacs中打字时按下一个s键。屏幕上出现一个`s`,而不是出现一个`b`是因为系统接收到s的keycode我用xev查了下keycode(s) = 39 按照默认的标准39对应于字母`s`,于是就这个`s`显示在屏幕上。 (当然,更严谨地、更准确地说,应该是把`s`这个字母作为输入传递给Emacsemacs再把这个字母插入到当前的文件中的。) 这里keycode是39其对应的符号术语叫keysym即`key symbol`,就是字母`s`。 同理,你按下键盘上的b'(keycode(b) = 56),它的(默认的)keysym就是字母`b`。 系统给一个keycode分配的keysym不只一个。对于一个字母键至少两个。第一个是单独按下这个键时对应的一第二个是shift和这个键同时按下时的keysym。 键盘上还有另外一类按键它们单独按下时一般没有任何意义只有与其他的按照一直按下时是才会产生一些特殊的效果比如Ctrl、Shift、win键它们实现的效果称为modifier。
Modifier修饰符
“修饰符”的修饰二字很好解释你按下s是打一个字母s你按下Ctrl+s大部分软件里会保存当前文件你按下Shift+s是打另一个字母S。总之是, “改变一个键的本来含义“。因为`modify`本来就是修改的意思。 在term里输入命令`xmodmap`,会出现以下内容
shift Shift_L (0×32), Shift_R (0×3e) lock control Control_R (0×25), Caps_Lock (0×42), Control_R (0×69) mod1 Alt_L (0×40), Alt_R (0×6c), Meta_L (0xcd) mod2 Num_Lock (0×4d) mod3 mod4 Super_L (0×85), Super_R (0×86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0×5c), Mode_switch (0xcb) 左边那一列,就是系统中所有的`modifier`。 系统会把一些默认的keysym解释为modifier比如默认情况下你按下Shift + s 屏幕上出现大写的S,整个过程其实是:
系统收到Shift键和s键的keycode
系统处理 keycode>keysym 的映射: shift的keycode被映射到`SHIFT_L`这个keysyms的keycode被映射到`s`这个keysym
系统发现SHIFT_L这个keysym被定义为shfit这个modifier。
`s`被shift这个modifier给修饰了修饰的结果是变成了大写的S。
基本概念讲完了,那么,`xmodmap`是如何帮我们实现`改键`的呢? 可以看到,从按下一个键到最后,有两个层次的映射过程:
第一层: keycode>keysym
第二层: keysym > modifier
因此,我们可以通过两种方法来实现改键。以
第一步:
目标把键盘上的s和b键交换位置
先查询keycode: keycode(s) = 37 keycode(b) = 56
xmodmap -e "keycode 37 = b" xmodmap -e "keycode 56 = s" 这样,就交换了 s/b 这两个键的位置了! 注意在你执行了第一条语句之后s立刻被重新映射到b了那么你第二条语句中的`s`怎么打出来呢? 两个方法: i) 从别处粘贴一个过来 ii)见最后的`xmodmap执行命令的三种方式` 注意这个方法只能交换一般的keysym那些定义为Modifier的键就不能简单地用这个方式交换。因为 当一个keysym被定义为modifier那么本质上是在 keycode>modifier之间建立起了一个映射。因此即使你改变了它的keycode>keysym关系也不起作用 也就是说当你要把一个键定义一个modifier时你只能把它的keycode对应的keysym定义为modifier从而达到目的。但这之后即使keycode映射到别的keysym了这个keycode仍然是一个modifier。 因此如果要交换CapsLock和Ctrl这两个键只需要做两件事
把`Caps_Lock`这个keysym定义为`control`这个modifer
把`Control_L`这个keysym定义为`Caps_Lock`这个modifier Control_L是左Ctrl键的默认keysym)
第二步: 交换 Caps_Lock和 左边的Ctrl
先把CapsLock这个keysym映射到control这个modifier
xmodmap -e "remove lock = Caps_Lock" xmodmap -e "add control = Caps_Lock" 因为一个keysym不能同时映射到两个modifier因此我们需要先用remove把Caps_Lock这个keysym与lock这个modifier的映射关系删除。然后再把Caps_Lock这个keysym映射到Control这个modifier。 remove和add的的语法是
remove/add modifier_name = keysym_name 此时,你可以试一下,看看是否已经产生效果了? 同样再把左边的Ctrl键映射到CapsLock
xmodmap -e "remove control = Control_L" xmodmap -e "add Caps_Lock = Control_L" xmodmap执行命令的三种方式 1) xmodmap -e "do somthing" 是让xmodmap执行后面的一条句子。但这样一次只能执行一条。 2) 你也可以先输入 `xmodmap -`然后回车然后输入任意多句子每输入一条就用回车分隔最后用Ctrl+D结束输入。 3) 把remove xxx = yyy 这些句子都写到一个文件里。一般是~/.Xmodmap。然后用 `xmodmap ~/.Xmodmap`执行。 这样的好处是,在启动时的某个脚本里加一行命令,就不用每次重启都手动地改键了。 第三层:可逆的改键: 不难看出,运行了上面方法二中的四句命令之后,如果想要改回来的话,还需要另外写四句。以下六句可以实现这 样的效果第一次运行是交换CapsLock和Ctrl_L第二次运行又会再交换回来。
remove lock = Caps_Lock remove control = Control_L keysym Caps_Lock = Control_L keysym Control_L = Caps_Lock add lock = Caps_lock add control = Control_L 为什么会有这个效果呢?是因为多了中间两句话。
keysym Caps_Lock = Control_L keycode 66 = Control_L keysym Control_L = Caps_Lock keycode 37 = Caps_Lock “keysym A = B” 这个句子相当于: 把所有原来映射到A的keycode重新映射到 B。比如有一个键Q他的keycode原来对应的keysym是A那么在执行了上面语句之后这个键Q的keycode对应的keysym就是B 因此, keysym Caps_Lock = Control_L 把Cap键映射到Control_L这个keysym keysym Control_L = Caps_Lock 把Ctrl键映射到Caps_Locks这个keysym
转载请注明出处。 可能有不正确的 地方,本文不负任何责任。

View File

@@ -0,0 +1,7 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T19:07:10+08:00
====== 键盘布局和按键映射 ======
Created Monday 19 November 2012

View File

@@ -0,0 +1,323 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T16:13:12+08:00
====== keymaps ======
Created Monday 19 November 2012
KEYMAPS(5) KEYMAPS(5)
===== NAME =====
keymaps - keyboard table descriptions for **loadkeys** and **dumpkeys**
===== DESCRIPTION =====
These files are used by loadkeys(1) to modify the __translation tables__
used by the __kernel keyboard driver__ and generated by **dumpkeys(1)** from
those translation tables.
The format of these files is vaguely similar to the one accepted by
**xmodmap(1).** The file consists of charset or key or string definition
lines interspersed with comments.
Comments are introduced with ! or # characters and continue to the end
of the line. Anything following one of these characters on that line is
ignored. Note that comments need not begin from column one as with
xmodmap(1).
The syntax of keymap files is line oriented; a complete definition must
fit on a single logical line. Logical lines can, however, be split into
multiple physical lines by ending each subline with the backslash char
acter (\).
===== INCLUDE FILES =====
A keymap can include other keymaps using the syntax
include "pathname"
===== CHARSET DEFINITIONS =====
A character set definition line is of the form:
charset "iso-8859-x"
It defines how following **keysyms** are to be interpreted. For example,
in iso-8859-1 the symbol mu (or micro) has code 0265, while in
iso-8859-7 the letter mu has code 0354.
===== COMPLETE KEYCODE DEFINITIONS =====
Each complete key definition line is of the form:
keycode keynumber = keysym keysym keysym...
**keynumber** is the internal identification number of the key, roughly
equivalent to the __scan code__ of it. keynumber can be given in decimal,
octal or hexadecimal notation. Octal is denoted by a leading zero and
hexadecimal by the prefix 0x.
在虚拟终端模式下可以通过__showkey命令__来查看某个按键的keycode。通过
__dumpkeys__不加任何参数或-f参数来查看当前keycode与keysym的绑定。
Each of the keysyms represent **keyboard actions**, of which up to __256__ can
be bound to a single key. The actions available include outputting
character codes or character sequences, switching consoles or keymaps,
booting the machine etc. (The complete list can be obtained from dump
keys(1) by saying __dumpkeys -l__ .)
keyboard actions包括打印字符、切换终端、命令行编辑、启动系统等具体
可以使用 dumpkeys -l命令来查看
Each keysym may be prefixed by a '+' (plus sign), in wich case this
keysym is treated as a "letter" and therefore affected by the "Cap
sLock" the same way as by "Shift" (to be correct, the CapsLock __inverts__
the Shift state). The ASCII letters ('a'-'z' and 'A'-'Z') are made
CapsLock'able by default. If Shift+CapsLock should not produce a lower
case symbol, put lines like
keycode 30 = +a A
in the map file.
Which of the actions bound to a given key is taken when it is pressed
depends on __what modifiers are in effect__ at that moment. The keyboard
driver supports **9 modifiers**. These modifiers are labeled (completely
arbitrarily) Shift, AltGr, Control, Alt, ShiftL, ShiftR, CtrlL, CtrlR
and CapsShift. Each of these modifiers has an associated weight of
power of two according to the following table:
modifier weight
Shift
1
AltGr
2
Control
4
Alt
8 //实际使用时不使用16-256,故不区分L和R只有Shift Ctrl和Alt。
ShiftL
16
ShiftR
32
CtrlL
64
CtrlR 128
CapsShift 256
The effective action of a key is found out by __adding up the weights of__
__ all the modifiers in effect__. By default, no modifiers are in effect, so
action number **zero**, i.e. the one in the first column in a key defini
tion line, is taken when the key is pressed or released. When e.g.
Shift and Alt modifiers are in effect, action number nine (from the
10th column) is the effective one.
Changing the state of what modifiers are in effect can be achieved by
__binding appropriate key actions to desired keys将keycode与key actions绑定__.
For example, binding
the symbol Shift to a key sets the Shift modifier in effect when that
key is pressed and cancels the effect of that modifier when the key is
released. 也就是说将Shift与某个keycode代表的按键绑定。Binding
AltGr_Lock to a key sets AltGr in effect when the key
is pressed and cancels the effect when the key is pressed again. (__By__
__ default Shift, AltGr, Control and Alt are bound to the keys that bear a__
__ similar label; AltGr may denote the right Alt key.__)。缺身情况下ShiftControl
Alt分别于键盘上同一个标示的按键绑定。
Note that you should be very careful when binding the modifier keys,
otherwise you can end up with an unusable keyboard mapping. If you for
example define a key to have Control in its first column and leave the
rest of the columns to be VoidSymbols, you're in trouble. This is
because pressing the key puts Control modifier in effect and the fol
lowing actions are looked up from the fifth column (see the table
above). So, when you release the key, the action from the fifth column
is taken. It has VoidSymbol in it, so nothing happens. This means that
the **Control modifier is still in effect, although you have released the**
** key.** Re-pressing and releasing the key has no effect. To avoid this,
__you should always define all the columns to have the same modifier sym__
__ bol.__ There is a handy short-hand notation for this, see below.
keysyms can be given in decimal, octal, hexadecimal, unicode or sym
bolic notation. 最常用同时也最具可移植性的是**符号化代表**(symbolic notation),这些
符号名称可以被loadkeys命令识别。
The numeric notations use the same format as with
keynumber. Unicode notation is "U+" followed by four hexadecimal dig
its. The __symbolic notation__ resembles that used by xmodmap(1). Notable
differences are the number symbols. The numeric symbols '0', ..., '9'
of xmodmap(1) are replaced with the corresponding words 'zero', 'one',
... 'nine' to avoid confusion with the numeric notation.
It should be noted that using numeric notation for the keysyms is
highly unportable as the key action numbers may vary from one kernel
version to another and the use of numeric notations is thus strongly
discouraged. They are intended to be used only when you know there is a
supported keyboard action in your kernel for which your current version
of loadkeys(1) has no symbolic name.
There is a number of short-hand notations to add readability and reduce
typing work and the probability of typing-errors.
First of all, you can give __a map specification line__, of the form
keymaps 0-2,4-5,8,12
to indicate that the lines of the keymap will not specify all 256 col
umns, but only the indicated ones. (In the example: only the plain,
Shift, AltGr, Control, Control+Shift, Alt and Control+Alt maps, that
is, 7 columns instead of 256.这意味着Conrolt_L, Control_R等不再使用。
具体可以参考/usr/share/kbd/keymaps/i386/qwerty/us.map.gz)
When no such line is given, the keymaps 0-M will be defined, where M+1 is the maximum number of entries found
in any definition line.
Next, you can leave off any __trailing__ VoidSymbol entries from a key def
inition line. __注意必须是尾部的VoidSymbol.__ VoidSymbol denotes a keyboard
action which produces no
output and has no other effects either. For example, to define key num
ber 30 to output **'a' unshifted**, 'A' when pressed with Shift and do
nothing when pressed with AltGr or other modifiers, you can write
keycode 30 = a A
instead of the more verbose
keycode 30 = a A VoidSymbol VoidSymbol \
VoidSymbol VoidSymbol VoidSymbol ...
For added convenience, you can usually get off with still more terse
definitions. **If you enter a key definition line with only and exactly**
** one action code after the equals sign, it has **__a special__** meaning.**
**也就是说当按键定义行只指定了一个action code时该action是有特殊含义的。**
** 如果该action code代表非字符则该action会被默认在所有column上重复(这也是**
pe**rsonal.map文件中的用法 **__keycode 56 = Control__**)。但是如果**
** 该action是字符则相应column对应的action由modifier确定。** If the
code (numeric or symbolic) is not an ASCII letter, it means the code is
__implicitly replicated__ through all columns being defined. If, on the
other hand, the action code is an ASCII character in the range 'a',
..., 'z' or 'A', ..., 'Z' in the ASCII collating sequence, the follow
ing definitions are made for the different modifier combinations, pro
vided these are actually being defined. (The table lists the two pos
sible cases: either the single action code is a lower case letter,
denoted by 'x' or an upper case letter, denoted by 'Y'.)
modifier symbol
none x (小写字符) Y(大写字符)
Shift X y
AltGr x Y
Shift+AltGr X y
Control Control_x Control_y
Shift+Control Control_x Control_y
AltGr+Control Control_x Control_y
Shift+AltGr+Control Control_x Control_y
Alt Meta_x Meta_Y
Shift+Alt Meta_X Meta_y
AltGr+Alt Meta_x Meta_Y
Shift+AltGr+Alt Meta_X Meta_y
Control+Alt Meta_Control_x Meta_Control_y
Shift+Control+Alt Meta_Control_x Meta_Control_y
AltGr+Control+Alt Meta_Control_x Meta_Control_y
Shift+AltGr+Control+Alt Meta_Control_x Meta_Control_y
===== SINGLE MODIFIER DEFINITIONS =====
All the previous forms of key definition lines always define __all__ the
M+1 possible modifier combinations being defined, whether the line
actually contains that many action codes or not(loadkeys会自动补充没有指定的column).
There is, however, a variation of the definition syntax for __defining only single actions to__
__ a particular modifier combination of a key.__ This is especially useful,
if you load a keymap which doesn't match your needs in only some modi
fier combinations, like AltGr+function keys. You can then make a small
local file redefining only those modifier combinations and loading it
after the main file. The syntax of this form is:
{ plain | <modifier sequence> } keycode keynumber = keysym
, e.g.,
**plain** keycode 14 = BackSpace
control alt keycode 83 = Boot
alt keycode 105 = Decr_Console
alt keycode 106 = Incr_Console
Using "plain" will define only the base entry of a key (i.e. the one
with no modifiers in effect) without affecting the bindings of other
modifier combinations of that key.
===== STRING DEFINITIONS =====
In addition to comments and key definition lines, a keymap can contain
string definitions. These are used to define what each __function key如F1-F12,__
可以参考dumpkeys命令的输出____
action code sends. The syntax of string definitions is:
string keysym = "text"
text can contain literal characters, octal character codes in the for
mat of backslash followed by up to three octal digits, and the three
escape sequences \n, \\, and \", for newline, backslash and quote,
respectively.
===== COMPOSE DEFINITIONS获得注音字符很少使用 =====
Then there may also be compose definitions. They have syntax
compose 'char' 'char' to 'char'
and describe how two bytes are combined to form a third one (when a
dead accent or compose key is used). This is used to get accented let
ters and the like on a standard keyboard.
===== ABBREVIATIONS =====
Various abbreviations can be used with kbd-0.96 and later.
__strings as usual__
Defines the usual values of the strings (but not the keys they
are bound to).
compose as usual for "iso-8859-1"
Defines the usual compose combinations.
To find out what __keysyms__ there are available for use in keymaps, use
the command
dumpkeys --long-info //打印keymaps文件中可以使用的符号名称。
Unfortunately, there is currently no description of what each symbol
does. It has to be guessed from the name or figured out from the kernel
sources.
===== EXAMPLES =====
(Be careful to use a keymaps line, like the first line of `dumpkeys`,
or "keymaps 0-15" or so.)
The following entry exchanges the left Control key and the Caps Lock
key on the keyboard:
keycode 58 = Control
keycode 29 = Caps_Lock
Key number 58 is normally the Caps Lock key, and key number 29 is nor
mally the Control key.
The following entry sets the Shift and Caps Lock keys to behave more
nicely, like in older typewriters. That is, pressing Caps Lock key once
or more sets the keyboard in CapsLock state and pressing either of the
Shift keys releases it.
keycode 42 = Uncaps_Shift
keycode 54 = Uncaps_Shift
keycode 58 = Caps_On
The following entry sets the layout of the edit pad in the enhanced
keyboard to be more like that in the VT200 series terminals:
keycode 102 = Insert
keycode 104 = Remove
keycode 107 = Prior
shift keycode 107 = Scroll_Backward
keycode 110 = Find
keycode 111 = Select
control alt keycode 111 = Boot
control altgr keycode 111 = Boot
Here's an example to bind the string "du\ndf\n" to the key AltGr-D. We
use the "spare" action code F100 not normally bound to any key.
altgr keycode 32 = F100
string F100 = "du\ndf\n"
===== SEE ALSO =====
loadkeys(1), dumpkeys(1), showkey(1), xmodmap(1)
24 April 1998 KEYMAPS(5)

View File

@@ -0,0 +1,482 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T16:45:20+08:00
====== dumpkeys ======
Created Monday 19 November 2012
**#dumpkeys** //打印当前kernel终端驱动程序使用的键盘映射表注意配置文件为__/etc/vconsole.conf__下面的输出的内容其配置来源于该文件。
__// $cat /etc/vconsole.conf__
__// KEYMAP=personal__
__//而personal是位于/usr/share/kbd/keymaps/i386/qwerty/personal.map.gz文件。__
keymaps 0-2,4-6,8-9,12 //每个按键(keycode)最多绑定9个keysyms.
//根据**dumpkeys -l**的如下输出:
Recognized modifier names and their column numbers:
shift 1
altgr 2
control 4
alt 8
shiftl 16
shiftr 32
ctrll 64
ctrlr 128
capsshift 256
//可知kernel没有使用16以后的modifier所以__不区分shiftl, shiftr统一使用shift(ctrl类似)__。
keycode 1 = Escape
alt keycode 1 = Meta_Escape
shift alt keycode 1 = Meta_Escape
control alt keycode 1 = Meta_Escape
keycode 2 = one exclam
alt keycode 2 = Meta_one
shift alt keycode 2 = Meta_exclam
keycode 3 = two at at nul nul
alt keycode 3 = Meta_two
shift alt keycode 3 = Meta_at
control alt keycode 3 = Meta_nul
keycode 4 = three numbersign
control keycode 4 = Escape
alt keycode 4 = Meta_three
shift alt keycode 4 = Meta_numbersign
keycode 5 = four dollar dollar Control_backslash
alt keycode 5 = Meta_four
shift alt keycode 5 = Meta_dollar
control alt keycode 5 = Meta_Control_backslash
keycode 6 = five percent currency Control_bracketright
alt keycode 6 = Meta_five
shift alt keycode 6 = Meta_percent
keycode 7 = six asciicircum
control keycode 7 = Control_asciicircum
alt keycode 7 = Meta_six
shift alt keycode 7 = Meta_asciicircum
keycode 8 = seven ampersand braceleft Control_underscore
alt keycode 8 = Meta_seven
shift alt keycode 8 = Meta_ampersand
control alt keycode 8 = Meta_Control_underscore
keycode 9 = eight asterisk bracketleft Delete
alt keycode 9 = Meta_eight
shift alt keycode 9 = Meta_asterisk
control alt keycode 9 = Meta_Delete
keycode 10 = nine parenleft bracketright
alt keycode 10 = Meta_nine
shift alt keycode 10 = Meta_parenleft
keycode 11 = zero parenright braceright
alt keycode 11 = Meta_zero
shift alt keycode 11 = Meta_parenright
keycode 12 = minus underscore backslash Control_underscore Control_underscore
alt keycode 12 = Meta_minus
shift alt keycode 12 = Meta_underscore
control alt keycode 12 = Meta_Control_underscore
keycode 13 = equal plus
alt keycode 13 = Meta_equal
shift alt keycode 13 = Meta_plus
keycode 14 = Delete
alt keycode 14 = Meta_Delete
shift alt keycode 14 = Meta_Delete
control alt keycode 14 = Meta_Delete
keycode 15 = Tab
shift keycode 15 = Meta_Tab
alt keycode 15 = Meta_Tab
control alt keycode 15 = Meta_Tab
keycode 16 = q
keycode 17 = w
keycode 18 = e
keycode 19 = r
keycode 20 = t
keycode 21 = y
keycode 22 = u
keycode 23 = i
keycode 24 = o
keycode 25 = p
keycode 26 = bracketleft braceleft
control keycode 26 = Escape
alt keycode 26 = Meta_bracketleft
shift alt keycode 26 = Meta_braceleft
keycode 27 = bracketright braceright asciitilde Control_bracketright
alt keycode 27 = Meta_bracketright
shift alt keycode 27 = Meta_braceright
control alt keycode 27 = Meta_Control_bracketright
keycode 28 = Return
alt keycode 28 = Meta_Control_m
__keycode 29 = Alt__
//注意通过showkeys可以查处__keycode 29 对应空格左边的Alt而keycode 100 对应空格__
//右边的Alt通过将它们都与Alt绑定是这两个键具有相同功能。Ctrl和Shift类似。这其实
是personal.map.gz文件配置的
keycode 30 = a
keycode 31 = s
keycode 32 = d
keycode 33 = f
keycode 34 = g
keycode 35 = h
keycode 36 = j
keycode 37 = k
keycode 38 = l
keycode 39 = semicolon colon
alt keycode 39 = Meta_semicolon
shift alt keycode 39 = Meta_colon
keycode 40 = apostrophe quotedbl
control keycode 40 = Control_g
alt keycode 40 = Meta_apostrophe
shift alt keycode 40 = Meta_quotedbl
keycode 41 = grave asciitilde
control keycode 41 = nul
alt keycode 41 = Meta_grave
shift alt keycode 41 = Meta_asciitilde
__keycode 42 = Shift__
keycode 43 = backslash bar
control keycode 43 = Control_backslash
alt keycode 43 = Meta_backslash
shift alt keycode 43 = Meta_bar
keycode 44 = z
keycode 45 = x
keycode 46 = +c +C cent Control_c Control_c Control_c Meta_c Meta_C Meta_Control_c
keycode 47 = v
keycode 48 = b
keycode 49 = n
keycode 50 = m
keycode 51 = comma less
alt keycode 51 = Meta_comma
shift alt keycode 51 = Meta_less
keycode 52 = period greater
alt keycode 52 = Meta_period
shift alt keycode 52 = Meta_greater
keycode 53 = slash question
control keycode 53 = Control_underscore
shift control keycode 53 = Delete
alt keycode 53 = Meta_slash
shift alt keycode 53 = Meta_question
__keycode 54 = Shift__
keycode 55 = KP_Multiply
__keycode 56 = Control__
keycode 57 = space
control keycode 57 = nul
alt keycode 57 = Meta_space
shift alt keycode 57 = Meta_space
control alt keycode 57 = Meta_nul
keycode 58 = Caps_Lock
keycode 59 = F1 F13 Console_13 F25
alt keycode 59 = Console_1
control alt keycode 59 = Console_1
keycode 60 = F2 F14 Console_14 F26
alt keycode 60 = Console_2
control alt keycode 60 = Console_2
keycode 61 = F3 F15 Console_15 F27
alt keycode 61 = Console_3
control alt keycode 61 = Console_3
keycode 62 = F4 F16 Console_16 F28
alt keycode 62 = Console_4
control alt keycode 62 = Console_4
keycode 63 = F5 F17 Console_17 F29
alt keycode 63 = Console_5
control alt keycode 63 = Console_5
keycode 64 = F6 F18 Console_18 F30
alt keycode 64 = Console_6
control alt keycode 64 = Console_6
keycode 65 = F7 F19 Console_19 F31
alt keycode 65 = Console_7
control alt keycode 65 = Console_7
keycode 66 = F8 F20 Console_20 F32
alt keycode 66 = Console_8
control alt keycode 66 = Console_8
keycode 67 = F9 F21 Console_21 F33
alt keycode 67 = Console_9
control alt keycode 67 = Console_9
keycode 68 = F10 F22 Console_22 F34
alt keycode 68 = Console_10
control alt keycode 68 = Console_10
keycode 69 = Num_Lock
keycode 70 = Scroll_Lock Show_Memory Show_Registers Show_State
alt keycode 70 = Show_Registers
keycode 71 = KP_7
alt keycode 71 = Ascii_7
keycode 72 = KP_8
alt keycode 72 = Ascii_8
keycode 73 = KP_9
alt keycode 73 = Ascii_9
keycode 74 = KP_Subtract
keycode 75 = KP_4
alt keycode 75 = Ascii_4
keycode 76 = KP_5
alt keycode 76 = Ascii_5
keycode 77 = KP_6
alt keycode 77 = Ascii_6
keycode 78 = KP_Add
keycode 79 = KP_1
alt keycode 79 = Ascii_1
keycode 80 = KP_2
alt keycode 80 = Ascii_2
keycode 81 = KP_3
alt keycode 81 = Ascii_3
keycode 82 = KP_0
alt keycode 82 = Ascii_0
keycode 83 = KP_Period
control alt keycode 83 = Boot
keycode 84 = Last_Console
keycode 85 =
keycode 86 = less greater bar
alt keycode 86 = Meta_less
shift alt keycode 86 = Meta_greater
keycode 87 = F11 F23 Console_23 F35
alt keycode 87 = Console_11
control alt keycode 87 = Console_11
keycode 88 = F12 F24 Console_24 F36
alt keycode 88 = Console_12
control alt keycode 88 = Console_12
keycode 89 =
keycode 90 =
keycode 91 =
keycode 92 =
keycode 93 =
keycode 94 =
keycode 95 =
keycode 96 = KP_Enter
__keycode 97 = Control__
keycode 98 = KP_Divide
keycode 99 = Compose
control keycode 99 = Control_backslash
alt keycode 99 = Control_backslash
control alt keycode 99 = Meta_Control_backslash
__keycode 100 = Alt__
keycode 101 = Break
keycode 102 = Find
keycode 103 = Up
alt keycode 103 = KeyboardSignal
keycode 104 = Prior
shift keycode 104 = Scroll_Backward
keycode 105 = Left
alt keycode 105 = Decr_Console
keycode 106 = Right
alt keycode 106 = Incr_Console
keycode 107 = Select
keycode 108 = Down
keycode 109 = Next
shift keycode 109 = Scroll_Forward
keycode 110 = Insert
keycode 111 = Remove
control alt keycode 111 = Boot
keycode 112 = Macro
altgr control keycode 112 = VoidSymbol
shift alt keycode 112 = VoidSymbol
keycode 113 = F13
altgr control keycode 113 = VoidSymbol
shift alt keycode 113 = VoidSymbol
keycode 114 = F14
altgr control keycode 114 = VoidSymbol
shift alt keycode 114 = VoidSymbol
keycode 115 = Help
altgr control keycode 115 = VoidSymbol
shift alt keycode 115 = VoidSymbol
keycode 116 = Do
altgr control keycode 116 = VoidSymbol
shift alt keycode 116 = VoidSymbol
keycode 117 = F17
altgr control keycode 117 = VoidSymbol
shift alt keycode 117 = VoidSymbol
keycode 118 = KP_MinPlus
altgr control keycode 118 = VoidSymbol
shift alt keycode 118 = VoidSymbol
keycode 119 = Pause
keycode 120 =
keycode 121 =
keycode 122 =
keycode 123 =
keycode 124 =
keycode 125 =
keycode 126 =
keycode 127 =
keycode 128 = nul
altgr control keycode 128 = VoidSymbol
shift alt keycode 128 = VoidSymbol
keycode 129 = nul
altgr control keycode 129 = VoidSymbol
shift alt keycode 129 = VoidSymbol
keycode 130 = nul
altgr control keycode 130 = VoidSymbol
shift alt keycode 130 = VoidSymbol
keycode 143 = VoidSymbol
keycode 144 = nul
string F1 = "\033[[A"
string F2 = "\033[[B"
string F3 = "\033[[C"
string F4 = "\033[[D"
string F5 = "\033[[E"
string F6 = "\033[17~"
string F7 = "\033[18~"
string F8 = "\033[19~"
string F9 = "\033[20~"
string F10 = "\033[21~"
string F11 = "\033[23~"
string F12 = "\033[24~"
string F13 = "\033[25~"
string F14 = "\033[26~"
string F15 = "\033[28~"
string F16 = "\033[29~"
string F17 = "\033[31~"
string F18 = "\033[32~"
string F19 = "\033[33~"
string F20 = "\033[34~"
string Find = "\033[1~"
string Insert = "\033[2~"
string Remove = "\033[3~"
string Select = "\033[4~"
string Prior = "\033[5~"
string Next = "\033[6~"
string Macro = "\033[M"
string Pause = "\033[P"
compose '`' 'A' to U+00c0 //注音字符
compose '`' 'a' to U+00e0
compose '\'' 'A' to U+00c1
compose '\'' 'a' to U+00e1
compose '^' 'A' to U+00c2
compose '^' 'a' to U+00e2
compose '~' 'A' to U+00c3
compose '~' 'a' to U+00e3
compose '"' 'A' to U+00c4
compose '"' 'a' to U+00e4
compose '-' 'a' to U+00aa
compose '-' 'A' to U+00aa
compose 'O' 'A' to U+00c5
compose 'o' 'a' to U+00e5
compose '0' 'A' to U+00c5
compose '0' 'a' to U+00e5
compose 'A' 'A' to U+00c5
compose 'a' 'a' to U+00e5
compose '°' 'A' to U+00c5
compose '°' 'a' to U+00e5
compose 'A' 'E' to U+00c6
compose 'a' 'e' to U+00e6
compose ',' 'C' to U+00c7
compose ',' 'c' to U+00e7
compose '^' 'C' to U+00c7
compose '^' 'c' to U+00e7
compose '`' 'E' to U+00c8
compose '`' 'e' to U+00e8
compose '\'' 'E' to U+00c9
compose '\'' 'e' to U+00e9
compose '^' 'E' to U+00ca
compose '^' 'e' to U+00ea
compose '"' 'E' to U+00cb
compose '"' 'e' to U+00eb
compose '`' 'I' to U+00cc
compose '`' 'i' to U+00ec
compose '\'' 'I' to U+00cd
compose '\'' 'i' to U+00ed
compose '^' 'I' to U+00ce
compose '^' 'i' to U+00ee
compose '"' 'I' to U+00cf
compose '"' 'i' to U+00ef
compose '-' 'D' to U+00d0
compose '-' 'd' to U+00f0
compose '^' 'D' to U+00d0
compose '^' 'd' to U+00f0
compose '~' 'N' to U+00d1
compose '~' 'n' to U+00f1
compose '^' 'N' to U+00d1
compose '^' 'n' to U+00f1
compose '`' 'O' to U+00d2
compose '`' 'o' to U+00f2
compose '\'' 'O' to U+00d3
compose '\'' 'o' to U+00f3
compose '^' 'O' to U+00d4
compose '^' 'o' to U+00f4
compose '~' 'O' to U+00d5
compose '~' 'o' to U+00f5
compose '"' 'O' to U+00d6
compose '"' 'o' to U+00f6
compose '/' 'O' to U+00d8
compose '/' 'o' to U+00f8
compose '-' 'o' to U+00ba
compose '-' 'O' to U+00ba
compose '`' 'U' to U+00d9
compose '`' 'u' to U+00f9
compose '\'' 'U' to U+00da
compose '\'' 'u' to U+00fa
compose '^' 'U' to U+00db
compose '^' 'u' to U+00fb
compose '"' 'U' to U+00dc
compose '"' 'u' to U+00fc
compose '\'' 'Y' to U+00dd
compose '\'' 'y' to U+00fd
compose 'T' 'H' to U+00de
compose 't' 'h' to U+00fe
compose 's' 's' to U+00df
compose '"' 'y' to U+00ff
compose 's' 'z' to U+00df
compose 'n' 'n' to U+00f1
compose 'n' 'h' to U+00f1
compose 'N' 'Y' to U+00d1
compose 'N' 'N' to U+00d1
compose 'N' 'H' to U+00d1
compose 'N' 'y' to U+00d1
compose 'N' 'n' to U+00d1
compose 'N' 'h' to U+00d1
compose '-' 'L' to U+00a3
compose '<' '<' to U+00ab
compose '>' '>' to U+00bb
compose '?' '?' to U+00bf
compose '^' '?' to U+00bf
compose '!' '!' to U+00a1
compose '^' '!' to U+00a1
compose '^' '1' to U+00b9
compose '^' '2' to U+00b2
compose '^' '3' to U+00b3
compose '+' '-' to U+00b1
compose 'c' '=' to U+00a2
compose 'c' '/' to U+00a2
compose '/' 'c' to U+00a2
compose '-' 'c' to U+00a2
compose '-' 'C' to U+00a2
compose '|' 'c' to U+00a2
compose '|' 'C' to U+00a2
compose 'L' '=' to U+00a3
compose '-' 'L' to U+00a3
compose '-' 'l' to U+00a3
compose '^' '*' to U+00d7
compose '^' 'x' to U+00d7
compose 'x' 'x' to U+00d7
compose '^' '.' to U+00b7
compose '.' '.' to U+00b7
compose '^' '/' to U+00f7
compose '^' ':' to U+00f7
compose '-' ':' to U+00f7
compose ':' '-' to U+00f7
compose 'Y' '=' to U+00a5
compose '=' 'Y' to U+00a5
compose '-' 'Y' to U+00a5
compose '-' 'l' to U+00a5
compose '(' 'c' to U+00a9
compose '"' 'c' to U+00a9
compose 'O' 'C' to U+00a9
compose '(' 'C' to U+00a9
compose 'C' ')' to U+00a9
compose '-' 'a' to U+00aa
compose '-' 'A' to U+00aa
compose '-' 'o' to U+00ba
compose '-' 'O' to U+00ba
compose '(' 'r' to U+00ae
compose '"' 'r' to U+00ae
compose 'O' 'R' to U+00ae
compose '(' 'R' to U+00ae
compose 'R' ')' to U+00ae
compose 'm' 'u' to U+00b5
compose 'P' 'P' to U+00b6
compose '1' '4' to U+00bc
compose '1' '2' to U+00bd
compose '3' '4' to U+00be
compose 'e' '=' to U+00a4
compose '-' 'e' to U+00a4
compose '-' 'E' to U+00a4
compose '=' 'E' to U+00a4
compose 'v' 'S' to U+00a6
compose '^' 'S' to U+00a6
compose 'v' 's' to U+00a8
compose '^' 's' to U+00a8
compose 'v' 'Z' to U+00b4
compose '^' 'Z' to U+00b4
compose 'v' 'z' to U+00b8
compose '^' 'z' to U+00b8
compose 'O' 'E' to U+00bc
compose 'O' 'e' to U+00bc
compose 'o' 'e' to U+00bd
compose '"' 'Y' to U+00be
compose 'i' 'j' to U+00ff
compose 'I' 'J' to U+00be

View File

@@ -0,0 +1,878 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T16:23:23+08:00
====== dumpkeys -l ======
Created Monday 19 November 2012
$ dumpkeys -l __//打印loadkeys可以识别的symbols及其value它们可以用在personal.map文件中。__
keycode range supported by kernel: 1 - 255 //kernel的终端驱动支持一个key绑定255个keyboard actions。
max number of actions bindable to a key: 256
number of keymaps in actual use: 9 //实际上将一个key绑定9个actions具体可以参考/usr/share/kbd/keymaps/i386/qwerty/us.map.gz
of which 2 dynamically allocated
ranges of action codes supported by kernel:
number of function keys supported by kernel: 256
max nr of compose definitions: 256
nr of compose definitions in actual use: 158
Symbols recognized by dumpkeys:
(numeric value, symbol) //number value只是序号而非keycode
0x0000 nul
0x0001 Control_a
0x0002 Control_b
0x0003 Control_c
0x0004 Control_d
0x0005 Control_e
0x0006 Control_f
0x0007 Control_g
0x0008 BackSpace
0x0009 Tab
0x000a Linefeed
0x000b Control_k
0x000c Control_l
0x000d Control_m
0x000e Control_n
0x000f Control_o
0x0010 Control_p
0x0011 Control_q
0x0012 Control_r
0x0013 Control_s
0x0014 Control_t
0x0015 Control_u
0x0016 Control_v
0x0017 Control_w
0x0018 Control_x
0x0019 Control_y
0x001a Control_z
0x001b Escape
0x001c Control_backslash
0x001d Control_bracketright
0x001e Control_asciicircum
0x001f Control_underscore
0x0020 space
0x0021 exclam
0x0022 quotedbl
0x0023 numbersign
0x0024 dollar
0x0025 percent
0x0026 ampersand
0x0027 apostrophe
0x0028 parenleft
0x0029 parenright
0x002a asterisk
0x002b plus
0x002c comma
0x002d minus
0x002e period
0x002f slash
0x0030 zero
0x0031 **one**
0x0032 two
0x0033 three
0x0034 four
0x0035 five
0x0036 six
0x0037 seven
0x0038 eight
0x0039 nine
0x003a colon
0x003b semicolon
0x003c less
0x003d equal
0x003e greater
0x003f question
0x0040 at
0x0041 A
0x0042 B
0x0043 C
0x0044 D
0x0045 E
0x0046 F
0x0047 G
0x0048 H
0x0049 I
0x004a J
0x004b K
0x004c L
0x004d M
0x004e N
0x004f O
0x0050 P
0x0051 Q
0x0052 R
0x0053 S
0x0054 T
0x0055 U
0x0056 V
0x0057 W
0x0058 X
0x0059 Y
0x005a Z
0x005b bracketleft
0x005c backslash
0x005d bracketright
0x005e asciicircum
0x005f underscore
0x0060 grave
0x0061 a
0x0062 b
0x0063 c
0x0064 d
0x0065 e
0x0066 f
0x0067 g
0x0068 h
0x0069 i
0x006a j
0x006b k
0x006c l
0x006d m
0x006e n
0x006f o
0x0070 p
0x0071 q
0x0072 r
0x0073 s
0x0074 t
0x0075 u
0x0076 v
0x0077 w
0x0078 x
0x0079 y
0x007a z
0x007b braceleft
0x007c bar
0x007d braceright
0x007e asciitilde
0x007f Delete
0x00a0 nobreakspace
0x00a1 exclamdown
0x00a2 cent
0x00a3 sterling
0x00a4 currency
0x00a5 yen
0x00a6 brokenbar
0x00a7 section
0x00a8 diaeresis
0x00a9 copyright
0x00aa ordfeminine
0x00ab guillemotleft
0x00ac notsign
0x00ad hyphen
0x00ae registered
0x00af macron
0x00b0 degree
0x00b1 plusminus
0x00b2 twosuperior
0x00b3 threesuperior
0x00b4 acute
0x00b5 mu
0x00b6 paragraph
0x00b7 periodcentered
0x00b8 cedilla
0x00b9 onesuperior
0x00ba masculine
0x00bb guillemotright
0x00bc onequarter
0x00bd onehalf
0x00be threequarters
0x00bf questiondown
0x00c0 Agrave
0x00c1 Aacute
0x00c2 Acircumflex
0x00c3 Atilde
0x00c4 Adiaeresis
0x00c5 Aring
0x00c6 AE
0x00c7 Ccedilla
0x00c8 Egrave
0x00c9 Eacute
0x00ca Ecircumflex
0x00cb Ediaeresis
0x00cc Igrave
0x00cd Iacute
0x00ce Icircumflex
0x00cf Idiaeresis
0x00d0 ETH
0x00d1 Ntilde
0x00d2 Ograve
0x00d3 Oacute
0x00d4 Ocircumflex
0x00d5 Otilde
0x00d6 Odiaeresis
0x00d7 multiply
0x00d8 Ooblique
0x00d9 Ugrave
0x00da Uacute
0x00db Ucircumflex
0x00dc Udiaeresis
0x00dd Yacute
0x00de THORN
0x00df ssharp
0x00e0 agrave
0x00e1 aacute
0x00e2 acircumflex
0x00e3 atilde
0x00e4 adiaeresis
0x00e5 aring
0x00e6 ae
0x00e7 ccedilla
0x00e8 egrave
0x00e9 eacute
0x00ea ecircumflex
0x00eb ediaeresis
0x00ec igrave
0x00ed iacute
0x00ee icircumflex
0x00ef idiaeresis
0x00f0 eth
0x00f1 ntilde
0x00f2 ograve
0x00f3 oacute
0x00f4 ocircumflex
0x00f5 otilde
0x00f6 odiaeresis
0x00f7 division
0x00f8 oslash
0x00f9 ugrave
0x00fa uacute
0x00fb ucircumflex
0x00fc udiaeresis
0x00fd yacute
0x00fe thorn
0x00ff ydiaeresis
0x0100 F1
0x0101 F2
0x0102 F3
0x0103 F4
0x0104 F5
0x0105 F6
0x0106 F7
0x0107 F8
0x0108 F9
0x0109 F10
0x010a F11
0x010b F12
0x010c F13
0x010d F14
0x010e F15
0x010f F16
0x0110 F17
0x0111 F18
0x0112 F19
0x0113 F20
0x0114 Find
0x0115 Insert
0x0116 Remove
0x0117 Select
0x0118 Prior
0x0119 Next
0x011a Macro
0x011b Help
0x011c Do
0x011d Pause
0x011e F21
0x011f F22
0x0120 F23
0x0121 F24
0x0122 F25
0x0123 F26
0x0124 F27
0x0125 F28
0x0126 F29
0x0127 F30
0x0128 F31
0x0129 F32
0x012a F33
0x012b F34
0x012c F35
0x012d F36
0x012e F37
0x012f F38
0x0130 F39
0x0131 F40
0x0132 F41
0x0133 F42
0x0134 F43
0x0135 F44
0x0136 F45
0x0137 F46
0x0138 F47
0x0139 F48
0x013a F49
0x013b F50
0x013c F51
0x013d F52
0x013e F53
0x013f F54
0x0140 F55
0x0141 F56
0x0142 F57
0x0143 F58
0x0144 F59
0x0145 F60
0x0146 F61
0x0147 F62
0x0148 F63
0x0149 F64
0x014a F65
0x014b F66
0x014c F67
0x014d F68
0x014e F69
0x014f F70
0x0150 F71
0x0151 F72
0x0152 F73
0x0153 F74
0x0154 F75
0x0155 F76
0x0156 F77
0x0157 F78
0x0158 F79
0x0159 F80
0x015a F81
0x015b F82
0x015c F83
0x015d F84
0x015e F85
0x015f F86
0x0160 F87
0x0161 F88
0x0162 F89
0x0163 F90
0x0164 F91
0x0165 F92
0x0166 F93
0x0167 F94
0x0168 F95
0x0169 F96
0x016a F97
0x016b F98
0x016c F99
0x016d F100
0x016e F101
0x016f F102
0x0170 F103
0x0171 F104
0x0172 F105
0x0173 F106
0x0174 F107
0x0175 F108
0x0176 F109
0x0177 F110
0x0178 F111
0x0179 F112
0x017a F113
0x017b F114
0x017c F115
0x017d F116
0x017e F117
0x017f F118
0x0180 F119
0x0181 F120
0x0182 F121
0x0183 F122
0x0184 F123
0x0185 F124
0x0186 F125
0x0187 F126
0x0188 F127
0x0189 F128
0x018a F129
0x018b F130
0x018c F131
0x018d F132
0x018e F133
0x018f F134
0x0190 F135
0x0191 F136
0x0192 F137
0x0193 F138
0x0194 F139
0x0195 F140
0x0196 F141
0x0197 F142
0x0198 F143
0x0199 F144
0x019a F145
0x019b F146
0x019c F147
0x019d F148
0x019e F149
0x019f F150
0x01a0 F151
0x01a1 F152
0x01a2 F153
0x01a3 F154
0x01a4 F155
0x01a5 F156
0x01a6 F157
0x01a7 F158
0x01a8 F159
0x01a9 F160
0x01aa F161
0x01ab F162
0x01ac F163
0x01ad F164
0x01ae F165
0x01af F166
0x01b0 F167
0x01b1 F168
0x01b2 F169
0x01b3 F170
0x01b4 F171
0x01b5 F172
0x01b6 F173
0x01b7 F174
0x01b8 F175
0x01b9 F176
0x01ba F177
0x01bb F178
0x01bc F179
0x01bd F180
0x01be F181
0x01bf F182
0x01c0 F183
0x01c1 F184
0x01c2 F185
0x01c3 F186
0x01c4 F187
0x01c5 F188
0x01c6 F189
0x01c7 F190
0x01c8 F191
0x01c9 F192
0x01ca F193
0x01cb F194
0x01cc F195
0x01cd F196
0x01ce F197
0x01cf F198
0x01d0 F199
0x01d1 F200
0x01d2 F201
0x01d3 F202
0x01d4 F203
0x01d5 F204
0x01d6 F205
0x01d7 F206
0x01d8 F207
0x01d9 F208
0x01da F209
0x01db F210
0x01dc F211
0x01dd F212
0x01de F213
0x01df F214
0x01e0 F215
0x01e1 F216
0x01e2 F217
0x01e3 F218
0x01e4 F219
0x01e5 F220
0x01e6 F221
0x01e7 F222
0x01e8 F223
0x01e9 F224
0x01ea F225
0x01eb F226
0x01ec F227
0x01ed F228
0x01ee F229
0x01ef F230
0x01f0 F231
0x01f1 F232
0x01f2 F233
0x01f3 F234
0x01f4 F235
0x01f5 F236
0x01f6 F237
0x01f7 F238
0x01f8 F239
0x01f9 F240
0x01fa F241
0x01fb F242
0x01fc F243
0x01fd F244
0x01fe F245
0x01ff F246
0x0200 VoidSymbol
**0x0201 Return**
0x0202 Show_Registers
0x0203 Show_Memory
0x0204 Show_State
**0x0205 Break**
0x0206 Last_Console
__0x0207 Caps_Lock__
0x0208 Num_Lock
0x0209 Scroll_Lock
0x020a Scroll_Forward
0x020b Scroll_Backward
**0x020c Boot //没有使用。**
0x020d Caps_On
0x020e Compose
0x020f SAK
0x0210 Decr_Console
0x0211 Incr_Console
0x0212 KeyboardSignal
0x0213 Bare_Num_Lock
0x0300 KP_0
0x0301 KP_1
0x0302 KP_2
0x0303 KP_3
0x0304 KP_4
0x0305 KP_5
0x0306 KP_6
0x0307 KP_7
0x0308 KP_8
0x0309 KP_9
0x030a KP_Add
0x030b KP_Subtract
0x030c KP_Multiply
0x030d KP_Divide
0x030e KP_Enter
0x030f KP_Comma
0x0310 KP_Period
0x0311 KP_MinPlus
0x0400 dead_grave
0x0401 dead_acute
0x0402 dead_circumflex
0x0403 dead_tilde
0x0404 dead_diaeresis
0x0405 dead_cedilla
0x0500 Console_1
0x0501 Console_2
0x0502 Console_3
0x0503 Console_4
0x0504 Console_5
0x0505 Console_6
0x0506 Console_7
0x0507 Console_8
0x0508 Console_9
0x0509 Console_10
0x050a Console_11
0x050b Console_12
0x050c Console_13
0x050d Console_14
0x050e Console_15
0x050f Console_16
0x0510 Console_17
0x0511 Console_18
0x0512 Console_19
0x0513 Console_20
0x0514 Console_21
0x0515 Console_22
0x0516 Console_23
0x0517 Console_24
0x0518 Console_25
0x0519 Console_26
0x051a Console_27
0x051b Console_28
0x051c Console_29
0x051d Console_30
0x051e Console_31
0x051f Console_32
0x0520 Console_33
0x0521 Console_34
0x0522 Console_35
0x0523 Console_36
0x0524 Console_37
0x0525 Console_38
0x0526 Console_39
0x0527 Console_40
0x0528 Console_41
0x0529 Console_42
0x052a Console_43
0x052b Console_44
0x052c Console_45
0x052d Console_46
0x052e Console_47
0x052f Console_48
0x0530 Console_49
0x0531 Console_50
0x0532 Console_51
0x0533 Console_52
0x0534 Console_53
0x0535 Console_54
0x0536 Console_55
0x0537 Console_56
0x0538 Console_57
0x0539 Console_58
0x053a Console_59
0x053b Console_60
0x053c Console_61
0x053d Console_62
0x053e Console_63
0x0600 Down
0x0601 Left
0x0602 Right
0x0603 Up
__0x0700 Shift //在后面可以看到ShiftL, ShiftR是Shift的同义词。__
__0x0701 AltGr__
__0x0702 Control__
__0x0703 Alt__
**0x0704 ShiftL**
**0x0705 ShiftR**
**0x0706 CtrlL**
**0x0707 CtrlR**
0x0708 CapsShift
0x0800 Meta_nul
0x0801 Meta_Control_a
0x0802 Meta_Control_b
0x0803 Meta_Control_c
0x0804 Meta_Control_d
0x0805 Meta_Control_e
0x0806 Meta_Control_f
0x0807 Meta_Control_g
0x0808 Meta_BackSpace
0x0809 Meta_Tab
0x080a Meta_Linefeed
0x080b Meta_Control_k
0x080c Meta_Control_l
0x080d Meta_Control_m
0x080e Meta_Control_n
0x080f Meta_Control_o
0x0810 Meta_Control_p
0x0811 Meta_Control_q
0x0812 Meta_Control_r
0x0813 Meta_Control_s
0x0814 Meta_Control_t
0x0815 Meta_Control_u
0x0816 Meta_Control_v
0x0817 Meta_Control_w
0x0818 Meta_Control_x
0x0819 Meta_Control_y
0x081a Meta_Control_z
0x081b Meta_Escape
0x081c Meta_Control_backslash
0x081d Meta_Control_bracketright
0x081e Meta_Control_asciicircum
0x081f Meta_Control_underscore
0x0820 Meta_space
0x0821 Meta_exclam
0x0822 Meta_quotedbl
0x0823 Meta_numbersign
0x0824 Meta_dollar
0x0825 Meta_percent
0x0826 Meta_ampersand
0x0827 Meta_apostrophe
0x0828 Meta_parenleft
0x0829 Meta_parenright
0x082a Meta_asterisk
0x082b Meta_plus
0x082c Meta_comma
0x082d Meta_minus
0x082e Meta_period
0x082f Meta_slash
0x0830 Meta_zero
0x0831 Meta_one
0x0832 Meta_two
0x0833 Meta_three
0x0834 Meta_four
0x0835 Meta_five
0x0836 Meta_six
0x0837 Meta_seven
0x0838 Meta_eight
0x0839 Meta_nine
0x083a Meta_colon
0x083b Meta_semicolon
0x083c Meta_less
0x083d Meta_equal
0x083e Meta_greater
0x083f Meta_question
0x0840 Meta_at
0x0841 Meta_A
0x0842 Meta_B
0x0843 Meta_C
0x0844 Meta_D
0x0845 Meta_E
0x0846 Meta_F
0x0847 Meta_G
0x0848 Meta_H
0x0849 Meta_I
0x084a Meta_J
0x084b Meta_K
0x084c Meta_L
0x084d Meta_M
0x084e Meta_N
0x084f Meta_O
0x0850 Meta_P
0x0851 Meta_Q
0x0852 Meta_R
0x0853 Meta_S
0x0854 Meta_T
0x0855 Meta_U
0x0856 Meta_V
0x0857 Meta_W
0x0858 Meta_X
0x0859 Meta_Y
0x085a Meta_Z
0x085b Meta_bracketleft
0x085c Meta_backslash
0x085d Meta_bracketright
0x085e Meta_asciicircum
0x085f Meta_underscore
0x0860 Meta_grave
0x0861 Meta_a
0x0862 Meta_b
0x0863 Meta_c
0x0864 Meta_d
0x0865 Meta_e
0x0866 Meta_f
0x0867 Meta_g
0x0868 Meta_h
0x0869 Meta_i
0x086a Meta_j
0x086b Meta_k
0x086c Meta_l
0x086d Meta_m
0x086e Meta_n
0x086f Meta_o
0x0870 Meta_p
0x0871 Meta_q
0x0872 Meta_r
0x0873 Meta_s
0x0874 Meta_t
0x0875 Meta_u
0x0876 Meta_v
0x0877 Meta_w
0x0878 Meta_x
0x0879 Meta_y
0x087a Meta_z
0x087b Meta_braceleft
0x087c Meta_bar
0x087d Meta_braceright
0x087e Meta_asciitilde
0x087f Meta_Delete
0x0900 Ascii_0
0x0901 Ascii_1
0x0902 Ascii_2
0x0903 Ascii_3
0x0904 Ascii_4
0x0905 Ascii_5
0x0906 Ascii_6
0x0907 Ascii_7
0x0908 Ascii_8
0x0909 Ascii_9
0x090a Hex_0
0x090b Hex_1
0x090c Hex_2
0x090d Hex_3
0x090e Hex_4
0x090f Hex_5
0x0910 Hex_6
0x0911 Hex_7
0x0912 Hex_8
0x0913 Hex_9
0x0914 Hex_A
0x0915 Hex_B
0x0916 Hex_C
0x0917 Hex_D
0x0918 Hex_E
0x0919 Hex_F
0x0a00 Shift_Lock __//_Lock表示Caps Lock键先被按下。__
0x0a01 AltGr_Lock
0x0a02 Control_Lock
0x0a03 Alt_Lock
0x0a04 ShiftL_Lock
0x0a05 ShiftR_Lock
0x0a06 CtrlL_Lock
0x0a07 CtrlR_Lock
0x0a08 CapsShift_Lock
0x0c00 SShift
0x0c01 SAltGr
0x0c02 SControl
0x0c03 SAlt
0x0c04 SShiftL
0x0c05 SShiftR
0x0c06 SCtrlL
0x0c07 SCtrlR
0x0c08 SCapsShift
0x0e00 Brl_blank
0x0e01 Brl_dot1
0x0e02 Brl_dot2
0x0e03 Brl_dot3
0x0e04 Brl_dot4
0x0e05 Brl_dot5
0x0e06 Brl_dot6
0x0e07 Brl_dot7
0x0e08 Brl_dot8
0x0e09 Brl_dot9
0x0e0a Brl_dot10
The following synonyms 同义are recognized:
Control_h for BackSpace
Control_i for Tab
Control_j for Linefeed
Home for Find
End for Select
PageUp for Prior
PageDown for Next
multiplication for multiply
pound for sterling
pilcrow for paragraph
Oslash for Ooblique
**Shift_L for ShiftL**
**Shift_R for ShiftR**
**Control_L for CtrlL**
**Control_R for CtrlR**
**AltL for Alt**
**AltR for AltGr**
**Alt_L for Alt**
**Alt_R for AltGr**
**AltGr_L for Alt**
**AltGr_R for AltGr**
AltLLock for Alt_Lock
AltRLock for AltGr_Lock
SCtrl for SControl
Spawn_Console for KeyboardSignal
Uncaps_Shift for CapsShift
lambda for lamda
Lambda for Lamda
xi for ksi
Xi for Ksi
chi for khi
Chi for Khi
tilde for asciitilde
circumflex for asciicircum
dead_ogonek for dead_cedilla
dead_caron for dead_circumflex
dead_breve for dead_tilde
dead_doubleacute for dead_tilde
Idotabove for Iabovedot
dotlessi for idotless
no-break_space for nobreakspace
paragraph_sign for section
soft_hyphen for hyphen
bielorussian_cyrillic_capital_letter_i for ukrainian_cyrillic_capital_letter_i
cyrillic_capital_letter_kha for cyrillic_capital_letter_ha
cyrillic_capital_letter_ge for cyrillic_capital_letter_ghe
cyrillic_capital_letter_ia for cyrillic_capital_letter_ya
cyrillic_capital_letter_iu for cyrillic_capital_letter_yu
cyrillic_capital_letter_yeri for cyrillic_capital_letter_yeru
cyrillic_capital_letter_reversed_e for cyrillic_capital_letter_e
cyrillic_capital_letter_ii for cyrillic_capital_letter_i
cyrillic_capital_letter_short_ii for cyrillic_capital_letter_short_i
bielorussian_cyrillic_small_letter_i for ukrainian_cyrillic_small_letter_i
cyrillic_small_letter_kha for cyrillic_small_letter_ha
cyrillic_small_letter_ge for cyrillic_small_letter_ghe
cyrillic_small_letter_ia for cyrillic_small_letter_ya
cyrillic_small_letter_iu for cyrillic_small_letter_yu
cyrillic_small_letter_yeri for cyrillic_small_letter_yeru
cyrillic_small_letter_reversed_e for cyrillic_small_letter_e
cyrillic_small_letter_ii for cyrillic_small_letter_i
cyrillic_small_letter_short_ii for cyrillic_small_letter_short_i
rightanglequote for guillemotright
Recognized modifier names and their column numbers:
shift 1
altgr 2
control 4
alt 8
shiftl 16
shiftr 32
ctrll 64
ctrlr 128
capsshift 256

View File

@@ -0,0 +1,68 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T17:08:03+08:00
====== personal.map ======
Created Monday 19 November 2012
本文件是在us.map的基础上修改的功能是将Ctrl和Alt相互调换同时不区分左右Alt。
可以先用**showkey命令**查看键盘上各按键对应的keycode然后修改该文件。
注意keymaps只适合于虚拟终端环境对于X app可以使用xmodmap命令。
# us.map
keymaps 0-2,4-6,8-9,12
**alt_is_meta**
include "qwerty-layout"
**include "linux-with-two-alt-keys" //为emacs使用目的是不区分左右Alt。 fromarchlinux wikiKEYMAPS**
include "compose.latin1"
include "euro1.map"
strings as usual
keycode 1 = Escape
keycode 2 = one exclam
keycode 3 = two at at nul nul
keycode 4 = three numbersign
control keycode 4 = Escape
keycode 5 = four dollar dollar Control_backslash
keycode 6 = five percent
control keycode 6 = Control_bracketright
keycode 7 = six asciicircum
control keycode 7 = Control_asciicircum
keycode 8 = seven ampersand braceleft Control_underscore
keycode 9 = eight asterisk bracketleft Delete
keycode 10 = nine parenleft bracketright
keycode 11 = zero parenright braceright
keycode 12 = minus underscore backslash Control_underscore Control_underscore
keycode 13 = equal plus
keycode 14 = Delete
keycode 15 = Tab
shift keycode 15 = Meta_Tab
keycode 26 = bracketleft braceleft
control keycode 26 = Escape
keycode 27 = bracketright braceright asciitilde Control_bracketright
keycode 28 = Return
alt keycode 28 = Meta_Control_m
__#keycode 29 = Control //29对应的的是空格左边的Control按键现在将其与绑定到Alt modifier。__
__keycode 29 = Alt__
keycode 39 = semicolon colon
keycode 40 = apostrophe quotedbl
control keycode 40 = Control_g
keycode 41 = grave asciitilde
control keycode 41 = nul
keycode 42 = Shift
keycode 43 = backslash bar
control keycode 43 = Control_backslash
keycode 51 = comma less
keycode 52 = period greater
keycode 53 = slash question
control keycode 53 = Control_underscore
control shift keycode 53 = Delete
keycode 54 = Shift
__#keycode 56 = Alt //56对应的是空格左边的Alt按键现在将其绑定到Control modifier。__
__keycode 56 = Control__
keycode 57 = space
control keycode 57 = nul
keycode 58 = Caps_Lock
keycode 86 = less greater bar
__keycode 97 = Control //空格右边的Control和Alt键不用修改。__
keycode 100 = Alt

View File

@@ -0,0 +1,72 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T19:12:45+08:00
====== wiki KEYMAPS ======
Created Monday 19 November 2012
https://wiki.archlinux.org/index.php/KEYMAP
===== KEYMAP =====
The **KEYMAP** variable is specified in the __/etc/vconsole.conf__ file. It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the **kbd** package.
===== Keyboard layouts =====
This is the list of known keymap settings to work for the corresponding **keyboard layouts**. Most keymaps can be found in the **/usr/share/kbd/keymaps/i386**/layout (__layout=qwerty, azerty, dvorak, etc__.) directory.
Less common but nonetheless useful keymaps for Arch Linux are found in the /usr/share/kbd/keymaps/architecture (architecture=mac, sun, etc.) directory.
Note: In an X session, you can use setxkbmap to instantly apply keyboard layout: setxkbmap -layout dvorak
Note: If these keymaps do not work for you, make sure the keymap file exists in /usr/share/kbd/keymaps/ using find: find /usr/share/kbd/keymaps/ -name "*[your desired keymap]*"
**Keyboard Keymap setting**
Belgian KEYMAP=be-latin1
Brazilian Portuguese KEYMAP=br-abnt2
Canadian-French KEYMAP=cf
Canadian Multilingual (in AUR) KEYMAP=ca_multi
Colemak (US) KEYMAP=colemak
Croatian KEYMAP=croat
Czech KEYMAP=cz-lat2
Dvorak KEYMAP=dvorak
French KEYMAP=fr-latin1
German KEYMAP=de-latin1
German (no dead keys) KEYMAP=de-latin1-nodeadkeys
Italian KEYMAP=it
Lithuanian (qwerty) KEYMAP=lt.baltic
Norwegian KEYMAP=no-latin1
Polish KEYMAP=pl
Portuguese KEYMAP=pt-latin9
Romanian KEYMAP=ro_win
Russian KEYMAP=ru4
Singapore KEYMAP=sg-latin1
Slovene KEYMAP=slovene
Swedish KEYMAP=sv-latin1
Swiss-French KEYMAP=fr_CH-latin1
Swiss-German KEYMAP=de_CH-latin1
Spanish KEYMAP=es
Spanish Latinoamerican KEYMAP=la-latin1
Turkish KEYMAP=tr_q-latin5
Ukrainian KEYMAP=ua
United Kingdom KEYMAP=gb or KEYMAP=uk in the installer.
===== Configuring the Console Keymap =====
1. cd to /usr/share/kbd/keymaps/i386/qwerty
2. Copy your default keymap (us.map.gz) to a new file personal.map.gz
3. gunzip the new map file
4. Edit personal.map using your favorite editor. Examples:
__Make the Right Alt key same as Left Alt key (Emacs)__
change the line include "linux-with-alt-and-altgr" to include "linux-with-two-alt-keys"
Swap CapsLock with Escape (Vim)
make keycode 1 = Caps_Lock and keycode 58 = Escape
Make CapsLock another Control key
change the line keycode 58 = Caps_Lock to keycode 58 = Control
Swap CapsLock with Left Control key
make keycode 29 = Caps_Lock and keycode 58 = Control
注意可以使用showkey命令查看虚拟终端环境中某个按键的keycode对于X 环境可以使用xev命令
5. gzip the map file
Change the default keyboard layout file that will be used by editing /etc/vconsole.conf (you might have to create this file) and changing the line that says KEYMAP=us to KEYMAP=personal
6. Reboot to use your keymap the way nature intended (or run "__loadkeys personal__")

View File

@@ -0,0 +1,88 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T19:58:36+08:00
====== wiki xmodmap ======
Created Monday 19 November 2012
https://wiki.archlinux.org/index.php/Xmodmap
===== Summary =====
A general overview of modifying **keymaps and pointer** mappings with xmodmap.
===== Introduction =====
The Linux kernel generates a code each time a key is pressed on a keyboard. That code is compared to __a table of keycodes__ defining a figure that is then displayed.
This process is complicated by **Xorg**, which starts its own table of keycodes. __Each keycode can belong to a keysym__. A keysym is like a function, started by typing a key. Xmodmap allows you to edit these keycode-keysym relations.
===== Keymap table =====
Print the current keymap table **formatted into expressions**:
$ xmodmap -pke
keycode 57 = n N
Each keymap is followed by the keysyms it is mapped to. The above example indicates that the keycode 57 is mapped to the lowercase n, while the uppercase N is mapped to keycode 57 and Shift.
**xmodmap文件的语法格式与keymaps相似具体格式可以参考**[[keymaps]] 。**内核可以识别的所有keysyms可以在虚拟终端中用dumpkeys -l命令查看。**
Each keysym column in the table corresponds to a particular key combination:
1. Key
2. Shift+Key
3. mode_switch+Key
4. mode_switch+Shift+Key
5. AltGr+Key
6. AltGr+Shift+Key
Not all keysyms have to be set, but if you want to assign a latter keysym without assigning earlier ones set them to **NoSymbol**.
You can check which keymap corresponds to a key on your keyboard with __xev__.
Tip: There are predefined descriptive keycodes that make mapping additional keys easier (e.g. XF86AudioMute, XF86Mail). Those keycodes can be found in: /usr/include/X11/XF86keysym.h
===== Custom table =====
You can create your own map and store it in your home directory (i.e. ~/.Xmodmap). Print the current keymap table into a configuration file:
__xmodmap -pke > ~/.Xmodmap__
Make the desired changes to ~/.Xmodmap and then test the new configuration with:
xmodmap ~/.Xmodmap
To activate your custom table when starting Xorg add the following:
~/.xinitrc
if [ -f $HOME/.Xmodmap ]; then
/usr/bin/xmodmap $HOME/.Xmodmap
fi
Alternatively, edit the global startup script /etc/X11/xinit/xinitrc.
===== Test changes =====
You can also make temporary changes for the current session. For example:
xmodmap -e "keycode 46 = l L l L lstroke Lstroke lstroke"
xmodmap -e "keysym a = e E"
===== Special keys/signals =====
You can also also edit the keys: Shift, Ctrl, Alt and Super (there always exists a left and a right one (__Alt_R=AltGr__))
At first you have to delete/clear the signals that should be edited. In the beginning of your ~/.Xmodmap:
!clear Shift
!clear Lock
clear Control
!clear Mod1
!clear Mod2
!clear Mod3
clear Mod4
!clear Mod5
keycode 8 =
...
Remember, ! is a comment so only Control and Mod4 (Standard: Super_L Super_R) get cleared.
Write the new signals at the end of ~/.Xmodmap
keycode 255 =
!add Shift = Shift_L Shift_R
!add Lock = Caps_Lock
add Control = Super_L Super_R
!add Mod1 = Alt_L Alt_R
!add Mod2 = Mode_switch
!add Mod3 =
add Mod4 = Control_L Control_R
!add Mod5 =
The Super keys have now been exchanged with the Ctrl keys.
===== Reverse Scrolling =====
The natural scrolling feature available in OS X Lion can be mimicked with xmodmap. Since the synaptics driver uses the buttons 4/5/6/7 for up/down/left/right scrolling, you simply need to swap the order of how the buttons are declared in ~/.Xmodmap.
Open ~/.Xmodmap and append the following line to the file:
pointer = 1 2 3 5 4 7 6 8 9 10 11 12
Note how the 4 and 5 have been reversed.
Then update xmodmap:
xmodmap ~/.Xmodmap
To return to regular scrolling simply reverse the order of the 4 and 5 or delete the line altogether. For more information check Peter Hutterer's post, Natural scrolling in the synaptics driver, or the Reverse scrolling direction ala Mac OS X Lion? forum thread.

View File

@@ -0,0 +1,133 @@
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2012-11-19T11:27:20+08:00
====== xmodmap ======
Created Monday 19 November 2012
http://lins05.mysmth.net/2011/04/24/67/
注意xmodmap修改键盘布局的方法只适用于X client app对于虚拟终端应用需要修改keymaps文件可以参考[[wiki KEYMAPS]]
这是一篇介绍xmodmap工具的简单教程适合于以下童鞋
* Emacs用户需要交换 CapsLock 和 left Ctrl的人或者和我一样交换Alt_L和Control_L。
* 其他有改键需要的人。
* 喜欢瞎折腾的人。
读了这篇帖子你会发现在linux下修改键盘布局是如此的简单(我替你们做了功课花二十分钟通读了xmodmap的man手册)。
===== 提出问题: =====
如何交换CapsLock和左边的Ctrl键
答:
# xmodmap -e "remove lock = Caps_Lock"
# xmodmap -e "remove control = Control_L"
# xmodmap -e "add control = Caps_Lock"
# xmodmap -e "add lock = Control_L"
后面的内容是具体的教程,前面是提供给只需要一个做法而不需要了解具体的原理的。如果你属于此类,完全可以不看后面的内容了。 不过原理很简单而且一旦学会改键就跟grep一个正则表达式差不多简单。
===== 分析问题: =====
看到这里的人,应该是有耐心理解下面三个概念的: keycode/keysym/modifier 这三个概念是键盘相关的、层次从低到高的三个名词。
===== keycode =====
一般的键盘上有102或者105键每一个键被按下时会产生一个特有类型、主板能够分辨的电信号传输给主板主板给不同的电信号定下不同的编号这就是所谓的keycode。 这些电信号是在生产键盘时就定死了的比如左边的Ctrl键产生的keycode是37。CapsLock键产生的keycode是66。 要查找某个按键的keycode可以在term中用__`xev`__程序来查看。xev使用很简单它运行时你按下一个键term中就会显示这个键的许多信息其中就有keycode。 这些keycode是硬件决定的你我无法改变。总之记住一个按键产生的keycode是不可能在软件中改变的。
===== keysym =====
操作系统按照统一的规范给不同的keycode映射为不同的含义这个映射后的含义的术语就叫做keysym。比如你在emacs中打字时按下一个s键。屏幕上出现一个`s`,而不是出现一个`b`是因为系统接收到s的keycode我用xev查了下keycode(s) = 39 按照默认的标准39对应于字母`s`,于是就这个`s`显示在屏幕上。 (当然,更严谨地、更准确地说,应该是把`s`这个字母作为输入传递给Emacsemacs再把这个字母插入到当前的文件中的。) 这里keycode是39其对应的符号术语叫keysym即`key symbol`,就是字母`s`。 同理你按下键盘上的b'(keycode(b) = 56),它的(默认的)keysym就是字母`b`。 系统给一个keycode分配的keysym不只一个。对于一个字母键至少两个。第一个是单独按下这个键时对应的一第二个是shift和这个键同时按下时的keysym。 键盘上还有另外一类按键它们单独按下时一般没有任何意义只有与其他的按照一直按下时是才会产生一些特殊的效果比如Ctrl、Shift、win键它们实现的效果称为modifier。
===== Modifier修饰符 =====
“修饰符”的修饰二字很好解释你按下s是打一个字母s你按下Ctrl+s大部分软件里会保存当前文件你按下Shift+s是打另一个字母S。总之是 “改变一个键的本来含义“。因为`modify`本来就是修改的意思。 在term里输入命令`xmodmap`,会出现以下内容
┌─[geekard @ kb310]─[16:27]─[~]─[326]
└─[$] xmodmap
xmodmap: up to 4 keys per modifier (keycodes in parentheses):
shift Shift_L (0x32) Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x40) Control_R (0x69)
mod1 Alt_L (0x25) Alt_R (0x6c) Alt_L (0xcc) Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85) Super_R (0x86) Super_L (0xce) Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c) Mode_switch (0xcb)
左边那一列,就是系统中所有的`modifier`。 系统会把一些默认的keysym解释为modifier比如默认情况下你按下Shift + s 屏幕上出现大写的S整个过程其实是
* 系统收到Shift键和s键的keycode
* 系统处理 keycode>keysym 的映射: shift的keycode被映射到`SHIFT_L`这个keysyms的keycode被映射到`s`这个keysym
* 系统发现SHIFT_L这个keysym被定义为shfit这个modifier。
* `s`被shift这个modifier给修饰了修饰的结果是变成了大写的S。
基本概念讲完了,那么,`xmodmap`是如何帮我们实现`改键`的呢? 可以看到,从按下一个键到最后,有两个层次的映射过程:
第一层: keycode>keysym
第二层: keysym > modifier
因此,我们可以通过两种方法来实现改键。
===== 目标1把键盘上的s和a键交换位置 =====
先查询s和a对应的keycode方法还是使用`xev'程序。例如我的输出如下:
KeyPress event serial 39 synthetic NO window 0x3200001
root 0xb7 subw 0x0 time 14363110 (97129) root:(99152)
state 0x10 keycode 39 (keysym 0x73 s) same_screen YES
XLookupString gives 1 bytes: (73) "s"
XmbLookupString gives 1 bytes: (73) "s"
XFilterEvent returns: False
......
KeyPress event serial 39 synthetic NO window 0x3200001
root 0xb7 subw 0x0 time 14364150 (97129) root:(99152)
state 0x10 keycode 38 (keysym 0x61 a) same_screen YES
XLookupString gives 1 bytes: (61) "a"
XmbLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False
===== 交换s/a的位置 =====
# xmodmap -e "keycode 39 = a"
# xmodmap -e "keycode 38 = s"
这样,就交换了 s/a 这两个键的位置了! 注意在你执行了第一条语句之后s立刻被重新映射到a了那么你第二条语句中的`s`怎么打出来呢?
两个方法: i) 从别处粘贴一个过来 ii)见最后的`xmodmap执行命令的三种方式`
注意这个方法只能交换一般的keysym那些定义为Modifier的键就不能简单地用这个方式交换。
因为: 当一个keysym被定义为modifier那么__本质上是在 keycode>modifier之间建立起了一个映射__。因此即使你改变了它的keycode>keysym关系也不起作用 也就是说当你要把一个键定义一个modifier时你只能把它的keycode对应的keysym定义为modifier从而达到目的。但这之后即使keycode映射到别的keysym了这个keycode仍然是一个modifier。 因此如果要交换CapsLock和Ctrl这两个键只需要做两件事
* 把`Caps_Lock`这个keysym定义为`control`这个modifer
* 把`Control_L`这个keysym定义为`Caps_Lock`这个modifier Control_L是左Ctrl键的默认keysym)
===== 目标2 交换 Caps_Lock和 左边的Ctrl =====
先把CapsLock这个keysym映射到control这个modifier
# xmodmap -e "remove lock = Caps_Lock"
# xmodmap -e "add control = Caps_Lock"
__因为一个keysym不能同时映射到两个modifier__因此我们需要先用remove把Caps_Lock这个keysym与lock这个modifier的映射关系删除当前的modifier与keysymb的关系可以用xmodmap -pkm命令查看。。然后再把Caps_Lock这个keysym映射到Control这个modifier。 remove和add的的语法是
复制代码
remove/add modifier_name = keysym_name
此时,你可以试一下,看看是否已经产生效果了?
同样再把左边的Ctrl键映射到CapsLock
# xmodmap -e "remove control = Control_L"
# xmodmap -e "add Caps_Lock = Control_L"
===== 目标3交换左侧的Ctrl和Alt同时将右侧的Alt映射到Esc这样可以支持命令行编辑 =====
1. 先用xmodmap -pm查看当前的modifier与哪些keycode绑定(间接通过keysyms)
$ xmodmap -pm
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x40), Control_R (0x69)
mod1 Alt_L (0x25), Escape (0x6c), Alt_L (0xcc), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
2. 然后编辑~/.xmodmap文件
!swithc alt and ctl
remove Mod1 = Alt_L
remove Control = Control_L
keycode 37= Alt_L
keycode 64 = Control_L
!Right Alt maps to Esc
keycode 108 = Escape
add Control = Control_L
add Mod1 = Alt_L
xmodmap执行命令的三种方式
1) xmodmap -e "do somthing" 是让xmodmap执行后面的一条句子。但这样一次只能执行一条。
2) 你也可以先输入 `xmodmap -`然后回车然后输入任意多句子每输入一条就用回车分隔最后用Ctrl+D结束输入。
3) 把remove xxx = yyy 这些句子都写到一个文件里。一般是~/.Xmodmap。然后用 `xmodmap ~/.Xmodmap`执行。 这样的好处是,在启动时的某个脚本里加一行命令,就不用每次重启都手动地改键了。