|
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.
typeshed/stubs/pynput/pynput/mouse/_base.pyi
Line 91 in 9a0dd09
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.
So for example, you can have
on_click(x)oron_click(x, y, button), both are valid.