makcu 0.2.0__py3-none-any.whl → 2.1.1__py3-none-any.whl
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.
- makcu/__init__.py +0 -18
- makcu/__main__.py +13 -29
- makcu/conftest.py +0 -2
- makcu/connection.py +57 -83
- makcu/controller.py +27 -71
- makcu/errors.py +0 -5
- makcu/makcu.pyi +1 -3
- makcu/mouse.py +21 -41
- makcu/test_suite.py +8 -22
- {makcu-0.2.0.dist-info → makcu-2.1.1.dist-info}/METADATA +10 -10
- makcu-2.1.1.dist-info/RECORD +16 -0
- makcu-0.2.0.dist-info/RECORD +0 -16
- {makcu-0.2.0.dist-info → makcu-2.1.1.dist-info}/WHEEL +0 -0
- {makcu-0.2.0.dist-info → makcu-2.1.1.dist-info}/licenses/LICENSE +0 -0
- {makcu-0.2.0.dist-info → makcu-2.1.1.dist-info}/top_level.txt +0 -0
makcu/test_suite.py
CHANGED
@@ -2,34 +2,29 @@ import pytest
|
|
2
2
|
import time
|
3
3
|
from makcu import MouseButton
|
4
4
|
|
5
|
-
|
5
|
+
|
6
6
|
TEST_BUTTONS = (MouseButton.LEFT, MouseButton.RIGHT, MouseButton.MIDDLE)
|
7
7
|
BUTTON_STATE_KEYS = ('left', 'right', 'middle', 'mouse4', 'mouse5')
|
8
8
|
MOVE_COORDS = ((10, 0), (0, 10), (-10, 0), (0, -10))
|
9
9
|
|
10
10
|
def test_connect_to_port(makcu):
|
11
|
-
"""Test connection - already connected via fixture"""
|
12
11
|
print("Connecting to port...")
|
13
12
|
makcu.connect()
|
14
13
|
assert makcu.is_connected(), "Failed to connect to the makcu"
|
15
14
|
|
16
15
|
def test_press_and_release(makcu):
|
17
|
-
"""Test basic press/release - minimal overhead"""
|
18
16
|
makcu.press(MouseButton.LEFT)
|
19
17
|
makcu.release(MouseButton.LEFT)
|
20
18
|
|
21
19
|
def test_firmware_version(makcu):
|
22
|
-
"""Test firmware version retrieval"""
|
23
20
|
version = makcu.mouse.get_firmware_version()
|
24
21
|
assert version and len(version.strip()) > 0
|
25
22
|
|
26
23
|
def test_middle_click(makcu):
|
27
|
-
"""Test middle button - direct operations"""
|
28
24
|
makcu.press(MouseButton.MIDDLE)
|
29
25
|
makcu.release(MouseButton.MIDDLE)
|
30
26
|
|
31
27
|
def test_device_info(makcu):
|
32
|
-
"""Test device info - optimized checks"""
|
33
28
|
print("Fetching device info...")
|
34
29
|
info = makcu.mouse.get_device_info()
|
35
30
|
print(f"Device Info: {info}")
|
@@ -37,25 +32,21 @@ def test_device_info(makcu):
|
|
37
32
|
assert info.get("isConnected") is True
|
38
33
|
|
39
34
|
def test_port_connection(makcu):
|
40
|
-
"""Test connection state - cached check"""
|
41
35
|
assert makcu.is_connected()
|
42
36
|
|
43
37
|
def test_button_mask(makcu):
|
44
|
-
"""Test button mask - direct integer check"""
|
45
38
|
print("Getting button mask...")
|
46
39
|
mask = makcu.get_button_mask()
|
47
40
|
print(f"Mask value: {mask}")
|
48
41
|
assert isinstance(mask, int)
|
49
42
|
|
50
43
|
def test_get_button_states(makcu):
|
51
|
-
"""Test button states - optimized validation"""
|
52
44
|
states = makcu.get_button_states()
|
53
45
|
assert isinstance(states, dict)
|
54
46
|
for key in BUTTON_STATE_KEYS:
|
55
47
|
assert key in states
|
56
48
|
|
57
49
|
def test_lock_state(makcu):
|
58
|
-
"""Test lock functionality - minimal operations"""
|
59
50
|
print("Locking LEFT button...")
|
60
51
|
makcu.lock_left(True)
|
61
52
|
print("Querying lock state while LEFT is locked...")
|
@@ -64,18 +55,16 @@ def test_lock_state(makcu):
|
|
64
55
|
assert state
|
65
56
|
|
66
57
|
def test_makcu_behavior(makcu):
|
67
|
-
"""Test basic behavior - batched operations"""
|
68
58
|
makcu.move(25, 25)
|
69
59
|
makcu.click(MouseButton.LEFT)
|
70
60
|
makcu.scroll(-2)
|
71
61
|
|
72
62
|
def test_batch_commands(makcu):
|
73
|
-
"""Test batch execution performance"""
|
74
63
|
print("Testing batch command execution (10 commands)...")
|
75
64
|
|
76
65
|
start_time = time.perf_counter()
|
77
66
|
|
78
|
-
|
67
|
+
|
79
68
|
makcu.move(10, 0)
|
80
69
|
makcu.click(MouseButton.LEFT)
|
81
70
|
makcu.move(0, 10)
|
@@ -93,10 +82,10 @@ def test_batch_commands(makcu):
|
|
93
82
|
print(f"Batch execution time: {elapsed_ms:.2f}ms")
|
94
83
|
print(f"Average per command: {elapsed_ms/10:.2f}ms")
|
95
84
|
|
96
|
-
|
85
|
+
|
97
86
|
assert elapsed_ms < 50, f"Batch commands took {elapsed_ms:.2f}ms, expected < 50ms"
|
98
87
|
|
99
|
-
|
88
|
+
|
100
89
|
start_time = time.perf_counter()
|
101
90
|
for _ in range(10):
|
102
91
|
makcu.move(5, 5)
|
@@ -106,10 +95,9 @@ def test_batch_commands(makcu):
|
|
106
95
|
print(f"10 move commands: {move_only_ms:.2f}ms ({move_only_ms/10:.2f}ms per move)")
|
107
96
|
|
108
97
|
def test_rapid_moves(makcu):
|
109
|
-
"""Test rapid movement commands"""
|
110
98
|
start = time.perf_counter_ns()
|
111
99
|
|
112
|
-
|
100
|
+
|
113
101
|
makcu.move(5, 5)
|
114
102
|
makcu.move(5, 5)
|
115
103
|
makcu.move(5, 5)
|
@@ -126,10 +114,9 @@ def test_rapid_moves(makcu):
|
|
126
114
|
assert elapsed_ms < 30
|
127
115
|
|
128
116
|
def test_button_performance(makcu):
|
129
|
-
"""Test button operation performance"""
|
130
117
|
start = time.perf_counter_ns()
|
131
118
|
|
132
|
-
|
119
|
+
|
133
120
|
for button in TEST_BUTTONS:
|
134
121
|
makcu.press(button)
|
135
122
|
makcu.release(button)
|
@@ -139,10 +126,9 @@ def test_button_performance(makcu):
|
|
139
126
|
assert elapsed_ms < 20
|
140
127
|
|
141
128
|
def test_mixed_operations(makcu):
|
142
|
-
"""Test mixed operation performance"""
|
143
129
|
start = time.perf_counter_ns()
|
144
130
|
|
145
|
-
|
131
|
+
|
146
132
|
makcu.move(20, 20)
|
147
133
|
makcu.press(MouseButton.LEFT)
|
148
134
|
makcu.move(-20, -20)
|
@@ -153,7 +139,7 @@ def test_mixed_operations(makcu):
|
|
153
139
|
print(f"Mixed operations: {elapsed_ms:.2f}ms")
|
154
140
|
assert elapsed_ms < 15
|
155
141
|
|
156
|
-
|
142
|
+
|
157
143
|
@pytest.mark.skip(reason="Capture test disabled until firmware supports tracking clicks from software input")
|
158
144
|
def test_capture_right_clicks(makcu):
|
159
145
|
pass
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: makcu
|
3
|
-
Version:
|
3
|
+
Version: 2.1.1
|
4
4
|
Summary: Python library for Makcu hardware device control
|
5
5
|
Author: SleepyTotem
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -708,7 +708,7 @@ Requires-Dist: build>=0.10; extra == "dev"
|
|
708
708
|
Requires-Dist: twine>=4.0; extra == "dev"
|
709
709
|
Dynamic: license-file
|
710
710
|
|
711
|
-
# 🖱️ Makcu Python Library v2.
|
711
|
+
# 🖱️ Makcu Python Library v2.1.1
|
712
712
|
|
713
713
|
[](https://pypi.org/project/makcu/)
|
714
714
|
[](https://pypi.org/project/makcu/)
|
@@ -716,15 +716,15 @@ Dynamic: license-file
|
|
716
716
|
|
717
717
|
Makcu Py Lib is a high-performance Python library for controlling Makcu devices — now with **async/await support**, **zero-delay command execution**, and **automatic reconnection**!
|
718
718
|
|
719
|
-
##
|
719
|
+
## What's New in v2.0
|
720
720
|
|
721
|
-
-
|
722
|
-
-
|
723
|
-
-
|
724
|
-
-
|
725
|
-
-
|
726
|
-
-
|
727
|
-
-
|
721
|
+
- **Async/Await Support**: Full async API for modern Python applications
|
722
|
+
- **Zero-Delay Commands**: Removed all `sleep()` calls with proper command tracking
|
723
|
+
- **Auto-Reconnection**: Automatic device reconnection on disconnect
|
724
|
+
- **Parallel Operations**: Execute multiple commands simultaneously
|
725
|
+
- **Enhanced Debugging**: Better logging and error tracking
|
726
|
+
- **Gaming-Optimized**: Sub-3ms command execution for 240Hz+ gaming
|
727
|
+
- **Ultra-Fast Performance**: 10-50x faster than >=v1.4
|
728
728
|
|
729
729
|
---
|
730
730
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
makcu/__init__.py,sha256=HyjxvhE5feNyh4ZMY5U0U_X-7BzltSh_gOsX_o5mSLA,1745
|
2
|
+
makcu/__main__.py,sha256=PfkhdKvYmtN6qb2O-EJryJYvtfP0xJfEA-zKrKw3Pmw,11091
|
3
|
+
makcu/conftest.py,sha256=-zO-_vi6pB4HxcmrIM0sKlnNWsU8c9ViwmuSmvri9vk,850
|
4
|
+
makcu/connection.py,sha256=OT3cB7T8eJT4boCqajdPQtlTEMy-W9n9dqIIIVbL3Xc,15135
|
5
|
+
makcu/controller.py,sha256=csQMJ97zSv-i6sI8EHkqosFByS859B-hg2unvjHPKcA,13059
|
6
|
+
makcu/enums.py,sha256=VmvCLmpghVHuTAkvCGMfA14MgWTtFVMfsGQQNnJ58Ts,126
|
7
|
+
makcu/errors.py,sha256=X_eWPKkVgcyryT6-_7jjVkcHKtrAZAsarbfMRpIcz58,242
|
8
|
+
makcu/makcu.pyi,sha256=tSmJ3zs6zFClZll5DcWd17ZQr9nvDDJqhKXDR1hr7dk,247
|
9
|
+
makcu/mouse.py,sha256=CzUI3vr_IrvYuEfGzDWgtm6wSUl9kYimvmHaR2azuL0,8406
|
10
|
+
makcu/py.typed,sha256=lI_IPBO6A6a5eY5kRQDNsdSydUb3sFWtcC_ML8FNftU,111
|
11
|
+
makcu/test_suite.py,sha256=7Rsq5sKeR4zvCMTNZDv6TCYMKs7B3EVTuwyIDgHfdk8,4092
|
12
|
+
makcu-2.1.1.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
13
|
+
makcu-2.1.1.dist-info/METADATA,sha256=bIODKunib4rTc_Xri-iJUggOfH7BeEg3jwa5tg28vTE,55121
|
14
|
+
makcu-2.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
+
makcu-2.1.1.dist-info/top_level.txt,sha256=IRO1UVb5LK_ovjau0g4oObyXQqy00tVEE-yF5lPgw1w,6
|
16
|
+
makcu-2.1.1.dist-info/RECORD,,
|
makcu-0.2.0.dist-info/RECORD
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
makcu/__init__.py,sha256=_uWl1sH4M9_NFKUPZAeq3A9np-6nZwSUOX_hJVv9Wck,2111
|
2
|
-
makcu/__main__.py,sha256=kJu5wuuMrHxTcESUEEGxuDHcd71RdRygDSoydxfW9ug,12063
|
3
|
-
makcu/conftest.py,sha256=OsGIlt593H8AzY5BhCHHW8BmjD1yc1z2wqvyZvFiUdk,936
|
4
|
-
makcu/connection.py,sha256=57VerGwpGZVhuLlAgs2HAHl1RHI9hGa8OBImv2GmDr8,18331
|
5
|
-
makcu/controller.py,sha256=LeRxbPT69_rrS7C8moNXKy9AdCGq0Le9exM2g-Y3jmU,15758
|
6
|
-
makcu/enums.py,sha256=VmvCLmpghVHuTAkvCGMfA14MgWTtFVMfsGQQNnJ58Ts,126
|
7
|
-
makcu/errors.py,sha256=4CkQ4gKa7GL5-BO3yOAJMMsy3QlUDDL42S1P1clqV4A,562
|
8
|
-
makcu/makcu.pyi,sha256=a8_vQ43MAqVxcASQiCHoYYG_LkfM5NEBAab5dgxcVK4,424
|
9
|
-
makcu/mouse.py,sha256=pdHU4oqfmD1OzQLBbcIvJt9U9fLVQMYUBJKip_N8vPw,10083
|
10
|
-
makcu/py.typed,sha256=lI_IPBO6A6a5eY5kRQDNsdSydUb3sFWtcC_ML8FNftU,111
|
11
|
-
makcu/test_suite.py,sha256=cUhmP3_wniANiV1B5xGu7n3WHaBj3zsQBxcOW5LPRtY,5105
|
12
|
-
makcu-0.2.0.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
13
|
-
makcu-0.2.0.dist-info/METADATA,sha256=msDAfKdpsWtJO-WqPxg87GZds2Rgjct7wE0AkI_2dQg,55161
|
14
|
-
makcu-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
-
makcu-0.2.0.dist-info/top_level.txt,sha256=IRO1UVb5LK_ovjau0g4oObyXQqy00tVEE-yF5lPgw1w,6
|
16
|
-
makcu-0.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|