Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

evremap

> 编程语言
Open source

A keyboard input remapper for Linux/Wayland systems, written by @wez

643 stars0 likes1 views
WebsiteGitHub

About

A keyboard input remapper for Linux/Wayland systems, written by @wez

evremap

A keyboard input remapper for Linux/Wayland systems, written by @wez

Why?

I couldn't find a good solution for the following:

  • Remap the CAPSLOCK key so that it produces CTRL when held, but ESC if tapped
  • Remap N keys to M keys. Eg: F3 -> CTRL+c, and ALT+LEFT to HOME

How?

evremap works by grabbing exclusive access to an input device and maintaining a model of the keys that are pressed. It then applies your remapping configuration to produce the effective set of pressed keys and emits appropriate changes to a virtual output device.

Because evremap targets the evdev layer of libinput, its remapping is effective system-wide: in Wayland, X11 and the linux console.

Configuration

Here's an example configuration that makes capslock useful:

…

You can also express simple remapping entries:

toml
# This config snippet is useful if your keyboard has an arrow
# cluster, but doesn't have page up, page down, home or end
# keys.  Here we're configuring ALT+arrow to map to those functions.
[[remap]]
input = ["KEY_LEFTALT", "KEY_UP"]
output = ["KEY_PAGEUP"]

[[remap]]
input = ["KEY_LEFTALT", "KEY_DOWN"]
output = ["KEY_PAGEDOWN"]

[[remap]]
input = ["KEY_LEFTALT", "KEY_LEFT"]
output = ["KEY_HOME"]

[[remap]]
input = ["KEY_LEFTALT", "KEY_RIGHT"]
output = ["KEY_END"]

When applying remapping configuration, ordering is important:

  • Dual Role entries are always processed first
  • Remap entries are applied in the order that they appear in your configuration file

Here's an example where ordering is important: on the PixelBook Go keyboard, the function key row has alternate functions on the keycaps. It is natural to want the mute button to mute by default, but to emit the F8 key when holding alt. We can express that with the following configuration:

toml
[[remap]]
input = ["KEY_LEFTALT", "KEY_F8"]
# When our `input` is matched, our list of `output` is prevented from
# matching as the `input` of subsequent rules.
output = ["KEY_F8"]

[[remap]]
input = ["KEY_F8"]
output = ["KEY_MUTE"]
  • How do I list available input devices? sudo evremap list-devices

  • How do I list available key codes? evremap list-keys

  • Is there a GUI for editing the config file? Yes, take a look at Evremap-GUI

Building it

bash
$ sudo dnf install libevdev-devel # redhat/centos
## or
$ sudo apt install libevdev-dev pkg-config # debian/ubuntu

$ cargo build --release

Running it

To run the remapper, invoke it as root (so that it can grab exclusive access to the input device):

bash
$ sudo target/release/evremap remap my-config-file.toml

Or, grant an unprivileged user access to evdev and uinput. On Ubuntu, this can be configured by running the following commands and rebooting:

bash
sudo gpasswd -a YOUR_USER input
echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules

For some platforms, you might need to create an input group first and run:

echo 'KERNEL=="event*", NAME="input/%k", MODE="660", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules

as well.

Systemd

A sample system service unit is included in the repo. You'll want to adjust the paths to match your system and then install and enable it:

bash
$ sudo cp evremap.service /usr/lib/systemd/system/
$ sudo systemctl daemon-reload
$ sudo systemctl enable evremap.service
$ sudo systemctl start evremap.service

Runit

If you're using Runit instead of Systemd, follow these steps to create a service.

  • Create a directory called evremap and create a file called run under it
bash
sudo mkdir /etc/sv/evremap
sudo touch /etc/sv/evremap/run
  • Copy these lines into the run file
bash
#!/bin/sh
set -e 
exec  remap 

Replace with the path to your evremap executable and with the path to your configuration file.

  • Finally, symlink the evremap directory to /var/service
bash
sudo ln -s /etc/sv/evremap /var/service

OpenRC

To make an OpenRC service, create the file /etc/init.d/evremap with the following contents...

bash
#!/usr/bin/openrc-run

supervisor=supervise-daemon
command=""
command_args="remap "

Replace with the path to your evremap executable and with the path to your configuration file.

Make the file executable...

bash
chmod +x /etc/init.d/evremap

Enable the service with...

bash
rc-update add evremap

Start the service with...

bash
rc-service evremap start

How do I make this execute a command when a key is pressed?

That feature is not implemented.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言