I always come back to this post when I'm setting up my logitech elite ps2 keyboard on any linux distro, and it always gets me close but not all the way. I have a super fast fix that I'm putting here because my keycodes argue with all of the others on the internet, so this is for all those of y'all who want a super fast fix and have my keycodes.
There's no need to create new keyboards or anything like that, as far as I can see. All I do is create a file in my home directory called .xmodmaprc, (and some people have default xmodmap files that are executed, you might be able to use those.) Then I have xmodmap execute the file on startup, and there are different ways to do this - in KDE I put a shortcut in my ~/.kde/Autostart folder that runs the command "xmodmap ~/.xmodmaprc" - obviously without the quotes. In gnome I used to do this differently, there was a menu item called something like session options or something ["start menu", preferences, more preferences, sessions], anyway it allowed you to put in startup commands. I put the same thing in there, along with other programs, like xscreensaver -nosplash and imwheel, etc.
After you create the xmodmaprc file and have executed it, you are ready to start using the keys. It's that easy. I don't get the whole creating a new keyboard model or anything. In kde 3.2+ you can easily map them with khotkeys (have fun in kde 3.1- (come out from under your rock)) and in gnome you should use the metacity config editor. The command for that is, I think, gnome-config-editor ["start menu", system tools, more system tools, configuration editor] or something like that, it should come up if you start typing it correctly in the run dialog, and the icon is the red vw bug with the trunk up. Here's the xmodmaprc file for MY Logitech Eliete ps2 keyboard.
This is if you don't want kmix to do your audio for you, and you'd rather use aumix or other, you have to map your keycodes to something other than the easy-to-read codes XF86AudioMute, etc. I use eject, poweroff, and wakeup because the elite doesn't have these keys. There are a slew of mapable names, you can call these any of them - just don't try making your own.
keycode 144 = XF86AudioPrev
keycode 145 = XF86Messenger
keycode 146 = XF86WebCam
keycode 147 = XF86iTouch
keycode 148 = XF86Shop
keycode 153 = XF86AudioNext
keycode 160 = XF86Eject
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 174 = XF86PowerOff
keycode 176 = XF86WakeUp
keycode 178 = XF86HomePage
keycode 223 = XF86Standby
keycode 229 = XF86Search
keycode 230 = XF86Favorites
keycode 236 = XF86Mail
keycode 237 = XF86AudioMedia
keycode 233 = XF86Go
keycode 234 = XF86Back
This is if you DO want kmix to do your audio for you (kde only, i think)
keycode 144 = XF86AudioPrev
keycode 145 = XF86Messenger
keycode 146 = XF86WebCam
keycode 147 = XF86iTouch
keycode 148 = XF86Shop
keycode 153 = XF86AudioNext
keycode 160 = XF86AudioMute
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 178 = XF86HomePage
keycode 223 = XF86Standby
keycode 229 = XF86Search
keycode 230 = XF86Favorites
keycode 236 = XF86Mail
keycode 237 = XF86AudioMedia
keycode 233 = XF86Go
keycode 234 = XF86Back
And the cream of the cream, my setup and my commands (this one is just for my own convenience)
keycode 145 = XF86Messenger //gaim
keycode 236 = XF86Mail //thunderbird
keycode 146 = XF86WebCam //sudo /usr/sbin/synaptic (debian apt-get gui)
keycode 147 = XF86iTouch //firefox
http://aaronsmiley.deviantart.com
keycode 148 = XF86Shop //firefox
http://www.newegg.com
keycode 229 = XF86Search //firefox
http://www.google.com
keycode 230 = XF86Favorites //firefox
http://www.aaronsmiley.com
keycode 160 = XF86Eject //aumix -v -25 (aka mute - rather than mute I go down by increments of 25 for faster volume lowering)
keycode 237 = XF86AudioMedia //aumix -v -25 (aka media - rather than unmute I go up by increments of 25 for faster volume raising)
keycode 174 = XF86PowerOff //aumix -v -2 (aka volume down - aumix lowers system volume by increments of 2)
keycode 176 = XF86WakeUp //aumix -v +2 (aka volume up - aumix raises system volume by increments of 2)
keycode 162 = XF86AudioPlay //xmms -t (this is the same as play/pause, if you want play, just use -p or pause -u)
keycode 144 = XF86AudioPrev //xmms -r
keycode 153 = XF86AudioNext //xmms -f
keycode 164 = XF86AudioStop //xmms -s
keycode 178 = XF86HomePage //~
keycode 223 = XF86Standby //xscreensaver-command -lock
keycode 233 = XF86Go //konsole
keycode 234 = XF86Back //sudo konsole
I hope this was of some help. Took me a couple hours to put together, but I know it'll save me a hundred hours down the road, and hopefully help a few others, too.
Edit: I went back to gnome and looked where things were. I have added them in square brackets.