开发者

How to bind key to another key in ubuntu?

I would like to map my "WASD" to the arrows.

I don't like moving my hands around. I already fixed it for my editor by calling W for arrowUp.

But, how can I bind it for the entire system? When I call W, I want it to call th开发者_StackOverflowe arrow UP.

I can't bind those keys one software at the time.

Any ideas?

Thanks.

-hbt


To determine the keycodes for keys on your keyboard, you can run a program called "xev". When running, you just press keys and you'll see the codes appear in the program. By keeping track of these you can make changes to the keys that need updating.

Then, you use a commandline program called "xmodmap (http://cf.ccmr.cornell.edu/cgi-bin/w3mman2html.cgi?xmodmap(1))" to remap a keystroke. So for instance:

 xmodmap -e 'keycode 234=F2'

This would remap the key on the keyboard that generates keycode signal 234 to now be treated as the "F2" key. You can read the xmodmap documentation online to determine how to refer to various keystrokes.

So then you can build up a list of xmodmap lines, and put them all in a script that gets executed at login time, so that your keyboard is mapped the way you like.

http://ubuntuforums.org/archive/index.php/t-354969.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜