Why waste all those buttons?

So maybe you've been using Linux for a while and want to use all the Internet keys on your keyboard. Maybe you have foreign friends and need to type accents, and you've noticed the alt keycodes don't work.

Either way, if you're anything like me, you've been at it for half an hour and at this point you're leaning over too closely to your monitor, making vaguely inhuman noises, mashing keys, periodically throwing your mouse, and barking such eloquently-phrased queries as " MOTHERFUCKING SON OF A BITCH! WHY WON'T THIS FUCKING PIECE OF SHIT JUST WORK?"

Geez, relax. Take a break. Come back when you can control your temper, young man.

Back so soon? Okay, run xev. You can do this by running an xterm and typing in "xev." Imagine that. If you don't have it, check your package manager for X11R6-contrib.

Now, this thing's a window, and in your xterm you'll see lots of funny stuff. Now mash the key you want a couple times and make note of its keycode. Internet keys are good choices, and so are the Windows and pointer keys. That ought to be on the second line. Write it down, pal. Then you can close xev. It's kind of cool when you run the mouse pointer over the xev window though; try it.

xmodmap -pke > ~/Xmodmap.save

Run the above line. Open this up in a text editor. This is your keyboard layout! Cool, huh? The first button is normal and the second is shift, so if you need lots of stuff, you can add that too.

Now find the numbers you wanted to which you want to assign functions. If you want accents, add a Multi_key (case-sensitive, buck-o) entry. See the node at Compose for more on that. If you want hotkeys, add new function keys. There are twelve on your keyboard, so start at F13. You can't give these shift values.

Done? Run the line below and restart your window manager or desktop environment, kids!

xmodmap ~/Xmodmap.save

If you use KDE or Gnome, you're a wuss. But I kid. KDE and Gnome offer graphical configurations for keyboard shortcuts. If you're using icewm without a desktop environment, besides being a radical dude (Case in point: I am too), you should try editing /usr/lib/X11/icewm/keys or similar. Go get 'em, tiger!

Log in or registerto write something here or to contact authors.