Skip to content

Pynput on_move missing complete signature #15855

@huntfx

Description

@huntfx

on_move: Callable[[int, int], bool | None] | None = None,

It should allow for both (x: int, y: int) and (x: int, y: int, injected: bool).

https://github.com/moses-palmer/pynput/blob/afc64577b069a51a91474a235f0efbb0e7e0357d/lib/pynput/mouse/_base.py#L198-L207

Edit: Found how it sets the functions. It has a complete signature, then allows any number of arguments less than that.

Callback Max args Signature
on_move 3 (x, y, injected)
on_click 5 (x, y, button, pressed, injected)
on_scroll 5 (x, y, dx, dy, injected)

So for example, you can have on_click(x) or on_click(x, y, button), both are valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions