Skip to main content

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

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)

Source distribution for CapsLockMorseCode 0.1.0
File Size Uploaded
CapsLockMorseCode-0.1.0.tar.gz 5.3 kB Details

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page