Guest User

Untitled

a guest
Aug 3rd, 2026
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. 1. Fixed the Boundary Math in inZone()
  2. Original: The original formula calculated the right and bottom boundaries as zoneLeft + zoneRight and zoneTop + zoneBottom.
  3. New: Updated to directly compare against zoneRight and zoneBottom (mx < this.zoneRight and my < this.zoneBottom).
  4. Why: Since you passed absolute coordinates (1374, 3240, 3294, 4320) into tc.setZone(), adding them together inflated the touchscreen's virtual boundary into non-existent screen space, causing improper detection.
  5.  
  6. 2. Added a Windows Low-Level Mouse Hook (SetWindowsHookEx)
  7. New: Added this.hook := DllCall("SetWindowsHookEx", ...) in __New() using hook ID 14 (WH_MOUSE_LL).
  8. Why: This tells Windows to report raw mouse and input event metadata directly to the script before processing them, giving the script visibility into what created the input event.
  9.  
  10. 3. Hardware Touch Signature Detection (MouseHook)
  11. New: Created the MouseHook() method to inspect the dwExtraInfo and flags memory pointers of every cursor movement.
  12. Why: When you touch a screen, Windows appends a specific signature (0xFF510000 / 0x00FF5100) to the cursor event. Physical mice do not send this signature. When a touch signature is detected, the script sets an internal flag (this.isTouch := true).
  13.  
  14. 4. Smart Movement Logic in update()
  15. Original: Triggered a snap-back strictly based on whether the cursor jumped across a distance greater than jumpThreshold (200 pixels).
  16. New: Replaced the condition with (this.isTouch or this.distance(...) > 1500) and added this.isTouch := false at the end of each cycle.
  17. Why:
  18. If isTouch is true, it snaps the pointer back instantly regardless of speed.
  19. If isTouch is false (meaning you moved your physical mouse), it ignores normal distance jumps, allowing your mouse to traverse across the Y-axis gap into your touchscreen freely.
  20. The distance threshold fallback was raised to 1500 to prevent screen-crossing leaps from falsely triggering as touch events.
Advertisement
Add Comment
Please, Sign In to add comment