Registry / devops / mouse
library0.7.1pypypi✓ verified 85d ago

Library to hook and simulate mouse events on Windows and Linux. Current version 0.7.1. Maintained infrequently, with rare releases.

pip install mouse
INSTALL
IMPORT
SIG · MOUSE
M
mouse
devopspythonv0.7.1
Install
1.5s avg
Import
57ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.054s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.060s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mouse
import mouse

Move mouse, click, listen to clicks, record and replay events.

import mouse mouse.move(200, 300) mouse.click('left') mouse.on_click(lambda: print('clicked')) # Record and play events recorded = mouse.record() mouse.play(recorded)
Debug
Known issues
gotchamouse.record() blocks until user presses right mouse button (by default). To stop recording programmatically, you must call mouse.unhook_all() from a separate thread or use hook().
fix
Use mouse.hook() to capture events non-blockingly, or run record() in another thread and call mouse.unhook_all() to stop.
affects: >=0.6.0
gotchaOn Linux, mouse requires X server and may need sudo for access to /dev/input/mice. Without proper permissions, hooks silently fail or no events fire.
fix
Run as root or add user to 'input' group. Check /dev/input/mice access.
affects: all
deprecatedmouse.is_pressed() is not implemented; checking mouse button state is not supported. Only hooks and events are available.
fix
Use on_click callback to detect button presses instead.
affects: all
Errors
Common errors & fixes
AttributeError: module 'mouse' has no attribute 'record'
Older version (<0.6.0) missing record/playback. Or pip installed wrong package.
fix
Upgrade: pip install --upgrade mouse
OSError: [Errno 13] Permission denied: '/dev/input/mice'
User lacks permission to read input devices on Linux.
fix
Add user to 'input' group: sudo usermod -a -G input $USER then logout/reboot, or run script with sudo.
ImportError: No module named 'mouse'
Package not installed or virtual environment not activated.
fix
pip install mouse
Upgrade
Version history
0.7.1latest on PyPI · released Jan 1, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mouse — pip install mouse · libregistry