feat: enhance swipe and back navigation logic

- Adjusted configuration for reset after swipes to 10 seconds and added action to go back.
- Updated flow control to skip back action if a recent reset was triggered within 5 seconds.
- Implemented a mechanism to enable back navigation when consecutive misses reach a threshold.
- Added GUI options to enable or disable back navigation on misses, ensuring consistency with user settings.
- Introduced new diagnostic tools for runtime flag checks and screenshot diagnostics.
- Created PowerShell scripts for restoring Start Menu shortcuts and performing system health checks.
- Added tests for swipe operations and back navigation to validate new logic.
This commit is contained in:
Your Name committed 2026-01-06 16:55:00 +08:00
1 parent 0c3a763d63
commit dcded08796
19 files changed
+936 -22

No files matched your search

+31 -11
View File
@@ -199,20 +199,40 @@ def find_and_open_fudai_detail(
enabled = True
if enabled:
# 若最近已有由滑动重置触发的回退,且在短时间内,跳过本次返回键调用以避免重复
try:
analyser.operation.click_back(analyser.device_id)
import time as _time
recent_ts = getattr(analyser, "_recent_reset_ts", 0)
if recent_ts and (_time.time() - float(recent_ts) < 5.0):
try:
analyser._log_kv(
"流程",
"检测到近期已由滑动重置触发回退,跳过重复按返回键",
)
except Exception:
pass
else:
try:
analyser.operation.click_back(analyser.device_id)
except Exception:
try:
# 兜底:使用通用 click 返回坐标
rx = int(
getattr(analyser, "resolution_ratio_x", 1080) or 1080
)
ry = int(
getattr(analyser, "resolution_ratio_y", 2400) or 2400
)
back_x = int(50 * rx / 1080)
back_y = int(50 * ry / 2400)
analyser.operation.click(analyser.device_id, back_x, back_y)
except Exception:
pass
except Exception:
# 在异常情况下保守地尝试按返回键
try:
# 兜底:使用通用 click 返回坐标
rx = int(
getattr(analyser, "resolution_ratio_x", 1080) or 1080
)
ry = int(
getattr(analyser, "resolution_ratio_y", 2400) or 2400
)
back_x = int(50 * rx / 1080)
back_y = int(50 * ry / 2400)
analyser.operation.click(analyser.device_id, back_x, back_y)
analyser.operation.click_back(analyser.device_id)
except Exception:
pass
else: