Metadata-Version: 2.1
Name: CapsLockMorseCode
Version: 0.1.0
Summary: A silly module to control the keyboard LEDs of the CapsLock, NumLock, and ScrollLock keys to flash Morse Code on Windows, macOS, and Linux.
Home-page: https://github.com/asweigart/capslockmorsecode
Author: Al Sweigart
Author-email: al@inventwithpython.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE

# 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
