Skip to main content

InpMap

CI

InpMap is an input remapper for Linux. It takes over your physical keyboard or gamepad and turns its keys and buttons into whatever you describe in a small configuration file: other keys, gamepad buttons, stick movements, or whole timed sequences ("macros"). One key can act on several virtual devices at once, for example press a keyboard key and a gamepad button together.

version 1
input kbd { path = "/dev/input/by-id/usb-4348_2.4G_Dongle-event-kbd" }
output keyboard { type = keyboard }
output gamepad { type = gamepad }

map KEY_X {  # X = keyboard Y + gamepad A
    hold KEY_Y
    hold BTN_SOUTH
}

map KEY_F10 {  # tap, double tap, long press
    on tap { tap KEY_1 }
    on double_tap { tap KEY_2 }
    on long_press { tap KEY_3 }
}

map KEY_CAPSLOCK {  # Caps Lock alone = Esc, with another key = Ctrl
    if single { tap KEY_ESC } else { hold KEY_LEFTCTRL }
}

Why InpMap?

Input Remapper is the established remapper for Linux and served as the functional reference. InpMap was started for needs it covers less well:

  • Several virtual output devices per mapping. A key can drive a virtual keyboard and a virtual gamepad (or two gamepads) at the same time — e.g. for games that expect a gamepad.
  • Configuration as a readable text file instead of a GUI: easy to write in any editor, to compare, to keep in git and to copy to other PCs. Errors are reported with file, line and column before any device is touched.
  • Predictable behaviour: exact rules for modifiers (Shift+A stays a capital A unless you map it), reference-counted outputs, and a guarantee that no key is ever left stuck — on release, on errors, on unplugging and on shutdown.
  • A portable core. The mapping engine is independent of Linux; a Windows version is planned.

Features

  • Keyboard keys and gamepad buttons as triggers, optionally with modifiers (modifiers(ctrl, shift)), from any number of physical devices. A mapping applies to every configured device that has the key, or to one device only (pad.BTN_EAST). Keys can be disabled.
  • Sticks, analog triggers and the D-pad as buttons (map pad.ABS_RZ above 0.5), also two-stage triggers; inpmap axes shows their live values.
  • Virtual keyboards and gamepads (buttons, D-pad, sticks, triggers).
  • Hold, tap, chords (ctrl + KEY_C), sequences with waits and random waits, loops, autofire, toggles, parallel branches, stick movements with ramps.
  • Conditions: tap vs. hold, double tap, long press, "pressed alone", Caps/Num/Scroll Lock state, variables.
  • Layers: groups of mappings switched on while a key is held or toggled, e.g. Caps Lock + WASD as arrow keys, or a flight-sim layer on the gamepad.
  • Reusable blocks: write a sequence once (block close_dialog { … }) and call it from several mappings.
  • Unmapped keys pass through unchanged; LEDs keep working; devices that are unplugged and plugged in again are picked up automatically.
  • inpmap input-config finds your devices for you: press a key on the keyboard or gamepad you want, and it is added to the configuration.
  • inpmap fmt lays out configuration files consistently, without ever changing what they mean.
  • inpmap macro-trace shows the exact timeline of a mapping without touching any device.
  • Runs in the foreground or as a systemd user service that starts at login. Profiles (e.g. one per game) are switched with systemctl --user. Holding Backspace + Escape + Enter always stops it (emergency stop).

Not yet: mouse output, a GUI, Windows, a system-wide service.

Documentation

Document Contents
docs/installation.md requirements, installation, device permissions, user service, uninstall
docs/usage.md first configuration step by step, all commands and options, troubleshooting
docs/configuration.md reference of the configuration language: every feature with examples
docs/development.md for contributors: tests, architecture, releases
docs/roadmap.md goals, requirements, milestones and what comes next
CHANGELOG.md changes per version

Quick start

sudo pacman -S --needed python python-evdev python-pipx   # Arch; other distributions: see installation.md
pipx install --system-site-packages inpmap

inpmap input-config example          # the example with your keyboard (press i, then a key)
inpmap run example --timeout 60      # try F1-F8, Caps Lock, Insert
inpmap input-config                  # your own profile: ~/.config/inpmap/default.inpmap
inpmap detect                        # press keys: see how to write them in a mapping

Device permissions may be needed first: see installation.md §3. To work on InpMap itself, install it from the source code (installation.md §2b).

Status

Version 0.2, Linux only. Verified on CachyOS / KDE Plasma (Wayland) with a real keyboard and gamepad: remapping, suppression of the original keys, passthrough, macros, modifiers, axes as triggers, the configuration language and the user service. Later: Windows, then GUIs.

License

MIT, see LICENSE. Input Remapper (GPL-3.0) served as a functional reference only; InpMap contains no code from it.

Metadata

Release files for inpmap 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inpmap 0.2.0
File Size Uploaded Provenance Actions
inpmap-0.2.0.tar.gz 194.7 kB With provenance Details for inpmap-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inpmap 0.2.0
File Interpreter ABI Platform Actions
inpmap-0.2.0-py3-none-any.whl Python 3 none any Details for inpmap-0.2.0-py3-none-any.whl

Total release size: 312.2 kB

Release files / inpmap-0.2.0.tar.gz

Download URL inpmap-0.2.0.tar.gz
Size 194.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e3b070d2fb33259458276fb993b5f33ee42c1d05c571aff4fedc94c6e6fb0968
BLAKE2b-256 checksum
How to use checksums
73c44c2e38edfeda87215521090f0dfb7cb5b6749e9c1d3f1f2fd5172e0ae9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / inpmap-0.2.0-py3-none-any.whl

Download URL inpmap-0.2.0-py3-none-any.whl
Size 117.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
097d35ff6ccf7ede1049dc3b6b1fc40112c2a58aceb934dcfd08dcc5342658ec
BLAKE2b-256 checksum
How to use checksums
74123a9a084b1020743033277495594752af99ae4fca1d6ae44b68b49628f17b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for inpmap 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for inpmap-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page