Skip to content

Commit fd188fa

Browse files
authored
keyboard : Update stubtest_allowlist and add comments for missing defaults (#9965)
1 parent f39ffea commit fd188fa

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# scan_code *should* never be None in real use. This is also according to docs.
22
keyboard.KeyboardEvent.scan_code
33
keyboard._keyboard_event.KeyboardEvent.scan_code
4-
# Defaults don't align with possible values
5-
keyboard.mouse.wait
64
# TODO: Should this be allowlisted?
75
keyboard.__main__
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Defaults don't align with possible values
22
keyboard.mouse.on_button
3+
keyboard.mouse.wait
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Defaults don't align with possible values
22
keyboard.mouse.on_button
3+
keyboard.mouse.wait

stubs/keyboard/keyboard/mouse.pyi

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,20 @@ def drag(start_x: int, start_y: int, end_x: int, end_y: int, absolute: bool = Tr
4747
def on_button(
4848
callback: Callable[..., None],
4949
args: _Ts = (),
50+
# Omitting default: Darwin has no x and x2
5051
buttons: list[_MouseButton] | tuple[_MouseButton, ...] | _MouseButton = ...,
52+
# Omitting default: Darwin and Linux don't have "double", yet the defaults includes it
5153
types: list[_MouseEventType] | tuple[_MouseEventType, ...] | _MouseEventType = ...,
5254
) -> _Callback: ...
5355
def on_click(callback: Callable[..., None], args: _Ts = ()) -> _Callback: ...
5456
def on_double_click(callback: Callable[..., None], args: _Ts = ()) -> _Callback: ...
5557
def on_right_click(callback: Callable[..., None], args: _Ts = ()) -> _Callback: ...
5658
def on_middle_click(callback: Callable[..., None], args: _Ts = ()) -> _Callback: ...
57-
def wait(button: _MouseButton = "left", target_types: tuple[_MouseEventType] = ...) -> None: ...
59+
def wait(
60+
button: _MouseButton = "left",
61+
# Omitting default: Darwin and Linux don't have "double", yet the defaults includes it
62+
target_types: tuple[_MouseEventType, ...] = ...,
63+
) -> None: ...
5864

5965
if sys.platform == "win32":
6066
def get_position() -> tuple[c_long, c_long]: ...

0 commit comments

Comments
 (0)