Skip to main content

No project description provided

Project description

map2

Linux input remapping
Remap your keyboard, mouse, controller and more!

GitHub MIT License Discord Build Donate

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.


If you like open source, consider supporting

Buy Me a Coffee at ko-fi.com

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

map2-2.1.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

map2-2.1.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

map2-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

map2-2.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

map2-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

map2-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

map2-2.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

map2-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

map2-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

map2-2.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

map2-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

map2-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

map2-2.1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

map2-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

map2-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

map2-2.1.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

map2-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

map2-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

map2-2.1.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (2.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

map2-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

File details

Details for the file map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4150b77d784e4c63042cd31453803ec012ccf2d5f3b33854e28f626fabc8fbf1
MD5 1ca64c4cdb1ea0cdda2e032237b76cb3
BLAKE2b-256 85b283b7e6a69d18f9d7822d335bd8f953d8a5bd0ee7be2ab1dfae30121cfcc9

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 0ac61391d052bc0a79a5d29308d2edfe0112723c1793122451ee65add9a8ef99
MD5 bcdeb4db20f9b8d74fde31706c161eec
BLAKE2b-256 6fb994d59f3d1e552ea66a008726825ba18404ca4644e423356853b652b4c679

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d4ebd32b0a474b7d471f3770fa3a8c65c7b14d26efaedf91356eb5720ff2e63
MD5 603e8200dba68dcd3af553054c8be69c
BLAKE2b-256 d36dcf296ed6b050946f1bda627e3eef7d07dd803075f71ab85ae71ef3943a88

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7398dfdd8eb05a4b24ca283196441491d63b5a43c091bb462bcbbbd2eb047842
MD5 67db13086ed21d09be695b1dc4374410
BLAKE2b-256 bcaf8d68b51187b1c30e23b41707f9ea9ba9c67b674b6674cf9b35eb49ed395e

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8c7f5c32124fb4d7c5ca88b660af47d56077a686e3e7744b7d2a5eeac6681d44
MD5 d78b5cb9680d797146b92a4aa492d124
BLAKE2b-256 d4d200f82344126f3837e8554ad58b5090ff95da8795bab4fd4488f10af8a8d8

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cc18eda70769955b2a11a4c37aa2765e8aa881cd8dd5167d3a7bcd871448bff0
MD5 92623759043b57ca2fbe4d8dbdef4a3a
BLAKE2b-256 99f8364a01a1defaa87580213eeeb0ee9ef351ddac783f1bf6494437c4e0c5bb

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2ae94a4795c97f322354991c02ae3cb5e249a397fd82184ef7f57b4d9fd192ba
MD5 515c06e5a3ea24fb8746acd343e696fe
BLAKE2b-256 27eaf4947aca59b2fe5ee048910048c404f4c4502d1636c0c81648d666e82d61

See more details on using hashes here.

File details

Details for the file map2-2.1.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1095b789f073c5666c3ce1bf0feefb8722e0df3d0cf77adfbc8b81d10e5654bc
MD5 533d58f8055b438a311880d1e4fb185b
BLAKE2b-256 54b64da7164f82d8fa90124a5b299c9bdbff9cbf80a1dd40e2024df19023a4f5

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5c2e677d2702cb7775dd02731ad2617eb332910165d167ca38ccc6dae13bacf
MD5 c1d11699952d3860c42e4487f2eb85c2
BLAKE2b-256 01c7646ec08fcfad42b4907f303da7fc263ccb703ea1cab0e675d9fc883578ce

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 193bfe922e5e3fe21814c66a5c66e35805f0681770d6cb5b2d9df0bed083b7fb
MD5 2a29b04dbb45434c93328e57c1925840
BLAKE2b-256 13da9e30e524316e9d00ba352acc27d6431a69ebb0bec16167a7699240857843

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9882246a5b5b66d2777c422e91502a0068bb4dcfd66fa6e40aad077ad5b7c4d4
MD5 811dcecb49ee88daab3352fd7717e0dd
BLAKE2b-256 86188ac011f71acd62b1658f7400626dffb9cada9f568fd468153087d0d326b1

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cf0686ace75bbf72c4424c081a5fc27e6adbf2ef08df2a7a585a6aaafefb36c
MD5 c00e1064a118b55b9626613406b621bd
BLAKE2b-256 808a0a4a3ebc25ba86f0dcc4b8a3217751e813e38a56964932330999b2386f12

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a96d7a8973a2e1eeaeab606fa903b44025df68f5db34fe4f3e3ee89783fecabe
MD5 499ed91ddbfd0d26388a1f2cb4316e73
BLAKE2b-256 873abd0624e9ee62d3a75561ea3825c05caab8e738561e8cea2e28dee449eec8

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2b1c315a1c554ca07bcd9405ea04cc74868f6103334bd28e63ccb75c4dafeb4c
MD5 43ec11a81417d27d7336ad1df777ef3e
BLAKE2b-256 42c5dd0bc0fd75bc64a86cc924eee1c235646a12fbfe36f3c9cc6566b23b5740

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0f14da1e6f463852def2c4940998b497b03d73db48aacbd3d80c7c45eacf0e7
MD5 72427afb0ed53c99765d761a0440b9cb
BLAKE2b-256 4a2adf7462e8e20ba2c8376332f3963ac428f1eb479dba296f451e140df13765

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a56121446172a5d10949bbc58f02a5214076ea72b057d5db3007064f5e4b27ba
MD5 b0592fbf80d617b18dd8dac286930312
BLAKE2b-256 af573d8628a89f90219add223d429e15a5733cccd7b3648975223b450b5dcbbb

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fb134c63aba3c98f8ac0d3f77b47f4dc78e9bfddd1afbced8c7a02971a359a51
MD5 52bd7e52d540d9a0e613922513b8a4cd
BLAKE2b-256 9ddf6b3a36146ea03aeabb9d90d8918f57c121579ebc690f097e81c27cbe5b02

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 297ea1ae2d7379793bdeb140e817b2430f968a0d17a44cbae28f1acc46b2a592
MD5 979222d8df082f582e205b92802e1b75
BLAKE2b-256 23a3d4374724883c8ea6e72b855de73e83fd1a7a6c6d578670e0092839580db8

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e95aa4971ad1a22207f2e53b5536675c7444448d0b26eebc2d4040f3751507c2
MD5 75c5891a6cfb0b4dde5505ccf3b51d6f
BLAKE2b-256 0fc0d3cda80e49e721ea9f49c0f9d898530854e80e31652d4d1f0cd6953d3249

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ad67393051e9716fa2b5a4ffed834536fef9313988955fe4a969308e129589d
MD5 5967ac55967139ab4515fa5e8d1a3446
BLAKE2b-256 624b87bf2f338ae31a89a15ffd1ce56df6eb6cbbd290a1341ca845dfca2ece51

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d269b71675b20fc3b05f4fa124caa0be0204e84658e9faa8be706bd7da11feee
MD5 4282eabd8ef573c0b95a71f3a45d1566
BLAKE2b-256 7217b55bf27baab3c075ca1bd6621f5d524f5eefb709c906f914ecdf676ace8c

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6c9636f4bdd4447e545ee54f625ee62d64286d0cef593672eaf18573bc2c31fb
MD5 2b88aac8d1de326a9b3e13d6468a4871
BLAKE2b-256 2908029b0a82d0ed08f6e6acfdd2474699d7e59d950f68fb138d729c4edefac8

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c666cdfe9b8af503029303bbc571da8aa5616aa3c3323962029264e6523f6a45
MD5 d04c4067f7c56ba27ffe67045e02d1f2
BLAKE2b-256 d57283b93743eb959e3afe639d58aeb106ad3cb07fa49a0694fe61e811da9056

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e4de34a31aac7916f5071634f1a8e1fe51e4a148c234ba499bfeda1712187db
MD5 5fee1c43e8ea5b9815e549289982b863
BLAKE2b-256 dff4ad6a55a95c7735da75d133f687836430babaf17065ec5b369a389def20a9

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e3bd340828ec577b1ae383439ee437e184fcb32d9b2c7ae496adf3c2c19efb68
MD5 7d206fb221d5b5fd213f6e7c30d3624a
BLAKE2b-256 8b1b670f40763d2ed9ac80ab14b08d0f8c5c80d329b6dd220cb625e343b5fe76

See more details on using hashes here.

File details

Details for the file map2-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for map2-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 60a3b21e7f1d707f8fdcae977dc8ff6e874b78556174acbad2673924b24f1437
MD5 5c83a6df8111ad81995d377ab7b93194
BLAKE2b-256 b63011f57cbd97750205e9d24143a9a0b7a766df99ac03fbf07f9a93d3691e73

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page