Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Multiplatform Python interface to the 3DConnexion Space Mouse - forked from pyspacenavigator
🎮 Multiplatform Python library for 3Dconnexion SpaceMouse devices using raw HID.
3Dconnexion Space Mouse in Python using raw HID.
Note: you don't need to install or use any of the drivers or 3Dconnexion software to use this package.
It interfaces with the controller directly with hidapi
and python wrapper library easyhid
.
PySpaceMouse is forked from: johnhw/pyspacenavigator
Implements a simple interface for 6 DoF 3Dconnexion Space Mouse device as well as similar devices.
Control Robo Arm with a Space Mouse.
Use the package manager pip to install pyspacemouse. If you are using a Mac with an ARM processor, you'll need a patched version of easyhid
.
# Install package
pip install pyspacemouse
# Only needed for ARM MacOs
pip install git+https://github.com/bglopez/python-easyhid.git
The library uses hidapi
as low-level interface to the device and easyhid
as a Python abstraction for easier use.
C
library for direct communication with HID deviceslibhidapi-dev to access HID data
sudo apt-get install libhidapi-dev
(Debian/Ubuntu)
Compile and install hidapi. (other Linux distributions)
add rules for permissions
sudo echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' > /etc/udev/rules.d/99-hidraw-permissions.rules
sudo usermod -aG plugdev $USER
newgrp plugdev
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-hidraw-permissions.rules sudo usermod -aG plugdev $USER newgrp plugdev
x64
or x86
folder in Path.brew install hidapi
DYLD_LIBRARY_PATH
directory.
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/hidapi/0.14.0/lib:$DYLD_LIBRARY_PATH
pip install git+https://github.com/bglopez/python-easyhid.git
hidapi
interface for Python - required on all platformspip install git+https://github.com/bglopez/python-easyhid.git
hidapi
on MacOS.pip install easyhid
If the 3Dconnexion driver is installed, please ensure to stop 3DconnexionHelper
before running your python scripts.
import pyspacemouse
import time
success = pyspacemouse.open(dof_callback=pyspacemouse.print_state, button_callback=pyspacemouse.print_buttons)
if success:
while 1:
state = pyspacemouse.read()
time.sleep(0.01)
More examples can be found in the /examples directory or in page with Examples.
usage: pyspacemouse [-h] [--version] [--list-spacemouse]
[--list-supported-devices] [--list-all-hid-devices]
[--test-connect]
PySpaceMouse CLI
options:
-h, --help show this help message and exit
--version Version of pyspacemouse
--list-spacemouse List connected SpaceMouse devices
--list-supported-devices
List supported SpaceMouse devices
--list-all-hid-devices
List all connected HID devices
--test-connect Test connect to the first available device
For more information, visit https://spacemouse.kubaandrysek.cz
Look at the Troubleshooting page for help with common issues.
PySpaceMouse is used in the following projects:
FAQs
Multiplatform Python interface to the 3DConnexion Space Mouse - forked from pyspacenavigator
We found that pyspacemouse 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.