<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8">
<title>Extra Keyboard Keys in Xorg - ArchWiki</title>
<meta name="generator" content="MediaWiki 1.22.7">
<meta name="robots" content="noindex,follow">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="ArchWiki (en)">
<link rel="EditURI" type="application/rsd+xml" href="https://wiki.archlinux.org/api.php?action=rsd">
<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
<link rel="alternate" type="application/atom+xml" title="ArchWiki Atom feed" href="/index.php?title=Special:RecentChanges&amp;feed=atom">
<link rel="stylesheet" href="../ArchWikiOffline.css">
<meta name="ResourceLoaderDynamicStyles" content="">

</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-Extra_Keyboard_Keys_in_Xorg skin-archlinux action-view">

<div id="globalWrapper" style="width: 100%">
<div id="column-content"><div id="content" class="mw-body-primary" role="main" style="margin: 2em; margin-bottom: 0">
	<a id="top"></a>
	
	<h1 id="firstHeading" class="firstHeading" lang="en"><span dir="auto">Extra Keyboard Keys in Xorg</span></h1>
	<div id="bodyContent" class="mw-body">
		<div id="contentSub"></div>
		<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
<div style="float:right; clear:right; width:25%; margin: 0 0 0.5em 0.5em;">
<p style="background:#333; color:white; padding:0.2em; border-bottom:5px #08c solid; margin:0; text-align:center; font-weight:bold;">Related articles</p>
<ul style="list-style-type:none; margin:0; padding:0.3em;">
<li style="padding:0.4em 0; line-height:1;"><a href="../en/Extra_Keyboard_Keys.html" title="Extra Keyboard Keys">Extra Keyboard Keys</a></li>
<li style="padding:0.4em 0; line-height:1;"><a href="../en/Extra_Keyboard_Keys_in_Console.html" title="Extra Keyboard Keys in Console">Extra Keyboard Keys in Console</a></li>
<li style="padding:0.4em 0; line-height:1;"><a href="../en/Map_scancodes_to_keycodes.html" title="Map scancodes to keycodes">Map scancodes to keycodes</a></li>
<li style="padding:0.4em 0; line-height:1;"><a href="../en/Xorg.html" title="Xorg">Xorg</a></li>
<li style="padding:0.4em 0; line-height:1;"><a href="../en/Xmodmap.html" title="Xmodmap">Xmodmap</a></li>
</ul>
</div>
<div id="toc" class="toc">
<div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Mapping_keysyms_to_actions"><span class="tocnumber">1</span> <span class="toctext">Mapping keysyms to actions</span></a>
<ul>
<li class="toclevel-2 tocsection-2">
<a href="#Desktop_environments"><span class="tocnumber">1.1</span> <span class="toctext">Desktop environments</span></a>
<ul>
<li class="toclevel-3 tocsection-3"><a href="#Gnome"><span class="tocnumber">1.1.1</span> <span class="toctext">Gnome</span></a></li>
<li class="toclevel-3 tocsection-4"><a href="#KDE"><span class="tocnumber">1.1.2</span> <span class="toctext">KDE</span></a></li>
<li class="toclevel-3 tocsection-5"><a href="#Xfce4"><span class="tocnumber">1.1.3</span> <span class="toctext">Xfce4</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-6">
<a href="#Window_managers"><span class="tocnumber">1.2</span> <span class="toctext">Window managers</span></a>
<ul>
<li class="toclevel-3 tocsection-7"><a href="#Openbox"><span class="tocnumber">1.2.1</span> <span class="toctext">Openbox</span></a></li>
<li class="toclevel-3 tocsection-8"><a href="#PekWM"><span class="tocnumber">1.2.2</span> <span class="toctext">PekWM</span></a></li>
<li class="toclevel-3 tocsection-9"><a href="#Xmonad"><span class="tocnumber">1.2.3</span> <span class="toctext">Xmonad</span></a></li>
<li class="toclevel-3 tocsection-10"><a href="#i3"><span class="tocnumber">1.2.4</span> <span class="toctext">i3</span></a></li>
</ul>
</li>
<li class="toclevel-2 tocsection-11">
<a href="#Third-party_tools"><span class="tocnumber">1.3</span> <span class="toctext">Third-party tools</span></a>
<ul>
<li class="toclevel-3 tocsection-12"><a href="#sxhkd"><span class="tocnumber">1.3.1</span> <span class="toctext">sxhkd</span></a></li>
<li class="toclevel-3 tocsection-13"><a href="#keytouch"><span class="tocnumber">1.3.2</span> <span class="toctext">keytouch</span></a></li>
<li class="toclevel-3 tocsection-14"><a href="#actkbd"><span class="tocnumber">1.3.3</span> <span class="toctext">actkbd</span></a></li>
<li class="toclevel-3 tocsection-15"><a href="#xbindkeys"><span class="tocnumber">1.3.4</span> <span class="toctext">xbindkeys</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>

<h2><span class="mw-headline" id="Mapping_keysyms_to_actions">Mapping keysyms to actions</span></h2>
<div style="text-align: center; margin-bottom: 1em; overflow:hidden;">
<table class="notice noprint toc" id="merge" style="background: {{{backgroundcolor}}}; border-color: {{{bordercolor}}}; width: 100%">
<tr>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
<td>  <b>This article or section is a candidate for merging with <a href="../en/Keyboard_Shortcuts.html#X11_2" title="Keyboard Shortcuts">Keyboard Shortcuts#X11_2</a>.</b> <div style="font-size: 90%">
<b>Notes:</b> same topic (<a rel="nofollow" class="external text" href="https://wiki.archlinux.org/index.php/Talk:Extra_Keyboard_Keys_in_Xorg">Discuss</a>)</div>
</td>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
</tr>
</table>
</div>
<p>When we are in a graphical environment we may want to execute a command when certain key combination is pressed. There are multiple ways to do that:
</p>
<ul>
<li> The most portable way using low level tools, such as <a href="../en/Acpid.html" title="Acpid">acpid</a>. Not all keys are supported, but configuration in uniform way is possible for keyboard keys, power adapter connection and even headphone jack (un)plugging events.
</li>
<li> The universal way using <a href="../en/Xorg.html" title="Xorg">Xorg</a> utilities (e.g. <a href="../en/Xbindkeys.html" title="Xbindkeys">xbindkeys</a>) and eventually your desktop environment or window manager tools.
</li>
<li> The quicker way using a third-party program to do everything in GUI, such as the Gnome Control Center or <a href="../en/Keytouch.html" title="Keytouch">Keytouch</a>.
</li>
</ul>
<h3><span class="mw-headline" id="Desktop_environments">Desktop environments</span></h3>
<h4><span class="mw-headline" id="Gnome">Gnome</span></h4>
<div style="text-align: center; margin-bottom: 1em; overflow:hidden;">
<table class="notice noprint toc" id="disputed" style="background: {{{backgroundcolor}}}; border-color: {{{bordercolor}}}; width: 100%">
<tr>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-emblem-important.png" class="image"><img alt="Tango-emblem-important.png" src="../File:Tango-emblem-important.png" width="48" height="48"></a>
</td>
<td>  <b>The factual accuracy of this article or section is disputed.</b> <div style="font-size: 90%">
<b>Reason:</b> I am quite certain that <a href="../en/GNOME.html" title="GNOME">GNOME</a> does not override <a href="../en/Xorg.html" title="Xorg">Xorg</a> that much... (<a rel="nofollow" class="external text" href="https://wiki.archlinux.org/index.php/Talk:Extra_Keyboard_Keys_in_Xorg">Discuss</a>)</div>
</td>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-emblem-important.png" class="image"><img alt="Tango-emblem-important.png" src="../File:Tango-emblem-important.png" width="48" height="48"></a>
</td>
</tr>
</table>
</div>
<p>Gnome Control Center is quite complete for the extra keyboard keys management. In fact it can directly detect scancodes which means that it can map any key seen by the kernel.
</p>
<h4><span class="mw-headline" id="KDE">KDE</span></h4>
<div style="text-align: center; margin-bottom: 1em; overflow:hidden;">
<table class="notice noprint toc" id="merge" style="background: {{{backgroundcolor}}}; border-color: {{{bordercolor}}}; width: 100%">
<tr>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
<td>  <b>This article or section is a candidate for merging with <a href="../en/KDE.html" title="KDE">KDE</a>.</b> <div style="font-size: 90%">
<b>Notes:</b> <a href="../en/KDE.html" title="KDE">KDE</a> currently does not provide any information about mapping actions; provide only link after the merge. (<a rel="nofollow" class="external text" href="https://wiki.archlinux.org/index.php/Talk:Extra_Keyboard_Keys_in_Xorg">Discuss</a>)</div>
</td>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
</tr>
</table>
</div>
<p>Keyboard shortcuts can be configured in <b>System Settings</b> -&gt; <b>Shortcuts and Gestures</b>.
</p>
<h4><span class="mw-headline" id="Xfce4">Xfce4</span></h4>
<p>See <a href="../en/Xfce.html#Manage_Keyboard_Shortcuts" title="Xfce">Xfce#Manage Keyboard Shortcuts</a>
</p>
<h3><span class="mw-headline" id="Window_managers">Window managers</span></h3>
<h4><span class="mw-headline" id="Openbox">Openbox</span></h4>
<p>See <a href="../en/Openbox.html#Keybinds" title="Openbox">Openbox#Keybinds</a>
</p>
<h4><span class="mw-headline" id="PekWM">PekWM</span></h4>
<p>See <a href="../en/PekWM.html#Hotkeys" title="PekWM">PekWM#Hotkeys</a>
</p>
<h4><span class="mw-headline" id="Xmonad">Xmonad</span></h4>
<div style="text-align: center; margin-bottom: 1em; overflow:hidden;">
<table class="notice noprint toc" id="merge" style="background: {{{backgroundcolor}}}; border-color: {{{bordercolor}}}; width: 100%">
<tr>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
<td>  <b>This article or section is a candidate for merging with <a href="../en/Xmonad.html" title="Xmonad">Xmonad</a>.</b> <div style="font-size: 90%">
<b>Notes:</b> Provide only link after the merge. (<a rel="nofollow" class="external text" href="https://wiki.archlinux.org/index.php/Talk:Extra_Keyboard_Keys_in_Xorg">Discuss</a>)</div>
</td>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
</tr>
</table>
</div>
<p>If you use Xmonad as a stand alone window manager, you can edit the xmonad.hs to add unbound keyboard keys. You just need to find the Xf86 name of the key (such as XF86PowerDown) and look it up in <code style="display:inline-block; padding: 0.1em 0.3em;">/usr/include/X11/XF86keysym.h</code>. It will give you a keycode (like 0x1008FF2A) which you can use to add a line like the following in the keybindings section of your <code style="display:inline-block; padding: 0.1em 0.3em;">xmonad.hs</code>:
</p>
<pre>((0,               0x1008FF2A), spawn "sudo pm-suspend")
</pre>
<h4><span class="mw-headline" id="i3">i3</span></h4>
<div style="text-align: center; margin-bottom: 1em; overflow:hidden;">
<table class="notice noprint toc" id="merge" style="background: {{{backgroundcolor}}}; border-color: {{{bordercolor}}}; width: 100%">
<tr>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
<td>  <b>This article or section is a candidate for merging with <a href="../en/I3.html" title="I3">i3</a>.</b> <div style="font-size: 90%">
<b>Notes:</b> Provide only link after the merge. (<a rel="nofollow" class="external text" href="https://wiki.archlinux.org/index.php/Talk:Extra_Keyboard_Keys_in_Xorg">Discuss</a>)</div>
</td>
<td style="background-color: {{{signalcolor}}}; width: 100px"> <a href="../File:Tango-two-arrows.png" class="image"><img alt="Tango-two-arrows.png" src="../File:Tango-two-arrows.png" width="75" height="48"></a>
</td>
</tr>
</table>
</div>
<p>Open your ~/.i3/config and just bind the keysym to a command:
</p>
<pre>bindsym XF86AudioLowerVolume exec amixer -q set Master 5-
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5+
bindsym XF86AudioMute exec $(amixer get Master | grep off &gt; /dev/null &amp;&amp; amixer -q set Master unmute) || amixer -q set Master mute
bindsym XF86MonBrightnessDown  exec  xbacklight -dec 10
bindsym Print                  exec  scrot
</pre>
<h3><span class="mw-headline" id="Third-party_tools">Third-party tools</span></h3>
<h4><span class="mw-headline" id="sxhkd">sxhkd</span></h4>
<p>A simple X hotkey daemon with a powerful and compact configuration syntax.
</p>
<p>Available as <span style="font-family: monospace"><a rel="nofollow" class="external text" href="https://aur.archlinux.org/packages/sxhkd-git/">sxhkd-git</a></span> and <span style="font-family: monospace"><a rel="nofollow" class="external text" href="https://aur.archlinux.org/packages/sxhkd/">sxhkd</a></span> in <a href="../en/Arch_User_Repository.html" title="AUR" class="mw-redirect">AUR</a>.
</p>
<h4><span class="mw-headline" id="keytouch">keytouch</span></h4>
<p>KeyTouch is a program which allows you to easily configure the extra function keys of your keyboard. This means that you can define, for every individual function key, what to do if it is pressed.
</p>
<p>See the main article: <a href="../en/Keytouch.html" title="Keytouch">keytouch</a>.
</p>
<h4><span class="mw-headline" id="actkbd">actkbd</span></h4>
<p>From <a rel="nofollow" class="external text" href="http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/">actkbd home page</a>:
</p>
<dl>
<dd>
<span style="font-family: monospace"><a rel="nofollow" class="external text" href="https://aur.archlinux.org/packages/actkbd/">actkbd</a></span> (available in <a href="../en/Arch_User_Repository.html" title="AUR" class="mw-redirect">AUR</a>) is a simple daemon that binds actions to keyboard events. It recognises key combinations and can handle press, repeat and release events. Currently it only supports the linux-2.6 evdev interface. It uses a plain-text configuration file which contains all the bindings.
</dd>
</dl>
<p>A sample configuration and guide is available <a rel="nofollow" class="external text" href="http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/latest/README">here</a>.
</p>
<h4><span class="mw-headline" id="xbindkeys">xbindkeys</span></h4>
<p><a href="../en/Xbindkeys.html" title="Xbindkeys">xbindkeys</a> allows advanced mapping of keysyms to actions independently of the Desktop Environment.
</p>
</div>
<div id="catlinks" class="catlinks"><div id="mw-normal-catlinks" class="mw-normal-catlinks">
<a href="../Special:Categories.html" title="Special:Categories">Categories</a>: <ul>
<li><a href="../en/Category:Keyboards.html" title="Category:Keyboards">Keyboards</a></li>
<li><a href="../en/Category:X_Server.html" title="Category:X Server">X Server</a></li>
</ul>
</div></div>		<div class="visualClear"></div>
	</div>
</div></div>
<div class="visualClear"></div>
<div id="footer" role="contentinfo">
	<ul id="f-list" style="margin: 0 2em">
		<li>
Retrieved from "<a href="https://wiki.archlinux.org/index.php?title=Extra_Keyboard_Keys_in_Xorg&amp;oldid=305964">https://wiki.archlinux.org/index.php?title=Extra_Keyboard_Keys_in_Xorg&amp;oldid=305964</a>"</li>
		<li id="lastmod"> This page was last modified on 20 March 2014, at 17:31.</li>
		<li id="copyright">Content is available under <a class="external" rel="nofollow" href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License 1.3 or later</a> unless otherwise noted.</li>
		<br><li id="privacy"><a href="../en/ArchWiki:General_disclaimer.html" title="ArchWiki:Privacy policy">Privacy policy</a></li>
		<li id="about"><a href="../en/ArchWiki:About.html" title="ArchWiki:About">About ArchWiki</a></li>
		<li id="disclaimer"><a href="../en/ArchWiki:General_disclaimer.html" title="ArchWiki:General disclaimer">Disclaimers</a></li>
	</ul>
</div>
</div>
</body>
</html>
