mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Mark pynput as completed (#9235)
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
|
||||
pynput.keyboard.Controller.__init__
|
||||
pynput.mouse.Controller.__init__
|
||||
|
||||
# stubtest issues with non-`type` metaclasses, see https://github.com/python/mypy/issues/13316
|
||||
pynput.keyboard.Controller._Key
|
||||
pynput.keyboard._base.Controller._Key
|
||||
pynput.keyboard._dummy.Controller._Key
|
||||
|
||||
# Platform specific private utils:
|
||||
pynput._util.xorg_keysyms
|
||||
pynput._util.xorg
|
||||
pynput._util.win32_vks
|
||||
pynput._util.win32
|
||||
pynput._util.uinput
|
||||
pynput._util.darwin_vks
|
||||
pynput._util.darwin
|
||||
|
||||
5
stubs/pynput/@tests/stubtest_allowlist_linux.txt
Normal file
5
stubs/pynput/@tests/stubtest_allowlist_linux.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
|
||||
pynput.keyboard.Controller.__init__
|
||||
|
||||
# Platform specific implementation detail:
|
||||
pynput.keyboard.Controller.keyboard_mapping
|
||||
2
stubs/pynput/@tests/stubtest_allowlist_win32.txt
Normal file
2
stubs/pynput/@tests/stubtest_allowlist_win32.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
|
||||
pynput.keyboard.Controller.__init__
|
||||
@@ -1 +1,5 @@
|
||||
version = "1.7.*"
|
||||
|
||||
[tool.stubtest]
|
||||
ignore_missing_stub = false
|
||||
platforms = ["linux", "darwin", "win32"]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import contextlib
|
||||
import enum
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from typing import Any, ClassVar
|
||||
@@ -61,6 +62,11 @@ class Key(enum.Enum):
|
||||
f18: int
|
||||
f19: int
|
||||
f20: int
|
||||
if sys.platform == "win32":
|
||||
f21: int
|
||||
f22: int
|
||||
f23: int
|
||||
f24: int
|
||||
home: int
|
||||
left: int
|
||||
page_down: int
|
||||
@@ -89,6 +95,10 @@ class Controller:
|
||||
_KeyCode: ClassVar[type[KeyCode]] # undocumented
|
||||
_Key: ClassVar[type[Key]] # undocumented
|
||||
|
||||
if sys.platform == "linux":
|
||||
CTRL_MASK: ClassVar[int]
|
||||
SHIFT_MASK: ClassVar[int]
|
||||
|
||||
class InvalidKeyException(Exception): ...
|
||||
class InvalidCharacterException(Exception): ...
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import enum
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable
|
||||
from types import TracebackType
|
||||
@@ -11,6 +12,37 @@ class Button(enum.Enum):
|
||||
left: int
|
||||
middle: int
|
||||
right: int
|
||||
if sys.platform == "linux":
|
||||
button8: int
|
||||
button9: int
|
||||
button10: int
|
||||
button11: int
|
||||
button12: int
|
||||
button13: int
|
||||
button14: int
|
||||
button15: int
|
||||
button16: int
|
||||
button17: int
|
||||
button18: int
|
||||
button19: int
|
||||
button20: int
|
||||
button21: int
|
||||
button22: int
|
||||
button23: int
|
||||
button24: int
|
||||
button25: int
|
||||
button26: int
|
||||
button27: int
|
||||
button28: int
|
||||
button29: int
|
||||
button30: int
|
||||
scroll_down: int
|
||||
scroll_left: int
|
||||
scroll_right: int
|
||||
scroll_up: int
|
||||
if sys.platform == "win32":
|
||||
x1: int
|
||||
x2: int
|
||||
|
||||
class Controller:
|
||||
def __init__(self) -> None: ...
|
||||
@@ -29,6 +61,29 @@ class Controller:
|
||||
) -> None: ...
|
||||
|
||||
class Listener(AbstractListener):
|
||||
if sys.platform == "win32":
|
||||
WM_LBUTTONDOWN: int
|
||||
WM_LBUTTONUP: int
|
||||
WM_MBUTTONDOWN: int
|
||||
WM_MBUTTONUP: int
|
||||
WM_MOUSEMOVE: int
|
||||
WM_MOUSEWHEEL: int
|
||||
WM_MOUSEHWHEEL: int
|
||||
WM_RBUTTONDOWN: int
|
||||
WM_RBUTTONUP: int
|
||||
WM_XBUTTONDOWN: int
|
||||
WM_XBUTTONUP: int
|
||||
|
||||
MK_XBUTTON1: int
|
||||
MK_XBUTTON2: int
|
||||
|
||||
XBUTTON1: int
|
||||
XBUTTON2: int
|
||||
|
||||
CLICK_BUTTONS: dict[int, tuple[Button, bool]]
|
||||
X_BUTTONS: dict[int, dict[int, tuple[Button, bool]]]
|
||||
SCROLL_BUTTONS: dict[int, tuple[int, int]]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
on_move: Callable[[int, int], bool | None] | None = ...,
|
||||
|
||||
Reference in New Issue
Block a user