sshkeyboard
sshkeyboard
Decision gist · record as of 2026-08-14
Yes, if you need keyboard input in an SSH session or headless environment and can accept the limitations (no modifier keys, no simultaneous multi-key presses). The library is stable, dependency-free, and permissively licensed. Maintenance is dormant but the codebase relies only on standard library, so breakage is unlikely. Not suitable for applications requiring full keyboard state or complex key combinations.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6+.
- On Unix systems, keyboard input is read from stdin; on Windows, uses msvcrt.
- Some modifier keys (Ctrl, Shift, Alt, Super) do not register, and holding multiple keys simultaneously does not work reliably.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute freely with minimal restrictions.
last release 2021-10-28 (1751 days) · last repo commit 2024-07-24 · 41 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 89,417 downloads/mo, #13,661 on PyPI
Alternatives
Verify before relying
pip install sshkeyboard
from sshkeyboard import listen_keyboard
def press(key):
print(f"'{key}' pressed")
listen_keyboard(on_press=press)- Whether Windows support (noted as 'still new') has matured since the last release in October 2021.
- Real-world reliability of key timing parameters (delay_second_char, delay_other_chars) across different terminal emulators and SSH clients.
- Whether the library handles rapid key presses without losing input in production scenarios.
What it is and what it does
sshkeyboard is a keyboard event callback library designed to work in environments where traditional keyboard libraries fail—specifically SSH sessions, headless servers, and WSL. It reads keyboard input from stdin on Unix systems (using fcntl and termios) and from msvcrt on Windows, then fires on_press and on_release callbacks for each key. It supports both synchronous and asynchronous callbacks, sequential or concurrent execution modes, and can be controlled via asyncio.
The trade-off is significant: it cannot detect modifier keys (Ctrl, Shift, Alt, Super, Caps Lock), does not reliably handle multiple simultaneous key presses, and may lose input during rapid key spam. These limitations are inherent to reading from stdin rather than using system-level input APIs. The library is useful for simple remote control scenarios—like steering a Raspberry Pi robot over SSH—but not for applications requiring full keyboard state or complex key combinations.
Use it for
- Control a Raspberry Pi robot or RC car remotely over SSH by mapping key presses to motor commands.
- Build a headless server application that responds to keyboard input without X server or uinput.
- Create a simple terminal-based game or interactive tool that runs inside WSL 2 or a remote terminal.
- Monitor or debug a system via SSH with keyboard-driven callbacks for quick actions.
- Prototype keyboard-driven automation on systems where other keyboard libraries do not work.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need keyboard input in an SSH session or headless environment and can accept the limitations (no modifier keys, no simultaneous multi-key presses).
The library is stable, dependency-free, and permissively licensed. Maintenance is dormant but the codebase relies only on standard library, so breakage is unlikely. Not suitable for applications requiring full keyboard state or complex key combinations.
Install
sshkeyboard on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant—last commit 2024-07-24—but the codebase is stable and uses only standard library modules (fcntl, termios on Unix; msvcrt on Windows).
Requires Python 3.6+. On Unix systems, keyboard input is read from stdin; on Windows, uses msvcrt. Some modifier keys (Ctrl, Shift, Alt, Super) do not register, and holding multiple keys simultaneously does not work reliably.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install sshkeyboard
from sshkeyboard import listen_keyboard
def press(key):
print(f"'{key}' pressed")
listen_keyboard(on_press=press)
Verify before relying
- Whether Windows support (noted as 'still new') has matured since the last release in October 2021.
- Real-world reliability of key timing parameters (delay_second_char, delay_other_chars) across different terminal emulators and SSH clients.
- Whether the library handles rapid key presses without losing input in production scenarios.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,751 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 89,417 / month, #13,661 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: BSDOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: sshkeyboard-2.3.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “keyboard input ssh”
- sshkeyboardCaptures keyboard input via callbacks in SSH sessions and headless…
- pynputPynput lets you programmatically control and monitor mouse and…
- inputsProvides cross-platform Python access to keyboard, mouse, and gamepad…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also pynput · keyboard · pynput-robocorp-fork · inputs · evdev · PyAutoGUI · ipyevents · PyDirectInput · python-yakh · asynckivy