keyboard-extended


Namekeyboard-extended JSON
Version 0.2.4 PyPI version JSON
download
home_pageNone
SummaryExtension for the keyboard package
upload_time2024-03-31 22:32:37
maintainerNone
docs_urlNone
authorAndré Herber
requires_pythonNone
licenseNone
keywords python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# keyboard_extended

Extension for the keyboard package



## Relevant content:

- `KeyboardListener`

  - Class to start and stop listening to the keyboard. When creating an instance, there will be a new hook to the keyboard if start_listening is not set False. Use start_keyboard_hook to star listening manually, and  stop_keyboard_hook to stop listening manually.

  - **Imortant:**

    - **Without starting the hook using this class the hotkeys set with the function below won't work.**

    - **If you create multiple instances of this class, your hotkeys will be called multiple times.**

- `bind_hotkey`

  - Add a normal hotkey to the given keys.

  - Args:

    - keys (str): The keys as a string, if multiple keys seperated by '+' (+ is than plus).

    - callback (typing.Callable): Your callback, which is called when all criteria are met.

    - args (typing.Iterable, optional): Your arguments to be passed to the callback function. Defaults to None.

    - state (str, optional): The respective state of the button, which can be either "down" or "up". Defaults to "down".

    - keys_to_states (dict[str, str], optional): May be a dictionary specifiing the (single) key name and the corresponding state for this key. Defaults to None.

    - fire_when_hold (bool, optional): If all criteria are met and you keep the buttons pressed, the callback is called repeatedly. Defaults to False.

    - send_keys (bool, optional): Add all the keys as a list to the arguments at position 0. Defaults to False.

    - scan_code (int | tuple[int], optional): If you want to differentiate between keys that have the same name but different scan code (e.g. left and right shift) you can add the scan code here. You may input multiple scan codes. Reduces the relevant history of the key to events with matching scan codes. Defaults to None.

    - ignore_keypad (bool, optional): With the True setting, any input via the keyboard is ignored. Defaults to False.

  - Returns:

    - UUID: The id needed to remove the binding using the remove_binding function.

- `bind_hotkey_hold`

  - Add a hotkey that requires the buttons to be held down.

  - Args:

      - keys (str): The keys as a string, if multiple keys seperated by '+' (+ is than plus).

      - callback (typing.Callable): Your callback, which is called when all criteria are met.

      - args (typing.Iterable, optional): Your arguments to be passed to the callback function. Defaults to None.

      - time_span (float, optional): The period of time for which the keys have to be hold down. Defaults to 1.

      - keys_to_hold_times (dict[str, float], optional): May be a dictionary specifiing the (single) key name and the minimum duration for which this key has to be hold down. Defaults to None.

      - continue_fire_when_hold (bool, optional): If set to True the callback function will be called repeatedly. Defaults to False.

      - send_keys (bool, optional): Add all the keys as a list to the arguments at position 0. Defaults to False.

      - scan_code (int | tuple[int], optional): If you want to differentiate between keys that have the same name but different scan code (e.g. left and right shift) you can add the scan code here. You may input multiple scan codes. Reduces the relevant history of the key to events with matching scan codes. Defaults to None.

      - ignore_keypad (bool, optional): With the True setting, any input via the keyboard is ignored. Defaults to False.



  - Returns:

      - UUID: The id needed to remove the binding using the remove_binding function.

- `bind_hotkey_multipress`

  - Add a hotkey that requires the keys to be pressed repeatedly.

  - Args:

      - keys (str): The keys as a string, if multiple keys seperated by '+' (+ is than plus).

      - callback (typing.Callable): Your callback, which is called when all criteria are met.

      - args (typing.Iterable, optional): Your arguments to be passed to the callback function. Defaults to None.

      - time_span (float, optional): The period of time in which the presses must take place. Defaults to 0.5.

      - presses (int, optional): The amount of which the key has to send the state. Defaults to 3.

      - state (str, optional): The respective state of the button, which can be either "down" or "up" - if "up" only the "up" events of the history are relevant. Defaults to "down".

      - keys_to_multipress_times (dict[str, dict[str, typing.Any]], optional): May be a dictionary specifiing the (single) key name and a corresponding dictionary containing "state", "time_span" and "presses" for this key. Defaults to None.

      - fire_when_hold (bool, optional): If all criteria are met and you keep the buttons pressed, the callback may be called repeatedly. Defaults to False.

      - send_keys (bool, optional): Add all the keys as a list to the arguments at position 0. Defaults to False.

      - scan_code (int | tuple[int], optional): If you want to differentiate between keys that have the same name but different scan code (e.g. left and right shift) you can add the scan code here. You may input multiple scan codes. Reduces the relevant history of the key to events with matching scan codes. Defaults to None.

      - ignore_keypad (bool, optional): With the True setting, any input via the keyboard is ignored. Defaults to False.

  - Returns:

      - UUID: The id needed to remove the binding using the remove_binding function.

- `remove_binding`

  - Remove a hotkey created using one of the following functions:

    - `bind_hotkey`

    - `bind_hotkey_hold`

    - `bind_hotkey_multipress`

  - Args:

    - hotkey_id (UUID): The id needed to remove the hotkey. This is the return value of the functions listed above.

- `remove_all_bindings`

  - Remove all hotkeys created using one of the following functions:

    - `bind_hotkey`

    - `bind_hotkey_hold`

    - `bind_hotkey_multipress`

  

## More content:

- `Key`

  - Class to handle keys

- `Binding`

  - Class to handle bindings


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "keyboard-extended",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python",
    "author": "Andr\u00e9 Herber",
    "author_email": "andre.herber.programming@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2e/bf/98a0ad58a2b470266e60329e026e3b6bc5c9204786b4ade29c552ec5c881/keyboard_extended-0.2.4.tar.gz",
    "platform": null,
    "description": "\n# keyboard_extended\n\nExtension for the keyboard package\n\n\n\n## Relevant content:\n\n- `KeyboardListener`\n\n  - Class to start and stop listening to the keyboard. When creating an instance, there will be a new hook to the keyboard if start_listening is not set False. Use start_keyboard_hook to star listening manually, and  stop_keyboard_hook to stop listening manually.\n\n  - **Imortant:**\n\n    - **Without starting the hook using this class the hotkeys set with the function below won't work.**\n\n    - **If you create multiple instances of this class, your hotkeys will be called multiple times.**\n\n- `bind_hotkey`\n\n  - Add a normal hotkey to the given keys.\n\n  - Args:\n\n    - keys (str): The keys as a string, if multiple keys seperated by '+' (+ is than plus).\n\n    - callback (typing.Callable): Your callback, which is called when all criteria are met.\n\n    - args (typing.Iterable, optional): Your arguments to be passed to the callback function. Defaults to None.\n\n    - state (str, optional): The respective state of the button, which can be either \"down\" or \"up\". Defaults to \"down\".\n\n    - keys_to_states (dict[str, str], optional): May be a dictionary specifiing the (single) key name and the corresponding state for this key. Defaults to None.\n\n    - fire_when_hold (bool, optional): If all criteria are met and you keep the buttons pressed, the callback is called repeatedly. Defaults to False.\n\n    - send_keys (bool, optional): Add all the keys as a list to the arguments at position 0. Defaults to False.\n\n    - scan_code (int | tuple[int], optional): If you want to differentiate between keys that have the same name but different scan code (e.g. left and right shift) you can add the scan code here. You may input multiple scan codes. Reduces the relevant history of the key to events with matching scan codes. Defaults to None.\n\n    - ignore_keypad (bool, optional): With the True setting, any input via the keyboard is ignored. Defaults to False.\n\n  - Returns:\n\n    - UUID: The id needed to remove the binding using the remove_binding function.\n\n- `bind_hotkey_hold`\n\n  - Add a hotkey that requires the buttons to be held down.\n\n  - Args:\n\n      - keys (str): The keys as a string, if multiple keys seperated by '+' (+ is than plus).\n\n      - callback (typing.Callable): Your callback, which is called when all criteria are met.\n\n      - args (typing.Iterable, optional): Your arguments to be passed to the callback function. Defaults to None.\n\n      - time_span (float, optional): The period of time for which the keys have to be hold down. Defaults to 1.\n\n      - keys_to_hold_times (dict[str, float], optional): May be a dictionary specifiing the (single) key name and the minimum duration for which this key has to be hold down. Defaults to None.\n\n      - continue_fire_when_hold (bool, optional): If set to True the callback function will be called repeatedly. Defaults to False.\n\n      - send_keys (bool, optional): Add all the keys as a list to the arguments at position 0. Defaults to False.\n\n      - scan_code (int | tuple[int], optional): If you want to differentiate between keys that have the same name but different scan code (e.g. left and right shift) you can add the scan code here. You may input multiple scan codes. Reduces the relevant history of the key to events with matching scan codes. Defaults to None.\n\n      - ignore_keypad (bool, optional): With the True setting, any input via the keyboard is ignored. Defaults to False.\n\n\n\n  - Returns:\n\n      - UUID: The id needed to remove the binding using the remove_binding function.\n\n- `bind_hotkey_multipress`\n\n  - Add a hotkey that requires the keys to be pressed repeatedly.\n\n  - Args:\n\n      - keys (str): The keys as a string, if multiple keys seperated by '+' (+ is than plus).\n\n      - callback (typing.Callable): Your callback, which is called when all criteria are met.\n\n      - args (typing.Iterable, optional): Your arguments to be passed to the callback function. Defaults to None.\n\n      - time_span (float, optional): The period of time in which the presses must take place. Defaults to 0.5.\n\n      - presses (int, optional): The amount of which the key has to send the state. Defaults to 3.\n\n      - state (str, optional): The respective state of the button, which can be either \"down\" or \"up\" - if \"up\" only the \"up\" events of the history are relevant. Defaults to \"down\".\n\n      - keys_to_multipress_times (dict[str, dict[str, typing.Any]], optional): May be a dictionary specifiing the (single) key name and a corresponding dictionary containing \"state\", \"time_span\" and \"presses\" for this key. Defaults to None.\n\n      - fire_when_hold (bool, optional): If all criteria are met and you keep the buttons pressed, the callback may be called repeatedly. Defaults to False.\n\n      - send_keys (bool, optional): Add all the keys as a list to the arguments at position 0. Defaults to False.\n\n      - scan_code (int | tuple[int], optional): If you want to differentiate between keys that have the same name but different scan code (e.g. left and right shift) you can add the scan code here. You may input multiple scan codes. Reduces the relevant history of the key to events with matching scan codes. Defaults to None.\n\n      - ignore_keypad (bool, optional): With the True setting, any input via the keyboard is ignored. Defaults to False.\n\n  - Returns:\n\n      - UUID: The id needed to remove the binding using the remove_binding function.\n\n- `remove_binding`\n\n  - Remove a hotkey created using one of the following functions:\n\n    - `bind_hotkey`\n\n    - `bind_hotkey_hold`\n\n    - `bind_hotkey_multipress`\n\n  - Args:\n\n    - hotkey_id (UUID): The id needed to remove the hotkey. This is the return value of the functions listed above.\n\n- `remove_all_bindings`\n\n  - Remove all hotkeys created using one of the following functions:\n\n    - `bind_hotkey`\n\n    - `bind_hotkey_hold`\n\n    - `bind_hotkey_multipress`\n\n  \n\n## More content:\n\n- `Key`\n\n  - Class to handle keys\n\n- `Binding`\n\n  - Class to handle bindings\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Extension for the keyboard package",
    "version": "0.2.4",
    "project_urls": null,
    "split_keywords": [
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70bd50ed66ae689dd80e91699e9b76d5d43ee7507b82e7e19593b58a86840a30",
                "md5": "44f249e81c5f113bf3b7bbb0afaa2c21",
                "sha256": "07b8a59047eccf7aca7f00e250cb059ed9d96c0d6abb346dba5727534111f267"
            },
            "downloads": -1,
            "filename": "keyboard_extended-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "44f249e81c5f113bf3b7bbb0afaa2c21",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13615,
            "upload_time": "2024-03-31T22:32:35",
            "upload_time_iso_8601": "2024-03-31T22:32:35.545391Z",
            "url": "https://files.pythonhosted.org/packages/70/bd/50ed66ae689dd80e91699e9b76d5d43ee7507b82e7e19593b58a86840a30/keyboard_extended-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ebf98a0ad58a2b470266e60329e026e3b6bc5c9204786b4ade29c552ec5c881",
                "md5": "9ce48298128d058cd0b8ab496bff3ebe",
                "sha256": "3fa6b4559b3bbbdbfa4285a8e39e2e3dd0e2c2de38cd3fffcda033ef2b09ddb9"
            },
            "downloads": -1,
            "filename": "keyboard_extended-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "9ce48298128d058cd0b8ab496bff3ebe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14159,
            "upload_time": "2024-03-31T22:32:37",
            "upload_time_iso_8601": "2024-03-31T22:32:37.241037Z",
            "url": "https://files.pythonhosted.org/packages/2e/bf/98a0ad58a2b470266e60329e026e3b6bc5c9204786b4ade29c552ec5c881/keyboard_extended-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-31 22:32:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "keyboard-extended"
}
        
Elapsed time: 0.21972s