No project description provided
Project description
Want to remap your input devices like keyboards, mice, controllers and more?
There's nothing you can't remap with map2!
- 🖱️ Remap keys, mouse events, controllers, pedals, and more!
- 🔧 Highly configurable, using Python
- 🚀 Blazingly fast, written in Rust
- 📦 Tiny install size (around 5Mb), almost no dependencies
- ❤️ Open source, made with love
Visit our official documentation for the full feature list and API.
Install
The easiest way is to use pip
:
pip install map2
For more, check out the Install documentation.
After installing, please read the Getting started documentation.
Example
import map2
# readers intercept all keyboard inputs and forward them
reader = map2.Reader(patterns=["/dev/input/by-id/my-keyboard"])
# mappers change inputs, you can also chain multiple mappers!
mapper = map2.Mapper()
# writers create new virtual devices we can write into
writer = map2.Writer(clone_from = "/dev/input/by-id/my-keyboard")
# finally, link nodes to control the event flow
map2.link([reader, mapper, writer])
# map the "a" key to "B"
mapper.map("a", "B")
# map "CTRL + ALT + u" to "META + SHIFT + w"
mapper.map("^!u", "#+w")
# key sequences are also supported
mapper.map("s", "hello world!")
# use the full power of Python using functions
def custom_function(key, state):
print("called custom function")
# custom conditions and complex sequences
if key == "d":
return "{ctrl down}a{ctrl up}"
return True
mapper.map("d", custom_function)
Build from source
To build from source, make sure python and rust are installed.
# create a python virtual environment
python -m venv .env
source .env/bin/activate
# build the library
maturin develop
While the virtual environment is activated, all scripts ran from this terminal will use the newly built version of map2.
Contributing
If you want to report bugs, add suggestions or help out with development please check the Discord channel and the issues page and open an issue if it doesn't exist yet.
License
MIT
Authors
- shiro shiro@usagi.io
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for map2-2.0.7-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ccd579ad2a7a062c4de9e4d86d46ed38645081862d5c5285105cf723ef93d34 |
|
MD5 | 153a4a1ccb633a4fd8ff0cef45e855a0 |
|
BLAKE2b-256 | 808d1b8939175bcb8ca4ad85b92affea19b3997b13672455726dd25242000749 |
Hashes for map2-2.0.7-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37463fc91cea4ad31a4f351f0fb52537773cff0e3692fd528888e716a3beacd8 |
|
MD5 | 79b0fae884f6997dc57309f1b99a24b0 |
|
BLAKE2b-256 | c596ca4dc0905d889d9e668c7b8a068f8ee4f4956d98ff3cab4452dfdba532ee |
Hashes for map2-2.0.7-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd08f070c86baf1ee7314738fb12558d94b646452963fb2946cdabe4c8861d6c |
|
MD5 | ade4f12e8052ffea54771f3e60eb3908 |
|
BLAKE2b-256 | fb199690d9a2ef3d7987d593d9407762a3b6e0bdf07aa76655cbfa82032f09da |
Hashes for map2-2.0.7-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6faab4fd7450b51c0897467c4dabbbaf64eaf1d3dffc19f9da951c21e275b11 |
|
MD5 | 1ff41b79af7d6b5d08b896d4c92f1b30 |
|
BLAKE2b-256 | f93ca2046b05be717502d8ecf88bb5ad05488752fb3ca7ee7fa9fd0ec5584fd3 |
Hashes for map2-2.0.7-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d776410270acd0b624a43eac524d688ec3ea3d14f3520eca0afcf61ab7827c |
|
MD5 | d04008f4f2f51046bb21d58b11f219df |
|
BLAKE2b-256 | 2bbb6de4e425d23280a2226c939aead983ff667222ce29adf8933de307eadc62 |
Hashes for map2-2.0.7-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28389d8eee5c98f5838bb681c4a0402290ad9948a51bc8886236cbfaa413e162 |
|
MD5 | 6345e756e7691650efad42b2454d8ad8 |
|
BLAKE2b-256 | bde3d9809507aa91c98e375f8d346055659e4ac612ac7c97f557f7ce8180c519 |
Hashes for map2-2.0.7-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b001b2951767c4ca520e05e6b2edcf7575c8865307157876cbbdf0af648d7bd1 |
|
MD5 | 6215f3d8f2c1838937ca6da955491b10 |
|
BLAKE2b-256 | a5cd3549a150b3a909fce9bb2b854941bb909a1beefa55ea1216909fa041c484 |
Hashes for map2-2.0.7-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a36955c765e7b1abd1483027949d870a2fa98b13583693caa5a2ffda3e61ca8c |
|
MD5 | 0165ff68d96897daf532744407510a39 |
|
BLAKE2b-256 | 520194059e89c3a49563e69544afc8c7720d8147298c421d7a7ebc600d9e971d |
Hashes for map2-2.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab818cccd945a3f269e0a237c174d6dc0fcb76672dc7bda6ebfe8235fa0b448 |
|
MD5 | d6dc139301005bd0998051e2d25b14c1 |
|
BLAKE2b-256 | 09634bb5db2a54349e226fe03f9b4537d3af2acc03ffba31f74b9fc1cb99f4d3 |
Hashes for map2-2.0.7-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b29b2f738ea8ba4ca19bae5ccd8b0384014f94ff5a30874cdfaa88a585b9323e |
|
MD5 | ae56307a8941ab3bd3c39cafadd59d8a |
|
BLAKE2b-256 | 29549374e6baadddd8825075b5f16e102ec3abfcaae77ac798a6846512eff0e6 |
Hashes for map2-2.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31ea0f89701deeda245869d433179477b39d04e98e93b18bd8c74c81eaa042ad |
|
MD5 | 57c818a0b2581ea2a84e28506c7a5399 |
|
BLAKE2b-256 | 6335fc1befb0cda124bb744b0b9c00c79ed87d7ffdfdcfd81e899ede807f70c7 |
Hashes for map2-2.0.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e7f7066afa5b13fe811407cecdef2bb3d2cb1d8b977a9e8edf9da47afd8d0e5 |
|
MD5 | e8994df04983ccbeef17c0f2910d6772 |
|
BLAKE2b-256 | f2bfdb0c3e66458632dd05bcf73fefc2b963102149ab005c62378d62139ca737 |
Hashes for map2-2.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1295ade09da85edd64369ce9a641fb72cdddc72a0a546c00851755fe753b41cc |
|
MD5 | 46f2b564467c877ad4e8c6aa8b94c27c |
|
BLAKE2b-256 | 62d9ae226aad7c8c2ccbb4b4f5bf1fca846c1fa3f06bba20f6a09fd94194a409 |
Hashes for map2-2.0.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f7fc821e2d5faaab498931501f1bb6a9acf87c2453deae440c6a4c197d37dc4 |
|
MD5 | 58fb3fbf30dc6db55c5f641f36be2db2 |
|
BLAKE2b-256 | ba1b4333618831632312ca8d9e52db39709cfca9869efdf088474211772097da |
Hashes for map2-2.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f43701c96e6384b02495154808eb371b37af5dc4e1efeb7a47e525bd679c925 |
|
MD5 | 72684ed0c1d3fd805ed413122ed19f0e |
|
BLAKE2b-256 | 9bc37e780bc1d25641cfe1ce331de6150e32638edc37078b193f43d839f7691e |
Hashes for map2-2.0.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f9cd4b77d906cd58525281f8001377308b77b04a50e017a4431f81b4eb3cd6 |
|
MD5 | 542c757be31d9063e093d728bf406438 |
|
BLAKE2b-256 | 79e2d9f32e445cb927227434f4172c1a66496ec43e328835f25428442e352aec |
Hashes for map2-2.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91ac6479f6002a6137b3e03171691fc8cecf394b62d7ef5dcb11ec06894d2a25 |
|
MD5 | 5ceee9fe7941e8d39f582cfa1b1acfd0 |
|
BLAKE2b-256 | 33c58a949480f6ab4181f50d97e263f7471abf2678be07db5a87fd3d8a37ac71 |
Hashes for map2-2.0.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa581d0159304773fc4c9d95cd522d8c6e5db17d76398ee49ae1d456a5bbb78c |
|
MD5 | 624d83997aa2fc82a60648974c6bdb68 |
|
BLAKE2b-256 | f2013a608b7efc0bada20bef1d03e158aac6626861739a9646719e933fff6e83 |
Hashes for map2-2.0.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d1ad1756a070d7c4ff725efe73fe518726c298dbddced8e501b0d736da263d |
|
MD5 | de21e027a74c5e6abeca2cfc8d95d95b |
|
BLAKE2b-256 | 4c2c7f32c1ae41ce6f589d3a7b1c7ff657bec79c47f598f94f6371e7c7c4cac9 |
Hashes for map2-2.0.7-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa524a3b7e1d0c52b76b7f300cb3300376278fffd33e522da18915818ccceb96 |
|
MD5 | 60dba2413f6d5d6efab6779935238c66 |
|
BLAKE2b-256 | b37c58a3583f2ca8bc9b83ba4c7ffc026324f98f45f0959308b9a7217f62a631 |