CapsLockMorseCode


NameCapsLockMorseCode JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/asweigart/capslockmorsecode
SummaryA silly module to control the keyboard LEDs of the CapsLock, NumLock, and ScrollLock keys to flash Morse Code on Windows, macOS, and Linux.
upload_time2023-08-29 20:57:15
maintainer
docs_urlNone
authorAl Sweigart
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # 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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/asweigart/capslockmorsecode",
    "name": "CapsLockMorseCode",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Al Sweigart",
    "author_email": "al@inventwithpython.com",
    "download_url": "https://files.pythonhosted.org/packages/22/fc/bf12a380b668db53195f46418336dd4b50cba7488c5177a37a0e60c8c314/CapsLockMorseCode-0.1.0.tar.gz",
    "platform": null,
    "description": "# CapsLockMorseCode\r\n\r\n\r\nA silly module to control the keyboard LEDs of the CapsLock, NumLock, and ScrollLock keys to flash Morse Code on Windows, macOS, and Linux.\r\n\r\n## Installation\r\n\r\nTo install with pip on macOS or Linux, run:\r\n\r\n    python3 -m pip install capslockmorsecode\r\n\r\nTo install with pip on Windows, run:\r\n\r\n    py -m pip install capslockmorsecode\r\n\r\n## Quickstart Guide\r\n\r\nYou 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:\r\n\r\n    >>> import capslockmorsecode as mc\r\n    >>> mc.morse('sos')\r\n    >>> mc.morse('.../---/...')\r\n\r\nYou can also flash individual dots and dashes with `dot()` and `dash()`:\r\n\r\n    >>> import capslockmorsecode as mc\r\n    >>> mc.dot()\r\n    >>> mc.dash()\r\n\r\nYou 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:\r\n\r\n    >>> import capslockmorsecode as mc\r\n    >>> mc.caps_lock(True)  # Turn on caps lock.\r\n    >>> mc.caps_lock()\r\n    True\r\n    >>> mc.caps_lock(False) # Turn off caps lock.\r\n\r\nSame for NumLock/ScrollLock with the `num_lock()` and `scroll_lock()` functions:\r\n\r\n    >>> import capslockmorsecode as mc\r\n    >>> mc.num_lock(True)  # Turn on num lock.\r\n    >>> mc.num_lock()\r\n    True\r\n    >>> mc.num_lock(False) # Turn off num lock.\r\n    >>> mc.scroll_lock(True)  # Turn on scroll lock.\r\n    >>> mc.scroll_lock()\r\n    True\r\n    >>> mc.scroll_lock(False) # Turn off scroll lock.\r\n\r\n\r\n\r\n\r\n## Contribute\r\n\r\nIf you'd like to contribute to CapsLockMorseCode, check out https://github.com/asweigart/capslockmorsecode\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "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.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/asweigart/capslockmorsecode"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22fcbf12a380b668db53195f46418336dd4b50cba7488c5177a37a0e60c8c314",
                "md5": "f1dad5af043a832c46f6702f88d6af44",
                "sha256": "07f5804030083049d95b30ae9ee35adee3fb411555b1eb7fed93d552cc4b6455"
            },
            "downloads": -1,
            "filename": "CapsLockMorseCode-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f1dad5af043a832c46f6702f88d6af44",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5309,
            "upload_time": "2023-08-29T20:57:15",
            "upload_time_iso_8601": "2023-08-29T20:57:15.237893Z",
            "url": "https://files.pythonhosted.org/packages/22/fc/bf12a380b668db53195f46418336dd4b50cba7488c5177a37a0e60c8c314/CapsLockMorseCode-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-29 20:57:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "asweigart",
    "github_project": "capslockmorsecode",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "tox": true,
    "lcname": "capslockmorsecode"
}
        
Elapsed time: 0.10326s