Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Want to remap your input devices like keyboards, mice, controllers and more?
There's nothing you can't remap with map2!
Visit our official documentation for the full feature list and API.
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.
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)
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.
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.
MIT
FAQs
Unknown package
We found that map2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.