keybinds 1.3.0__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {keybinds-1.3.0 → keybinds-1.3.2}/PKG-INFO +23 -13
  2. {keybinds-1.3.0 → keybinds-1.3.2}/README.md +18 -11
  3. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/__init__.py +1 -1
  4. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_backend.py +338 -323
  5. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_base_bind.py +13 -0
  6. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_keyboard.py +759 -724
  7. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_mouse.py +324 -292
  8. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/diagnostics/analysis.py +844 -816
  9. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/diagnostics/core.py +1 -0
  10. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/diagnostics/tracing.py +1 -0
  11. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/logical/abbreviation.py +7 -0
  12. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/logical/keyboard.py +62 -4
  13. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/presets.py +41 -0
  14. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/simple.py +264 -238
  15. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/types.py +2 -0
  16. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds.egg-info/PKG-INFO +23 -13
  17. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds.egg-info/SOURCES.txt +10 -1
  18. keybinds-1.3.2/keybinds.egg-info/requires.txt +11 -0
  19. {keybinds-1.3.0 → keybinds-1.3.2}/pyproject.toml +8 -2
  20. keybinds-1.3.2/tests/test_bind_registry.py +50 -0
  21. keybinds-1.3.2/tests/test_bind_wait_and_is_pressed.py +113 -0
  22. keybinds-1.3.2/tests/test_decorators_and_simple.py +101 -0
  23. keybinds-1.3.2/tests/test_diagnostics.py +84 -0
  24. keybinds-1.3.2/tests/test_logical_parsing.py +42 -0
  25. keybinds-1.3.2/tests/test_parsing.py +29 -0
  26. keybinds-1.3.2/tests/test_runtime_bindings.py +377 -0
  27. keybinds-1.3.2/tests/test_runtime_edge_cases.py +472 -0
  28. keybinds-1.3.2/tests/test_types.py +65 -0
  29. keybinds-1.3.0/keybinds.egg-info/requires.txt +0 -3
  30. {keybinds-1.3.0 → keybinds-1.3.2}/LICENSE +0 -0
  31. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_async.py +0 -0
  32. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_bind_registry.py +0 -0
  33. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_constants.py +0 -0
  34. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_dispatcher.py +0 -0
  35. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_hook.py +0 -0
  36. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_parsing.py +0 -0
  37. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_state.py +0 -0
  38. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/_window.py +0 -0
  39. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/bind.py +0 -0
  40. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/decorators.py +0 -0
  41. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/diagnostics/__init__.py +0 -0
  42. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/diagnostics/models.py +0 -0
  43. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/diagnostics/reporting.py +0 -0
  44. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/logical/__init__.py +0 -0
  45. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/logical/parsing.py +0 -0
  46. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/logical/translate.py +0 -0
  47. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/winput/LICENSE +0 -0
  48. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/winput/__init__.py +0 -0
  49. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/winput/vk_codes.py +0 -0
  50. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds/winput/winput.py +0 -0
  51. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds.egg-info/dependency_links.txt +0 -0
  52. {keybinds-1.3.0 → keybinds-1.3.2}/keybinds.egg-info/top_level.txt +0 -0
  53. {keybinds-1.3.0 → keybinds-1.3.2}/setup.cfg +0 -0
  54. {keybinds-1.3.0 → keybinds-1.3.2}/setup.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keybinds
3
- Version: 1.3.0
4
- Summary: Flexible and high-performance global keyboard & mouse hotkeys for Windows
3
+ Version: 1.3.2
4
+ Summary: Flexible global keyboard & mouse hotkeys for Windows
5
5
  Author: echolane
6
6
  License: MIT License
7
7
 
@@ -43,11 +43,14 @@ Requires-Python: >=3.7
43
43
  Description-Content-Type: text/markdown
44
44
  License-File: LICENSE
45
45
  Requires-Dist: typing_extensions>=4.0; python_version < "3.8"
46
+ Provides-Extra: test
47
+ Requires-Dist: pytest<8,>=7.4; python_version < "3.8" and extra == "test"
48
+ Requires-Dist: pytest<9,>=8; python_version >= "3.8" and extra == "test"
46
49
  Dynamic: license-file
47
50
 
48
51
  # keybinds
49
52
 
50
- Flexible and high-performance global keyboard & mouse hotkeys for Windows.
53
+ Flexible global keyboard & mouse hotkeys for Windows.
51
54
 
52
55
  ![Python](https://img.shields.io/badge/python-3.7%2B-blue)
53
56
  ![Platform](https://img.shields.io/badge/platform-windows-lightgrey)
@@ -189,6 +192,23 @@ Top-level helpers use the default hook. If you use multiple hooks, prefer `hook.
189
192
 
190
193
  ---
191
194
 
195
+ ## Bind state and waiting
196
+
197
+ All bind objects expose two small runtime helpers:
198
+
199
+ ```python
200
+ if bind.is_pressed():
201
+ print("bind is currently active")
202
+
203
+ bind.wait() # wait until the bind fires
204
+ bind.wait(0.5) # wait up to 0.5s, returns True/False
205
+ ```
206
+
207
+ `is_pressed()` checks whether the bind is currently pressed.
208
+ `wait(timeout=None)` blocks until the bind fires and returns `True`, or returns `False` on timeout.
209
+
210
+ ---
211
+
192
212
  ## Keyboard Basics
193
213
 
194
214
  ### Press (default)
@@ -453,16 +473,6 @@ Supports common patterns with simple flags:
453
473
 
454
474
  Logical binds, typed-text matching, and abbreviations are currently **experimental**. The API and behavior may still change in future releases.
455
475
 
456
- ## Performance
457
-
458
- Measured using `examples/benchmark.py` on one test system and Python build. These numbers are intended as a rough reference, not a universal baseline.
459
-
460
- - p50 ≈ 0.3 ms
461
- - p99 ≈ 0.5 ms
462
- - max < 1 ms (rare spikes up to 3–5 ms)
463
-
464
- Latency includes hook dispatch and callback scheduling (no heavy user code).
465
-
466
476
  ## Suppression limitations
467
477
 
468
478
  On Windows, suppression depends on low-level hook order. See [Advanced Usage — Hook chain limitations and `reinstall_hooks()`](Advanced%20Usage.md#41-hook-chain-limitations-and-reinstall_hooks).
@@ -1,6 +1,6 @@
1
1
  # keybinds
2
2
 
3
- Flexible and high-performance global keyboard & mouse hotkeys for Windows.
3
+ Flexible global keyboard & mouse hotkeys for Windows.
4
4
 
5
5
  ![Python](https://img.shields.io/badge/python-3.7%2B-blue)
6
6
  ![Platform](https://img.shields.io/badge/platform-windows-lightgrey)
@@ -142,6 +142,23 @@ Top-level helpers use the default hook. If you use multiple hooks, prefer `hook.
142
142
 
143
143
  ---
144
144
 
145
+ ## Bind state and waiting
146
+
147
+ All bind objects expose two small runtime helpers:
148
+
149
+ ```python
150
+ if bind.is_pressed():
151
+ print("bind is currently active")
152
+
153
+ bind.wait() # wait until the bind fires
154
+ bind.wait(0.5) # wait up to 0.5s, returns True/False
155
+ ```
156
+
157
+ `is_pressed()` checks whether the bind is currently pressed.
158
+ `wait(timeout=None)` blocks until the bind fires and returns `True`, or returns `False` on timeout.
159
+
160
+ ---
161
+
145
162
  ## Keyboard Basics
146
163
 
147
164
  ### Press (default)
@@ -406,16 +423,6 @@ Supports common patterns with simple flags:
406
423
 
407
424
  Logical binds, typed-text matching, and abbreviations are currently **experimental**. The API and behavior may still change in future releases.
408
425
 
409
- ## Performance
410
-
411
- Measured using `examples/benchmark.py` on one test system and Python build. These numbers are intended as a rough reference, not a universal baseline.
412
-
413
- - p50 ≈ 0.3 ms
414
- - p99 ≈ 0.5 ms
415
- - max < 1 ms (rare spikes up to 3–5 ms)
416
-
417
- Latency includes hook dispatch and callback scheduling (no heavy user code).
418
-
419
426
  ## Suppression limitations
420
427
 
421
428
  On Windows, suppression depends on low-level hook order. See [Advanced Usage — Hook chain limitations and `reinstall_hooks()`](Advanced%20Usage.md#41-hook-chain-limitations-and-reinstall_hooks).
@@ -36,7 +36,7 @@ from ._backend import reinstall_hooks, rehook
36
36
 
37
37
  from ._constants import register_key_token
38
38
 
39
- __version__ = "1.3.0"
39
+ __version__ = "1.3.2"
40
40
 
41
41
  __all__ = [
42
42
  "Trigger","SuppressPolicy","ChordPolicy","OrderPolicy","FocusPolicy","InjectedPolicy","TextBoundaryPolicy","TextBackspacePolicy","OsKeyRepeatPolicy","ReplacementPolicy",