CapsLockMorseCode
A silly module to control the keyboard LEDs of the CapsLock, NumLock, and ScrollLock keys to flash Morse Code on Windows, macOS, and Linux.
Installation
To install with pip on macOS or Linux, run:
python3 -m pip install capslockmorsecode
To install with pip on Windows, run:
py -m pip install capslockmorsecode
Quickstart Guide
You can pass a string to morse() to flash morse code with the CapsLock key. The string can either be text or morse code written with . for dots, - for dashes, / for intercharacter spacing, and a space character for word spacing:
>>> import capslockmorsecode as mc
>>> mc.morse('sos')
>>> mc.morse('.../---/...')
You can also flash individual dots and dashes with dot() and dash():
>>> import capslockmorsecode as mc
>>> mc.dot()
>>> mc.dash()
You can directly control the CapsLock and NumLock LEDs by passing True (on) or False (off) to caps_lock(), or just call caps_lock() to get the current state of it:
>>> import capslockmorsecode as mc
>>> mc.caps_lock(True) # Turn on caps lock.
>>> mc.caps_lock()
True
>>> mc.caps_lock(False) # Turn off caps lock.
Same for NumLock/ScrollLock with the num_lock() and scroll_lock() functions:
>>> import capslockmorsecode as mc
>>> mc.num_lock(True) # Turn on num lock.
>>> mc.num_lock()
True
>>> mc.num_lock(False) # Turn off num lock.
>>> mc.scroll_lock(True) # Turn on scroll lock.
>>> mc.scroll_lock()
True
>>> mc.scroll_lock(False) # Turn off scroll lock.
Contribute
If you'd like to contribute to CapsLockMorseCode, check out https://github.com/asweigart/capslockmorsecode
Metadata
Release files for CapsLockMorseCode 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| CapsLockMorseCode-0.1.0.tar.gz | 5.3 kB | Without provenance | Details for CapsLockMorseCode-0.1.0.tar.gz |
Release files / CapsLockMorseCode-0.1.0.tar.gz
| Download URL | CapsLockMorseCode-0.1.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07f5804030083049d95b30ae9ee35adee3fb411555b1eb7fed93d552cc4b6455
|
|
BLAKE2b-256 checksum How to use checksums |
22fcbf12a380b668db53195f46418336dd4b50cba7488c5177a37a0e60c8c314
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for CapsLockMorseCode 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.