-
-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathmouse_hook_contract.py
More file actions
42 lines (37 loc) · 1.34 KB
/
Copy pathmouse_hook_contract.py
File metadata and controls
42 lines (37 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
Structural contract exposed by platform mouse hook implementations.
"""
from typing import Any, Callable, Protocol, runtime_checkable
from core.mouse_hook_types import HidRuntimeState
@runtime_checkable
class MouseHookLike(Protocol):
debug_mode: bool
invert_vscroll: bool
invert_hscroll: bool
divert_mode_shift: bool
divert_dpi_switch: bool
_hid_gesture: Any
def register(self, event_type: str, callback: Callable[[Any], None]) -> None: ...
def block(self, event_type: str) -> None: ...
def unblock(self, event_type: str) -> None: ...
def reset_bindings(self) -> None: ...
def configure_gestures(
self,
enabled: bool = False,
threshold: int = 50,
deadzone: int = 40,
timeout_ms: int = 3000,
cooldown_ms: int = 500,
) -> None: ...
def set_connection_change_callback(self, cb: Callable[[bool], None]) -> None: ...
def set_debug_callback(self, callback: Callable[[str], None]) -> None: ...
def set_gesture_callback(self, callback: Callable[[Any], None]) -> None: ...
@property
def device_connected(self) -> bool: ...
@property
def connected_device(self) -> Any: ...
@property
def hid_runtime_state(self) -> HidRuntimeState: ...
def dump_device_info(self) -> Any: ...
def start(self) -> bool: ...
def stop(self) -> None: ...