<title>Remap keyboard keys using evremap | Aiquiral's Blog</title>
<metaname="description"content="Sometimes a key on your keyboard stops working, and you may not have the time or motivation to fix it or get it fixed. Or maybe you just want to change how your keyboard keys work to improve your workflow. All this, and more, can be done with the help of evremap.">
<h1class="post-heading">Remap keyboard keys using evremap</h1>
<pclass="post-date">21 May 2023 | Linux Guide</p>
<imgsrc="/assets/posts/2023-05-21-remap-keyboard-keys-using-evremap/evremap.avif"class="featured"alt="A close-up view of a purple backlit keyboard with a transparent text overlay reading “evremap”."title="Remap keyboard keys using evremap"/>
<h2id="content">Content</h2>
<olstart="0">
<li><ahref="#introduction">Introduction</a></li>
<li>
<p><ahref="#building-and-installing">Building and Installing</a></p>
<p>Sometimes a key on your keyboard stops working, and you may not have the time or motivation to fix it or get it fixed. Or maybe you just want to change how your keyboard keys work to improve your workflow. All this, and more, can be done with the help of <codeclass="language-plaintext highlighter-rouge">evremap</code> (<ahref="https://github.com/wez/evremap">github.com/wez/evremap</a>).</p>
<p>It is a tool that can remap the keyboard inputs for Linux systems, made by <ahref="https://github.com/wez/">Wez</a>. And because <codeclass="language-plaintext highlighter-rouge">evremap</code> targets the <codeclass="language-plaintext highlighter-rouge">evdev</code> layer of <codeclass="language-plaintext highlighter-rouge">libinput</code>, the remapping is effective system-wide – in Wayland, X11 and the Linux console.</p>
<h2id="building-and-installing">Building and Installing</h2>
<h3id="prerequisites">Prerequisites</h3>
<p>Debian and its derivatives like Ubuntu require some prerequisites before we can build it. Use this command to install them:</p>
<p>If everything went fine, the last lines of your terminal output should be something like the ones in the image below.</p>
<p><imgsrc="/assets/posts/2023-05-21-remap-keyboard-keys-using-evremap/evremap_build-finish.avif"alt="A screenshot of the terminal after evremap finished building."title="evremap_build-finish"class="inline-img"/></p>
<h3id="installing">Installing</h3>
<p>Copy the binary file to the specified location using this command:</p>
<p>We will edit this file in the Usage section, below.To make your configured remapping active immediately after the system startup we need to create a <codeclass="language-plaintext highlighter-rouge">systemd</code> service. Use the following commands to do so:</p>
hold = ["KEY_THAT_WILL_BE_PRESSED_WHEN_INPUT_KEY_IS_HELD"]
tap = ["KEY_THAT_WILL_BE_PRESSED_WHEN_INPUT_KEY_IS_TAPPED"]
</code></pre></div></div>
<p>Here is the configuration file that I use for my laptop, as my Tab and Number 2 keys do not work.</p>
<divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>device_name = "AT Translated Set 2 keyboard"
[[remap]]
input = ["KEY_END"] output = ["KEY_2"]
[[remap]]
input = ["KEY_HOME"]
output = ["KEY_TAB"]
</code></pre></div></div>
<p>You can save the file by hitting CTRL + X, then Y and then Enter.</p>
<p>Now, you can log out and log back in and test your new configuration. If everything went perfectly, your remapped keys should work as expected.</p>
<p>Please visit the <ahref="https://github.com/wez/evremap">official repository on GitHub</a> if you have any questions or need a detailed documentation.</p>
<h2id="other-options">Other Options</h2>
<p>There is a tool called <codeclass="language-plaintext highlighter-rouge">xmodmap</code>, but it works only on X11.</p>
<h3style="color: #25252d;">How to Bypass CGNAT - Exposing your home server to the internet with TLS/SSL pass through</h3>
<p>07 October 2023 | Linux Guide, Privacy, Self-hosting</p>
<p>You've set up a home server, and are hosting some services like Vaultwarden, or Jellyfin, or perhaps Nextcloud. But now, you want to share it...</p>
<h3style="color: #25252d;">Proton VPN Linux Guide – How to install, configure, use and auto-connect?</h3>
<p>19 May 2023 | Linux Guide, Privacy</p>
<p>The official Proton VPN Linux client lacks a lot of features, like changing the connection protocol, quickly connecting to the fastest server of a specific...</p>