Skip to main content

Hook and simulate keyboard events on Windows and Linux

Project description

keyboard
========

Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

- Global event hook (captures keys regardless of focus).
- Simulates key presses.
- Complex hotkey support (e.g. `Ctrl+Shift+A` followed by `Alt+Space`) with controllable timeout.
- Maps keys as they actually are in your layout, with full internationalization support ('Ctrl+ç').
- Events automatically captured in separate thread, doesn't block main program.
- Pure Python, no C modules to be compiled.
- Zero dependencies. Trivial to install and deploy.
- Works with Windows and Linux (if you have a Mac, pull requests are welcome).
- Python 2 and Python 3.
- Tested and documented.
- Doesn't break accented dead keys (I'm looking at you, pyHook)
- Mouse support coming soon.

Example:

```
import keyboard

# Press PAGE UP then PAGE DOWN to type "foobar".
keyboard.add_hotkey('page up, page down', lambda: keyboard.write('foobar'))

# Blocks until you press esc.
wait('esc')
```

This program makes no attempt to hide itself, so don't use it for keyloggers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keyboard-0.7.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

keyboard-0.7.1.linux-i686.zip (48.2 kB view details)

Uploaded Source

keyboard-0.7.1-py2.py3-none-any.whl (20.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file keyboard-0.7.1.tar.gz.

File metadata

  • Download URL: keyboard-0.7.1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for keyboard-0.7.1.tar.gz
Algorithm Hash digest
SHA256 2a1195d94f8b79ce8fc5fc3198c92d04481f0657a3243de0e5aba22727e60084
MD5 30786a926536167bc37125420dfc1706
BLAKE2b-256 5e92b3a5ef0a8a7b3355fa0d5cffa1590083a0a1171a44b4957a5510625de83b

See more details on using hashes here.

File details

Details for the file keyboard-0.7.1.linux-i686.zip.

File metadata

File hashes

Hashes for keyboard-0.7.1.linux-i686.zip
Algorithm Hash digest
SHA256 80e039ffce3bbbd58b2a157f6d7651a91feafbdf3988340e755991dcc7cee854
MD5 92333b51d1c955d40d25c8f4a0a1e37a
BLAKE2b-256 c75c58a1be18322d9a43a135231cdb1508a3ef8df47b7ce32e439203924c8003

See more details on using hashes here.

File details

Details for the file keyboard-0.7.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for keyboard-0.7.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 aed25faa66efe9df428e941b886d353536372534e74660e4736d522fc4f9376d
MD5 63e64a8128134a4f22d3fefef40ea892
BLAKE2b-256 0b8cae4c478ca116887e2a21a659ecf6941b84afd45b408ee8266fada13ba7d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page