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.18-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac721eb38bef5352ec7d2eaaeef4dc170f63cb3a1319e6ba13263319290f67a |
|
MD5 | e9fd124a7590ad9682972b2266537169 |
|
BLAKE2b-256 | 4b4a164c0c8bca3bc31d6b0dae9f56416ceb7b6fdc7fd28752372c7773a0801c |
Hashes for map2-2.0.18-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a3e3d0eb85a4628634b183becdd1ef8e622ad29582522b06677ce1cc86606d |
|
MD5 | 872f95131e0fa23cc5d387b8c741902e |
|
BLAKE2b-256 | 0c025b7e505905ef1bfa26cbfad9d931cffbe6b8ce49c5e605b1b334a93bbd22 |
Hashes for map2-2.0.18-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11e5b7c8f68f28da3638c87304ded0af226f514ced3a181163527001fe78ae55 |
|
MD5 | 3877b71baec91457b5abab83ec387cb5 |
|
BLAKE2b-256 | 435cc26a797eb8edfbb799772af28a7ce9ddd46724fb6e0a194427dce54076cb |
Hashes for map2-2.0.18-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b91e83425bcf4376d52c5afef8f69ddf9ed1459ad57f04a00a087f71715e92f |
|
MD5 | 5ed1f4e0499b332dd2992eb77c945af9 |
|
BLAKE2b-256 | 5953b8f83268e918b5ce071dc84997a91856f46a6e367c2c6e91953713858bb7 |
Hashes for map2-2.0.18-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24064ad38d7d0cf49ff50f06a1ec785dcaa17141f766525deeb6a7c2ba22acc6 |
|
MD5 | fd5edd78e36c9a93fa671cb24973e350 |
|
BLAKE2b-256 | d866731bcdbf1409d99762576b43803a729340c335c606ff5b14cecb1f19a8cb |
Hashes for map2-2.0.18-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36b15768e2b073d5bc5a00d4ee7c9b7077e0c563be2004900b153121b9785749 |
|
MD5 | e3085857bb3f31f6a475e11970c62168 |
|
BLAKE2b-256 | 9b242c9db2bf122fd7a1dad092f7e3ce183735a6ee3b53a557f2ede7da36be49 |
Hashes for map2-2.0.18-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a83022260cbc9d8f733d958a8461d36f35dbaf97f75972e252a1e98446f2edf |
|
MD5 | c70f4cc3ec7bd0d4a7677892558733b1 |
|
BLAKE2b-256 | d9dc717f05b1ff8c0fb9a414f5e17214046565551fc32544d924df893171926c |
Hashes for map2-2.0.18-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 246c02496aa970e0a878936078347437b459ca23c1e0bacdba5eb638f02c1609 |
|
MD5 | 99f0ee725c7ad79c983e910ed127f3d3 |
|
BLAKE2b-256 | 41c9d61c25fd83567b638bfe3e1458959f492a696769765da7f9ce5799abbc16 |
Hashes for map2-2.0.18-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f61024f63319d1f4ecb9e9fa127943f331cf6a3487f967115f2b84acff111b |
|
MD5 | 8dd42efde7162eda0ce67d581eab318d |
|
BLAKE2b-256 | fb9b3230c404b582aa2717ee74b1041d242561bbc23ac4100b1f645c882756ee |
Hashes for map2-2.0.18-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6a04d0cb5a1916c406eb4077ced45631565da3c89f333aa924d9e1c26217df |
|
MD5 | 6d2f2b8944cdd13de936fbf7c4e1feea |
|
BLAKE2b-256 | 2b1d9395a72fd7ce3c5ac086f5d030843b7f9c9d81c69ec94fd0bc71b4668dc1 |
Hashes for map2-2.0.18-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a6321ad4509ce08714d293161da96b0ede6507a55b36b06d28c31fdc50b48d |
|
MD5 | 4510adf65ed99e1259bc9f26561038f9 |
|
BLAKE2b-256 | 21bc715c433ce1dd3f5a1b341ebce09090ff823941153a97800e5dc2c7161823 |
Hashes for map2-2.0.18-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b67ce5401eb3c34df03af18db6d50116a84d38ef704e510521ed0359f88c048 |
|
MD5 | 8433e1cbee7b68026fc5f487f6421d6f |
|
BLAKE2b-256 | 7331536a4018f01b38e54fd283201327280a98771ada4fbf3e3ac5331898f734 |
Hashes for map2-2.0.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97446f86f91b0be9bc6e7604c9654b6f37030148fa9a8d3cd1d365cda5bdf64c |
|
MD5 | 1da0f5217792d10d18c6000ea3651c1c |
|
BLAKE2b-256 | 27f1dbcb58841f3ab69b77e0e6e9719f802d7b08c887f3f14e8a2b309bbdec9e |
Hashes for map2-2.0.18-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6aebedbb80b23bc9812c50105b0d5db93460e7eb22b9889d20acd244660ecf3 |
|
MD5 | 6498f333f722fa44fddada8223110442 |
|
BLAKE2b-256 | d1ca3d3b655db47fa53d80b2c58f801f48a0461bea81c75cab1334799c44bf46 |
Hashes for map2-2.0.18-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9252760919e6da70a6a564229ca194e7c484ce2cc798d96ad25a3c0cac49d346 |
|
MD5 | 8cae932421107755ad73a25f44b80d18 |
|
BLAKE2b-256 | cbc366e6dd2292ad71d9934e1ecf12c7d7505d356fc52f4f9f877a0da2563b3b |
Hashes for map2-2.0.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10aef9a233e7c64d36cb466a6cf6162ad2a86de9c13472d16641bbb63d949784 |
|
MD5 | 6b00b0957ad5b00a5e514cddfcbc05d7 |
|
BLAKE2b-256 | eed4458271b34ff707262c16958cd1c941315fa13642a6a5217af2e5f4c9ed35 |
Hashes for map2-2.0.18-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d972af8bf4cd61ff6ac206183315aff9ed91278fb1ad6b483c4152b57b2fea6 |
|
MD5 | b49afa0dce6b532c8b84869e75d934b0 |
|
BLAKE2b-256 | 525e92fad407879553939357f512707f6540a5bbc9e0b7e37b02d77dcb35e1ae |
Hashes for map2-2.0.18-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bce8a024fc7bc4c9946e05de241496715d07b49896c495a380768e3d3af7ca06 |
|
MD5 | 86af2201aa088d722f29f0132f3fa89e |
|
BLAKE2b-256 | d9cefc047e8e5202ca0849c0228048b63d3ea14884c35904893441d9e02059c2 |
Hashes for map2-2.0.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9bfded6409f62e5f518b7cbc8efc4bcaac65e478aed1122f7c891a0ba955a3 |
|
MD5 | 5c35a4a1d6b4c8e76d9466375f0fc95b |
|
BLAKE2b-256 | 0918489e0d1e6211d37a8edd129de81ebb918f202dd7c19a06a40db044e39dd5 |
Hashes for map2-2.0.18-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb6b3a539d2b6ad93417139dc925cb7e29dac6b2782015236341dee2a4bdd02 |
|
MD5 | 4336b151d6be2fba71fab0895135092c |
|
BLAKE2b-256 | 93f2d45dc72a49cd19083572f4545ec0b1ab5ab2651c8daa93493f22b713d8b7 |
Hashes for map2-2.0.18-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b18cdfedeef62e6273af49cbdfa480cb9591355a19674a728d74ee9ba8056ba2 |
|
MD5 | ad64454a326b45b43e8762542bc2e1b2 |
|
BLAKE2b-256 | 5de28a78fea79dc1457af824503dbec21fd1f9e9ec1fdfd14affde3c928b7876 |
Hashes for map2-2.0.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b65b1c88344a367fd65fd7edea65f5fd1d7f0a955951ebf75478e6423deb421c |
|
MD5 | 8554fa1c54478bafb24a01a672354810 |
|
BLAKE2b-256 | a0ec366e3a29f634a4ee2103313908fd6c44ee6c4f353419db09781b0d42ff51 |
Hashes for map2-2.0.18-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d09c8b2e51d31733c1cff8b4099187d5a06d3305ede80c72e2eeff759876915f |
|
MD5 | 5c2ff3bbda448128838f94aab561d2e6 |
|
BLAKE2b-256 | 61c57c2d069aa69694415ebf809d38437c88094bb45c4d4e8bfda5742343081c |
Hashes for map2-2.0.18-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5749d2a55b1f36ce410920530b2608cf6e533f50c63b865a9c844d782c1c4b3b |
|
MD5 | 074a99964ca18fc69baaaf40d6380643 |
|
BLAKE2b-256 | 592ae37893821847e4e58b198ba0ff48805677873c1eb34b19814d5238b56dee |
Hashes for map2-2.0.18-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd05bf7d602e463fc7f8e9f3824de941fe0e6a6e7deab038b8b76374b498906 |
|
MD5 | 9b28474a34964357fd01715f2bdb7490 |
|
BLAKE2b-256 | 76f708e3df92e5460eae5502f6757d79c2c58eb1b835df279b38bc691e5e7194 |
Hashes for map2-2.0.18-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d84cb3e0c0e4b8f56f3feeb1a11f6b4cd09f4fe0361ef8f21339c7ca4417158a |
|
MD5 | 6738a5d0a1262e5273464f414f10c85a |
|
BLAKE2b-256 | f15548fc504dfc59b85ac77a87bc6d673b5dcaa1d68c5c948855f44fc32ad71c |
Hashes for map2-2.0.18-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 488c7aa9b4787342790933c5c51530d26a29785f315d58e0b74d4a58858bf6fd |
|
MD5 | be70dbd30e175446c217a15d0864f364 |
|
BLAKE2b-256 | eefae69b030171423852a9715a9991ea85ce71f02eee41b3851a1f169bc90ef7 |
Hashes for map2-2.0.18-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 069ce669587d2d2988bc8d9a3a1e33c70646730cfc6f805f57f5ea86d4f44d49 |
|
MD5 | b9e515441fdb36670461bc6f418034cd |
|
BLAKE2b-256 | 875c3b281508561233dea7cdea9dcad2c79d3e367b321c7c17ae4f88d46eb5fe |
Hashes for map2-2.0.18-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dce20462f3e89f4fb52fc4d266285464c429200fb7e752c2d4e9c12c11a52fbb |
|
MD5 | 04bf06fa43d6b59b42f309256bc70d35 |
|
BLAKE2b-256 | f706f4b9d5af6be683f0ad0bc6019b2e0ec13bf4a1d8b90cae8c25ecb55bd220 |
Hashes for map2-2.0.18-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc704d597bd51de1753b4bed52ec25326074f8bebde044f074136d28689049ca |
|
MD5 | 96162f9001db8f0960ba869bd6fb4d2b |
|
BLAKE2b-256 | 18b4bc89b87af3e3cc4163edae027a3e1e6861a82f78971c249640e53848ee34 |