Translation(s): English - Italiano - Português (Brasil) - Русский

(!) ?Discussion


Today, a lot of keyboards have additional keys. Here, we show how to use them. This article is based on part of the very good Léa Linux How-To.

Desktop Usage

Under KDE

Global shortcuts

By default, KDE has bindings for every common multimedia key to have them work as expected. These are exposed to the users and can be further changed and configured from your settings in a such a way that they'll persist after reboot without the need to touch a terminal. It's a very powerful and very simple feature!

Example:

example-kde5-shortcuts.png

Custom Shortcuts

You can also simply configure your multimedia keys to do a wide array of different actions by first disabling the default global shortcuts that the keys are bound to (as explained above), and then instead binding them to custom shortcuts.

These can be set to trigger regular commands, D-Bus commands, or to automatically type some specified keyboard input.

Under Gnome

Not tested

Command-line

Identifying keys

Try and note down all multimedia keys.

Alternatively

(Source http://linux.die.net/Mobile-Guide/mobile-guide-p2c1s8-ext-keys.html)

Key naming

Here, we're going to use xmodmap to modify keymaps and insert our multimedia keys.

keycode YOUR_KEYCODE = YOUR_NAME

Choose a name in /usr/share/X11/XKeysymDB.

keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 162 = XF86AudioPlay
keycode 144 = XF86AudioPrev
keycode 145 = XF86AudioNext
keycode 164 = XF86AudioStop
keycode 237 = XF86HomePage

xmodmap ~/.xmodmaprc

Autostart for every WM

To load your changes at startup, add this to your ~/.xsessionrc :

xmodmap ~/.xmodmaprc


CategoryKeyboard | CategoryHardware