zhmiscellany 5.8.2__py3-none-any.whl → 5.8.4__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/macro.py +10 -4
- {zhmiscellany-5.8.2.dist-info → zhmiscellany-5.8.4.dist-info}/METADATA +1 -1
- {zhmiscellany-5.8.2.dist-info → zhmiscellany-5.8.4.dist-info}/RECORD +5 -5
- {zhmiscellany-5.8.2.dist-info → zhmiscellany-5.8.4.dist-info}/WHEEL +0 -0
- {zhmiscellany-5.8.2.dist-info → zhmiscellany-5.8.4.dist-info}/top_level.txt +0 -0
zhmiscellany/macro.py
CHANGED
|
@@ -401,11 +401,10 @@ def record_actions_to_code(RECORD_MOUSE_MOVEMENT=False, STOP_KEY='f9'):
|
|
|
401
401
|
# If it's some other type of key object (less common)
|
|
402
402
|
return str(key)
|
|
403
403
|
|
|
404
|
-
def generate_code():
|
|
404
|
+
def generate_code(events, start_time):
|
|
405
405
|
"""
|
|
406
406
|
Generates the Python script from the recorded events and copies it to the clipboard.
|
|
407
407
|
"""
|
|
408
|
-
global events, start_time
|
|
409
408
|
|
|
410
409
|
if not events:
|
|
411
410
|
print("No actions were recorded.")
|
|
@@ -437,8 +436,12 @@ def record_actions_to_code(RECORD_MOUSE_MOVEMENT=False, STOP_KEY='f9'):
|
|
|
437
436
|
]
|
|
438
437
|
|
|
439
438
|
last_time = start_time
|
|
440
|
-
for event in events:
|
|
439
|
+
for i, event in enumerate(events):
|
|
441
440
|
current_time = event['time']
|
|
441
|
+
try:
|
|
442
|
+
next_event = events[i+1]
|
|
443
|
+
except:
|
|
444
|
+
next_event = None
|
|
442
445
|
delay = current_time - last_time
|
|
443
446
|
|
|
444
447
|
action = event['action']
|
|
@@ -466,6 +469,9 @@ def record_actions_to_code(RECORD_MOUSE_MOVEMENT=False, STOP_KEY='f9'):
|
|
|
466
469
|
if key in action_str:
|
|
467
470
|
action_str = value
|
|
468
471
|
break
|
|
472
|
+
|
|
473
|
+
if next_event and next_event['action'] == 'click' and (next_event['x'], next_event['y']) == (x, y):
|
|
474
|
+
action_str = ''
|
|
469
475
|
|
|
470
476
|
code_lines.append(f"m(({x}, {y}), {button_str}{action_str}click_duration=click_down_time, click_end_duration=click_release_time, pre_click_wiggle=pre_click_wiggle, animation_time=animation_time)")
|
|
471
477
|
|
|
@@ -566,7 +572,7 @@ def record_actions_to_code(RECORD_MOUSE_MOVEMENT=False, STOP_KEY='f9'):
|
|
|
566
572
|
mouse_listener.stop()
|
|
567
573
|
|
|
568
574
|
# Generate the replay script
|
|
569
|
-
return generate_code()
|
|
575
|
+
return generate_code(events, start_time)
|
|
570
576
|
|
|
571
577
|
|
|
572
578
|
KEY_CODES = {
|
|
@@ -12,7 +12,7 @@ zhmiscellany/fileio.py,sha256=KmRnWWZJWBc5Or3_mKcRY2ehE_Fuk870iS-imtyERyg,18169
|
|
|
12
12
|
zhmiscellany/gui.py,sha256=VgT5j5UIr-wWyL2P1qCHSNL7RrvZWDlm0TX00JGWmKo,7404
|
|
13
13
|
zhmiscellany/image.py,sha256=qUjxiYpc2VVZp2vwr1vN36O2PVQ7YlMKzhegQ1u4c0M,8198
|
|
14
14
|
zhmiscellany/list.py,sha256=S8Z85bLJEP9lk2JkGpzUcG6kpRB7a-NWDIHMPiF5bKo,1473
|
|
15
|
-
zhmiscellany/macro.py,sha256=
|
|
15
|
+
zhmiscellany/macro.py,sha256=2eJQ-pHzWepU6ISPd73BPlpKsGCbXA3_YmKhtatGiDM,25067
|
|
16
16
|
zhmiscellany/math.py,sha256=btOQTe_GvqP0A7Zz84tmN_c8j1NGe_mKnhmAt40lhLU,2482
|
|
17
17
|
zhmiscellany/misc.py,sha256=BsTbRWlXI5LZBG7Bl2MgLzHESyCMJnr_KNZAf2wY_H4,29689
|
|
18
18
|
zhmiscellany/netio.py,sha256=GTamo5cJn4P6u8V_kgZ9kL8qeMUE7OQAmYkmj9Sp_GA,2236
|
|
@@ -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.8.
|
|
25
|
-
zhmiscellany-5.8.
|
|
26
|
-
zhmiscellany-5.8.
|
|
27
|
-
zhmiscellany-5.8.
|
|
24
|
+
zhmiscellany-5.8.4.dist-info/METADATA,sha256=jw6GB_T-q2shmVwmfHZu7Q7IYRfOT7iawiKCs93A28w,42153
|
|
25
|
+
zhmiscellany-5.8.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
26
|
+
zhmiscellany-5.8.4.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
|
|
27
|
+
zhmiscellany-5.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|