--- id: ipyevents version: "2.0.4" license: BSD 3-clause license_treatment: permissive maintenance: active --- # ipyevents — A custom widget for returning mouse and keyboard events to Python License: permissive · Maintenance: active · Downloads: 557.1K/mo ## What it is and what it does ipyevents is a Jupyter widget that bridges browser-side mouse and keyboard events to Python code running in notebook cells. It wraps any existing ipywidgets widget and emits events when users interact with it—clicking, typing, moving the mouse—allowing you to write event handlers in Python that respond to those interactions in real time. The package is designed for interactive notebook workflows where you want to build responsive interfaces without leaving Python. Common use cases include adding keyboard shortcuts to widgets, detecting clicks on images, and building custom interactive visualizations. It depends only on ipywidgets and is compatible with modern Python versions (3.9 and above) and JupyterLab 3 or higher. Use it for: - Add keyboard shortcuts to existing widgets in a notebook for faster user interaction - Detect and respond to mouse clicks on an image to trigger analysis or display metadata - Build interactive drawing or annotation tools by capturing mouse movement and click events - Create custom interactive plots that respond to user clicks or key presses without rebuilding the widget - Implement event-driven callbacks for data exploration workflows in Jupyter notebooks ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ipyevents provides a Jupyter widget that captures mouse and keyboard events from the browser and returns them to Python, enabling event-driven interactions within notebook cells. Yes. ipyevents is actively maintained, has no known vulnerabilities, installs with low friction, and fills a clear gap in Jupyter interactivity. If you need to capture and respond to browser events in a notebook widget, it is the standard tool for that task. ## Install pip install ipyevents uv add ipyevents poetry add ipyevents ## Installing ipyevents Before you install: Low friction: pure Python wheel with a single runtime dependency on ipywidgets. Actively maintained with recent commits and no known vulnerabilities. License in practice: BSD 3-clause permissive license allows use in commercial and private projects with minimal restrictions beyond retaining the license notice. Quickstart: pip install ipyevents from ipyevents import Event from ipywidgets import Image image = Image(value=open('image.png', 'rb').read()) events = Event(source=image, watched_events=['click']) def on_click(change): print(f"Clicked at {change['new']}") events.on_msg(on_click) Requires JupyterLab 3 or higher (stable releases 2.0.0+); earlier versions support JupyterLab 2 via ipyevents 0.9.0. Verify before relying: - Whether the package supports touch events or only mouse/keyboard events - Performance characteristics when handling high-frequency event streams - Compatibility with non-JupyterLab notebook environments (classic Jupyter, VS Code, etc.) ## Package facts - License: BSD 3-clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 557.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags jupyter widget mouse keyboard events, browser events in jupyter notebooks, ipywidgets event handling, jupyter interactive event callbacks, keyboard shortcuts jupyter widgets, click detection jupyter images, jupyter event listener widget, jupyter-widget, interactive-notebook, event-handling [View on SkillFed](https://skillfed.io/packages/ipyevents) · [View on PyPI](https://pypi.org/project/ipyevents/)