$npx skillfedfor your agent

keyboard

Hook and simulate keyboard events on Windows and Linux

With conditionsPyPI Python ModulesReleased Mar 2020947.4K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — keyboard-0.13.5-py3-none-any.whl
v0.13.5 · released 2020-03-23 · 1 runtime deps: pyobjc

Yes, if you need global keyboard control on Windows or Linux. The package is actively maintained, has no known vulnerabilities, and low install friction. On macOS, experimental support means you should test thoroughly before relying on it. Note that Linux requires root/sudo and Windows has the most complete feature set; key suppression is Windows-only.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Linux requires root/sudo access to read raw device files.
  • Windows and macOS do not require elevated privileges.
  • Low friction install with a single pure-Python runtime dependency (pyobjc).

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you must include the license notice in distributions.

last release 2020-03-23 (2335 days) · last repo commit 2026-07-10 · 3,961 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 947,380 downloads/mo, #4,664 on PyPI

Verify before relying

pip install keyboard

import keyboard

keyboard.add_hotkey('ctrl+shift+a', lambda: keyboard.write('hello'))
keyboard.wait('esc')
  • Whether pyobjc is automatically installed on non-macOS systems or only when needed
  • Current state of experimental macOS support and any known stability issues
  • Whether key suppression/blocking has been implemented on Linux since the last release
Same gist for agents: .md · .json

What it is and what it does

keyboard is a Python library that gives you low-level control over keyboard input and output on Windows, Linux, and macOS. It lets you hook global keyboard events (capturing key presses regardless of which window has focus), register complex hotkey combinations, simulate key presses, and record/replay keyboard sequences. The library runs event capture in a separate thread so it doesn't block your main program.

The package is pure Python with no C compilation required, making it trivial to install and deploy. It depends on pyobjc for macOS support. Known limitations include that key suppression only works on Windows, Linux requires root access to read raw device files, and some applications can swallow key events before keyboard sees them.

Use it for

  • Build system-wide hotkey handlers that trigger functions regardless of active window
  • Automate repetitive typing tasks by simulating key sequences and text input
  • Record keyboard activity for playback at different speeds or for testing
  • Create keyboard shortcuts for accessibility or custom application workflows
  • Implement text abbreviation expansion (e.g., replace '@@' with an email address)

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need global keyboard control on Windows or Linux.

The package is actively maintained, has no known vulnerabilities, and low install friction. On macOS, experimental support means you should test thoroughly before relying on it. Note that Linux requires root/sudo and Windows has the most complete feature set; key suppression is Windows-only.

Install

keyboard on PyPI

Before you install

Low friction install with a single pure-Python runtime dependency (pyobjc). Actively maintained as of July 2026 with 3961 repository stars and steady popularity (top 5000 PyPI packages by downloads).

Linux requires root/sudo access to read raw device files. Windows and macOS do not require elevated privileges.

License in practice

MIT license permits commercial and private use with minimal restrictions; you must include the license notice in distributions.

Quickstart

pip install keyboard

import keyboard

keyboard.add_hotkey('ctrl+shift+a', lambda: keyboard.write('hello'))
keyboard.wait('esc')

Verify before relying

  • Whether pyobjc is automatically installed on non-macOS systems or only when needed
  • Current state of experimental macOS support and any known stability issues
  • Whether key suppression/blocking has been implemented on Linux since the last release

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pyobjc
MaintenanceActively maintained 2,335 days since the last release
Last repo commit
First released
Downloads947,380 / month, #4,664 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Evidence: keyboard-0.13.5-py3-none-any.whl

Tags

Capabilities
keyboard event hookglobal hotkey registrationsimulate key presseskeyboard input capturekeyboard automationkey event listenerhotkey binding
Topics
input-automationsystem-integration
PyPI keywords
keyboardhooksimulatehotkey

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 event hook”

  • keyboardHook global keyboard events, register hotkeys, and simulate key…
  • ipyeventsipyevents provides a Jupyter widget that captures mouse and keyboard…
  • evdevProvides Python bindings to Linux's evdev and uinput input event…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

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.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

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.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

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.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

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…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also sshkeyboard · inputs · PyAutoGUI · pynput · pynput-robocorp-fork · PyDirectInput · ipyevents · pywinauto · python-yakh · readchar