zhmiscellany 5.7.7__py3-none-any.whl → 5.7.9__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.
- zhmiscellany/_misc_supportfuncs.py +19 -10
- {zhmiscellany-5.7.7.dist-info → zhmiscellany-5.7.9.dist-info}/METADATA +1 -1
- {zhmiscellany-5.7.7.dist-info → zhmiscellany-5.7.9.dist-info}/RECORD +5 -5
- {zhmiscellany-5.7.7.dist-info → zhmiscellany-5.7.9.dist-info}/WHEEL +0 -0
- {zhmiscellany-5.7.7.dist-info → zhmiscellany-5.7.9.dist-info}/top_level.txt +0 -0
|
@@ -122,6 +122,7 @@ def get_actual_screen_resolution():
|
|
|
122
122
|
SCREEN_WIDTH, SCREEN_HEIGHT = get_actual_screen_resolution()
|
|
123
123
|
|
|
124
124
|
calibrated = False
|
|
125
|
+
calipass = False
|
|
125
126
|
|
|
126
127
|
def move_mouse(x: int, y: int, relative=False):
|
|
127
128
|
if not relative:
|
|
@@ -129,6 +130,7 @@ def move_mouse(x: int, y: int, relative=False):
|
|
|
129
130
|
normalized_x = int(x * (65535 / SCREEN_WIDTH))
|
|
130
131
|
normalized_y = int(y * (65535 / SCREEN_HEIGHT))
|
|
131
132
|
else:
|
|
133
|
+
calibrate()
|
|
132
134
|
if calibrated:
|
|
133
135
|
normalized_x = math.ceil(x * calibration_multiplier_x)
|
|
134
136
|
normalized_y = math.ceil(y * calibration_multiplier_y)
|
|
@@ -161,16 +163,23 @@ def get_mouse_xy():
|
|
|
161
163
|
x, y = win32api.GetCursorPos()
|
|
162
164
|
return x, y
|
|
163
165
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
166
|
+
def calibrate():
|
|
167
|
+
global calibration_multiplier_x, calibration_multiplier_y, calibrated, calipass
|
|
168
|
+
if calibrated:
|
|
169
|
+
return
|
|
170
|
+
if calipass:
|
|
171
|
+
return
|
|
172
|
+
calipass = True
|
|
173
|
+
# calibrate relative movement, required because windows is weird
|
|
174
|
+
original_mouse_point = get_mouse_xy()
|
|
175
|
+
calibration_distance = 128
|
|
176
|
+
move_mouse(0,0)
|
|
177
|
+
move_mouse(calibration_distance, calibration_distance, relative=True)
|
|
178
|
+
moved_pos = get_mouse_xy()
|
|
179
|
+
calibration_multiplier_x = calibration_distance/moved_pos[0]
|
|
180
|
+
calibration_multiplier_y = calibration_distance/moved_pos[1]
|
|
181
|
+
calibrated = True
|
|
182
|
+
move_mouse(original_mouse_point[0]+1, original_mouse_point[1]+1)
|
|
174
183
|
|
|
175
184
|
|
|
176
185
|
def mouse_down(button: int):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
zhmiscellany/__init__.py,sha256=Oh3gAJRWq2aUEgkolmQyiZOQ3iey5OC4NA2XaTHuVv4,1139
|
|
2
2
|
zhmiscellany/_discord_supportfuncs.py,sha256=RotSpurqFtL5q6v_ST1e2Y_1qJMaHp1CDsF5i-gR4ec,6524
|
|
3
3
|
zhmiscellany/_fileio_supportfuncs.py,sha256=OIboEBVahqbpG1wbtrhAjoFV-oPylFVmOENOByawaX0,365
|
|
4
|
-
zhmiscellany/_misc_supportfuncs.py,sha256=
|
|
4
|
+
zhmiscellany/_misc_supportfuncs.py,sha256=y5hlFjenJTrEPjR9VH0F7X9JhUWSV-Gx-fahNzyMMU8,7003
|
|
5
5
|
zhmiscellany/_processing_supportfuncs.py,sha256=aZKWIfJW_lVaQs_EyGGBhmoMc6btA38X2hY6A3kTxN8,10341
|
|
6
6
|
zhmiscellany/_py_resources.py,sha256=HqJs5aRLymLZ2J5Io8g6bY58pGWhN9b8vCktC2DW4KQ,229009
|
|
7
7
|
zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWHt4xrOG5l0,856
|
|
@@ -21,7 +21,7 @@ zhmiscellany/pipes.py,sha256=PxO4aykFzC60xbTQuc66KzZYIxiW0KPebXZbncD2HcU,3795
|
|
|
21
21
|
zhmiscellany/processing.py,sha256=srwlV8FZ--svF5e6rZZxhIs_6ZjOAwq2OcQEf6T2Le8,10410
|
|
22
22
|
zhmiscellany/rust.py,sha256=znN6DYNoa_p-braTuDZKvUnXX8reWLFu_dG4fv2vLR0,442
|
|
23
23
|
zhmiscellany/string.py,sha256=xyqE6V5YF2nieZDcg5ZrXTIrH2D9oDRbZ5vQGz8rPys,4787
|
|
24
|
-
zhmiscellany-5.7.
|
|
25
|
-
zhmiscellany-5.7.
|
|
26
|
-
zhmiscellany-5.7.
|
|
27
|
-
zhmiscellany-5.7.
|
|
24
|
+
zhmiscellany-5.7.9.dist-info/METADATA,sha256=5q8pZMvjZlOT4GDo1msAM1FeUKxC9Q7YxY-xID2Hmwc,42153
|
|
25
|
+
zhmiscellany-5.7.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
26
|
+
zhmiscellany-5.7.9.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
|
|
27
|
+
zhmiscellany-5.7.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|