Comments on How To Utilize Your New Multimedia Keyboard Under Linux

How To Utilize Your New Multimedia Keyboard Under Linux Xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X Window. It links commands to keys or mouse buttons, using its configuration file. It does not depend on the window manager and can capture all keyboard keys.

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

I'm afraid that in looking into the more complicated solution, you've overlooked some great resources that are already available to use with much less setup.  The best program for multimedia keyboards in linux is called "keyTouch" and is available at http://keytouch.sourceforge.net/.

 An older program (development seems to have stopped about five months ago) is LinEAK, available at http://lineak.sourceforge.net/.

Both of these programs require the user to simply select the keyboard and their multimedia buttons work with no more configuration.  keyTouch allows the user to add or change the commands, all without delving into the command line.

 Respectfully,

Jacob 

By:

Hi Jacob!

Yes, your program may be more suitable for more complex stuff but it depends on the kernel. Xbindkeys does not depend on anything, that's why I chose it for setting up my keyboard with it. Actually it has a GUI frontend for setup as I mentioned in the tuto but I found it more uncomfortable using it than editing a little text file.
Anyway, thanks for your comment.

Csarlee

By:

It is unfortunate that that the author did not cover the technologies involved, and discuss all the possible solutions.

Both KDE and GNOME (not sure about other desktops) have comprehensive native support for multimedia keys. For both desktops, the only thing that you need to do is ensure that your keyboard layout is configured correclty. This is best done by setting the "XkbModel" option in Xorg.conf (as the X server is really the only thing that can know what keyboard model you have - especially if you use applications/X remotely, or have the same home directory on multiple machines).

 However, this does require that X knows what the keycodes should translate to - but in the end it is much more useful for people to contribute their keyboard definitions for X than waste time with workaround utilities (such as xbindkeys, lineak etc etc).

Quick howto for anyone using KDE with a keyboard X has a valid layout for:

1)Find correct keyboard layout (if you don't know it already). Start KDE Control Center, find the "Keyboard Layout" tool (under Regional & Accessibility on my Mandriva install running in English). Click the "Layout" tab, ensure that the "Enable keyboard layouts" option is checked, then select the a candidate from the "Keyboard model" drop-down box, and click Apply. Select the "Keyboard shortcuts" tool, and start creating a new shortcut, just so you can test the keys (and what Symbols they are sending). If the layout doesn't work with all your keys, repeat ...

2)Once you have found the right keyboard layout, return to the "Keyboard Layout" tool, click on the keyboard listed under "Active layouts" to see the command that was used (in the "Command" field). Take the value after the -model flag, and then add a XkbModel option to xorg.conf. In my case, my InputDevice section for my keyboard looks like this:

 Section "InputDevice"
    Identifier "Keyboard1"
    Driver "kbd"
    Option "XkbModel" "inspiron"
    Option "XkbLayout" "us"
    Option "XkbOptions" "compose:rwin"
EndSection

Restart X when it is convenient.

If you use the same home directory on multiple machines, uncheck the "Enable keyboard layouts" option in KDE Control Center (so that you don't set the wrong keyboard layout after X has started).

Note that on Mandriva, the keyboard configuration tool (drakkeyboard) can also be used to set this up, and if your hardware has a specific keyboard type the OS installer knows about (e.g. Dell Inspiron laptops), this should have been setup by default.

3)Now, return to "Keyboard shortcuts", and you can set up any global or command shortcuts. Also, you can use your multimedia keys from any KDE application with keyboard shortcut support (e.g. amarok, kaffeine, kmplayer etc.)

If you don't find a suitable model in step (1), this means that X does not have the information for your keyboard, the best thing to do is to update the keyboard map, and provide a patch to X.org for your keyboard. This can't be covered here, but see (for example) /usr/share/X11/xkb/symbols/inet (or similar, may differ on other distributions). Updating this is not difficult (just takes some patience).

By:

Hello!

You are pretty much right, it is important to setup your hardware correctly and get it recognized by X. But as I metioned in the tuto xbindkeys does not depend on the windowmanager. So your comment is great for those who use KDE. But what about Gnome or Xfce?

Csarlee

By: Fmiser

Thank you!

Just what I wanted. A non-session-manager method to customize my buttons. I don't want the KDE, Gnome, or even XFCE control panel manager thing. I setup my own X session without them.

In responce to the other commenters saying "there is a better way - be a sheep and only want what the leaders tell you you want", I say "Fooey!" I like Linux because I _can_ (mostly) make things work _for_ my _my_ way - not have to adapt my use to whatever "the system" says is best. So I want the buttons for my own uses - not necessarily the same as what is silkscreened on the keyboard. For example, I use the button labeled "mail" to open an xterm. hotkeys is just right for me. Customizable and easy. And this tutorial explained it well enough it was very easy for me to get setup. I did use hotkeys man page for further details. *smiles*

Conclusion? You did good. Ignore those other comments!

--fm