Chinaunix首页 | 论坛 | 博客
  • 博客访问: 408374
  • 博文数量: 59
  • 博客积分: 5195
  • 博客等级: 大校
  • 技术积分: 645
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-01 14:38
文章分类

全部博文(59)

文章存档

2017年(1)

2011年(10)

2010年(1)

2009年(9)

2008年(1)

2007年(35)

2006年(2)

我的朋友

分类: LINUX

2009-10-29 16:36:48

一、图形界面
解决思路:
1>xev获取keycode
2>xmodmap -pke |grep keycode
3>修改正确的键码并加载

1.运行xev命令
在终端查看键值,如shift+\:
1>正确的键值信息
KeyPress event, serial 34, synthetic NO, window 0x2400001,
    root 0xae, subw 0x0, time 19473292, (685,-121), root:(1316,234),
    state 0x1, keycode 51 (keysym 0x7c, bar), same_screen YES,
    XLookupString gives 1 bytes: (7c) "|"
    XmbLookupString gives 1 bytes: (7c) "|"
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x2400001,
    root 0xae, subw 0x0, time 19473356, (685,-121), root:(1316,234),
    state 0x1, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x2400001,
    root 0xae, subw 0x0, time 19473388, (685,-121), root:(1316,234),
    state 0x0, keycode 51 (keysym 0x5c, backslash), same_screen YES,
    XLookupString gives 1 bytes: (5c) "\"
    XFilterEvent returns: False

从"keycode 51 (keysym 0x7c, bar)"可以看出"|"键的信息:
keycode: 51
keysym: 0x7c
keyname: bar
char: |
从"keycode 51 (keysym 0x5c, backslash)"可以看出"\"键的信息:
keycode: 51
keysym: 0x5c
keyname: backslash
char: \

2>错误的键值信息
KeyPress event, serial 34, synthetic NO, window 0x1800001,
    root 0x3a, subw 0x0, time 2600336, (127,-103), root:(550,188),
    state 0x1, keycode 51 (keysym 0x7e, asciitilde), same_screen YES,
    XLookupString gives 1 bytes: (7e) "~"
    XmbLookupString gives 1 bytes: (7e) "~"
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x1800001,
    root 0x3a, subw 0x0, time 2600400, (127,-103), root:(550,188),
    state 0x1, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x1800001,
    root 0x3a, subw 0x0, time 2600448, (127,-103), root:(550,188),
    state 0x0, keycode 51 (keysym 0x23, numbersign), same_screen YES,
    XLookupString gives 1 bytes: (23) "#"
    XFilterEvent returns: False

从"keycode 51 (keysym 0x7e, asciitilde)"可以看出"|"键的信息:
keycode: 51
keysym: 0x7e
keyname: asciitilde
char: ~
从"keycode 51 (keysym 0x23, numbersign)"可以看出"\"键的信息:
keycode: 51
keysym: 0x23
keyname: numbersign
char: #

2.运行xmodmap -pke命令
1>正确的键值信息
keycode  51 = backslash bar backslash bar backslash bar
2>错误的键值信息
keycode  51 = numbersign asciitilde dead_grave dead_tilde

3.
echo "keycode  51 = backslash bar backslash bar backslash bar" > Xmodmap
1>xmodmap Xmodmap [当前系统加载]
2>mv Xmodmap ~/.Xmodmap [登录后自动加载]

二、字符终端
loadkeys -d [加载默认的键盘映射表,默认文件是/usr/share/keymaps/i386/qwerty/defkeymap.kmap.gz]

阅读(1008) | 评论(0) | 转发(0) |
0

上一篇:qemu for powerpc

下一篇:debian for wine

给主人留下些什么吧!~~