Skip to content

Keyboard

leoarayav edited this page Jun 12, 2022 · 1 revision

The Keyboard class contains methods for controlling/manipulating the keyboard.

Methods

class cornelius.Keyboard

  • press()

    Press any key

    Parameters

    • key (int): Key to press

    Raises

    • InvalidKeyException (CorneliusException): If key is not str or int

    Returns -> None

  • release()

    Release any key

    Parameters

    • key (int): Key to release

    Raises

    • InvalidKeyException (CorneliusException): If key is not str or int

    Returns -> None

  • is_pressed()

    Check if a key is pressed.

    Parameters

    • key (int): Key to check

    Raises

    • TypeError (Exception): If key is not str or int

    Returns

    • True: If the key is pressed
    • False: Otherwise