[已解决]新手请教,空格键损坏,如何映射?

各种窗口管理器和美化相关
回复
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

[已解决]新手请教,空格键损坏,如何映射?

#1

帖子 caryloo » 2008-08-26 20:08

大家好。

我刚刚用wubi方式安装上xubuntu 8.04.1

但是由于我的键盘上的空格键已经损坏,我在win里面一直是用insert键代替空格键的(就在空格键旁边)


不知道在ubuntu里面该怎么设置才能进行映射? 我还是想用insert键代替space键

解决方式:

我现在换用了 Ubuntu,在系统-会话添加如下命令:

代码: 全选

/usr/bin/xmodmap -e "keysym Insert = space"
现在开机已经可以正常使用了空格键了 。[/b] [/size]
上次由 caryloo 在 2008-08-28 1:50,总共编辑 1 次。
头像
sinyadvan
帖子: 724
注册时间: 2008-04-02 15:36
来自: O_O

#2

帖子 sinyadvan » 2008-08-26 20:23

man

代码: 全选

showkey
loadkeys
keymaps
setkeycodes
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O

本公司专治各种不服、不爽、谩骂、挑衅。
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

#3

帖子 caryloo » 2008-08-26 20:36

hi friend:

Can you help me to solve the above problem?

because can't use space , I can do nothing even reading the help
头像
sinyadvan
帖子: 724
注册时间: 2008-04-02 15:36
来自: O_O

#4

帖子 sinyadvan » 2008-08-26 21:11

Re. my friend:
You'd better buy a new one.
A new keyboard just cost you 15 yuan.
More convenient.
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O

本公司专治各种不服、不爽、谩骂、挑衅。
头像
alpha080
帖子: 171
注册时间: 2007-10-23 22:05
联系:

#5

帖子 alpha080 » 2008-08-26 21:39

试试KeyTouch这个软件
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

#6

帖子 caryloo » 2008-08-26 22:25

sinyadvan 写了:Re. my friend:
You'd better buy a new one.
A new keyboard just cost you 15 yuan.
More convenient.
你好,我用的是笔记本键盘,没有办法更换啊。我现在发现临时输入以下命令可以交换insert键和空格键

sudo xmodmap -e "keysym Insert = space"



新问题来了:

我在/etc/rc.local里设置了启动时执行这条命令

sudo xmodmap -e "keysym Insert = space"
exit 0


但为什么启动以后无效呢?还是只能继续手动输入后运行才可以。
头像
sinyadvan
帖子: 724
注册时间: 2008-04-02 15:36
来自: O_O

#7

帖子 sinyadvan » 2008-08-26 23:21

Good work. :D
What I mean is that an external keyboard.so you can reduce the frequency of use notebook-keyboard.

1.Wrote a script called like below:

代码: 全选

vi  /etc/init.d/keyload
2.Saved the file and make the file executable:

代码: 全选

 chmod a+x /etc/init.d/keyload
3.Create the Links to the required runlevel

代码: 全选

cd /etc/rc$(runlevel|cut -d' ' -f2).d
sudo ln -s /etc/init.d/keyload S20keyload
sudo ln -s /etc/init.d/keyload ../rc6.d/S20keyload
like that:

代码: 全选

lrwxrwxrwx 1 root root  24 2008-08-16 19:11 S06keyboard-setup -> ../init.d/keyboard-setup
lrwxrwxrwx 1 root root  22 2008-08-26 23:18 S20keyload -> ../init.d/keyload
Here is the Script:

代码: 全选

#!/bin/bash
/usr/bin/xmodmap -e "keysym Insert = space"
Good luck :D
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O

本公司专治各种不服、不爽、谩骂、挑衅。
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

#8

帖子 caryloo » 2008-08-26 23:43

I am in windows now. I will try your way tomorrow. and report the result here.

In fact, I already try similar way just now, but I only use xmodmap, instead of /usr/bin/xmodmap, maybe this is the point!
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

#9

帖子 caryloo » 2008-08-27 8:05

今天测试了一下,发现还是不行。

但是我注意到以下错误信息:

/usr/bin/xmodmap [fail] can not start display


我认为是不是因为xmodmap是x里的程序命令,所以在系统启动的时候,由于x还没有启动,导致执行这条命令无效呢?

有没有办法在进入x以后设定好自动执行这条命令的方法?
头像
sinyadvan
帖子: 724
注册时间: 2008-04-02 15:36
来自: O_O

#10

帖子 sinyadvan » 2008-08-27 10:05

添加到会活,用sleep延时执行
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O

本公司专治各种不服、不爽、谩骂、挑衅。
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

#11

帖子 caryloo » 2008-08-27 11:22

sinyadvan 写了:添加到会活,用sleep延时执行
感谢你的及时回复。

但是我是新手,不太明白你的意思。

是不是添加到 会话? 但是xubuntu好像没有“会话”这个东西? 我记得是不是ubuntu才有的?不知道在xubuntu下面该如何设置?

sleep延时执行这个我不太懂,不过我可以稍后去查一下怎么弄。
头像
sinyadvan
帖子: 724
注册时间: 2008-04-02 15:36
来自: O_O

#12

帖子 sinyadvan » 2008-08-27 12:57

启动顺序改一下。
#!/bin/bash
sleep 10 && /usr/bin/xmodmap -e "keysym Insert = space"

延时10s
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O

本公司专治各种不服、不爽、谩骂、挑衅。
头像
caryloo
帖子: 27
注册时间: 2007-08-19 22:47
来自: 无锡

#13

帖子 caryloo » 2008-08-27 23:42

sinyadvan 写了:启动顺序改一下。
#!/bin/bash
sleep 10 && /usr/bin/xmodmap -e "keysym Insert = space"

延时10s
经过测试,这个命令还是无效。

我现在换用了 Ubuntu,在系统-会话添加如下命令:

/usr/bin/xmodmap -e "keysym Insert = space"

现在开机已经可以正常使用了空格键了 。

不得不佩服gnome桌面的易用性呀……
回复