Skip to content
Manuel Cabral edited this page Jun 13, 2022 · 9 revisions

The Cursor class contains methods for controlling the mouse.

Methods

class cornelius.Cursor

  • get()

    Gets the current cursor position

    Returns -> (tuple) with the next items

    • x (int): The vertical position in pixels
    • y (int): The horizontal position in pixels
    • point (POINT)
  • set(x, y)

    Sets the cursor position (in pixels)

    Parameters

    • x (int): The vertical position in pixels
    • y (int): The horizontal position in pixels

    Returns -> None

  • press(button)

    Press a mouse button

    Parameters

    • button (int): The button id to press (1: left, 2: right)

    Raises

    • InvalidButtonException (CorneliusException): If the button is not valid

    Returns -> None

  • release(button)

    Release a mouse button

    Parameters

    • button (int): The button id to release (1: left, 2: right)

    Raises

    • InvalidButtonException (CorneliusException): If the button is not valid

    Returns -> None

  • left_click(delay)

    Send a left click

    Parameters

    • delay (float): Delay between clicks in seconds

    Returns -> None

  • right_click(delay)

    Send a right click

    Parameters

    • delay (float): Delay between clicks in seconds

    Returns -> None

  • is_pressed(button)

    Parameters

    • button (int): The button id to check (1: left, 2: right)

    Raises

    • InvalidButtonException (CorneliusException): If the button is not valid

    Returns -> (boolean) True if pressed, False otherwise

Constants

  • class cornelius.Cursor.LEFT_BUTTON
  • class cornelius.Cursor.RIGHT_BUTTON