Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/map2Public

Linux input remapping for your keyboard, mouse and more!

License

NotificationsYou must be signed in to change notification settings

shiro/map2

Repository files navigation

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

GitHubMIT LicenseDiscordBuildDonate

Want to remap your input devices like keyboards, mice, controllers and more?
There's nothing you can't remap withmap2!

  • 🖱️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 ourofficial documentationfor 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 usepip:

pip install map2

For more, check out theInstall documentation.

After installing, please read theGetting started documentation.

Example

importmap2# readers intercept all keyboard inputs and forward themreader=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 intowriter=map2.Writer(clone_from="/dev/input/by-id/my-keyboard")# finally, link nodes to control the event flowmap2.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 supportedmapper.map("s","hello world!")# use the full power of Python using functionsdefcustom_function(key,state):print("called custom function")# custom conditions and complex sequencesifkey=="d":return"{ctrl down}a{ctrl up}"returnTruemapper.map("d",custom_function)

Build from source

To build from source, make sure python and rust are installed.

# create a python virtual environmentpython -m venv .envsource .env/bin/activate# build the librarymaturin develop

While the virtual environment is activated, all scripts ran from this terminalwill use the newly built version of map2.

Contributing

If you want to report bugs, add suggestions or help out with development pleasecheck theDiscord channel and theissues page and open an issueif it doesn't exist yet.

License

MIT

Authors

About

Linux input remapping for your keyboard, mouse and more!

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Languages


    [8]ページ先頭

    ©2009-2026 Movatter.jp