mouse_injection   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/win32.xtm

Implementation

(bind-func mouse_injection
  (lambda (x y down_or_up:i32)
    (let ((md (cond ((< down_or_up 0:i32) (bitwise-or MOUSEEVENTF_LEFTDOWN
                                                      MOUSEEVENTF_ABSOLUTE
                                                      MOUSEEVENTF_VIRTUALDESK))
                    ((> down_or_up 0:i32) (bitwise-or MOUSEEVENTF_LEFTUP
                                                      MOUSEEVENTF_ABSOLUTE
                                                      MOUSEEVENTF_VIRTUALDESK))
                    (else (bitwise-or MOUSEEVENTF_MOVE
                                      MOUSEEVENTF_ABSOLUTE
                                      MOUSEEVENTF_VIRTUALDESK)))))
      (mouse_event md
                   (ftoi32 (* 65536.0:f (/ x (i32tof (GetSystemMetrics SM_CXSCREEN)))))
                   (ftoi32 (* 65536.0:f (/ y (i32tof (GetSystemMetrics SM_CYSCREEN)))))
                   0 0))))


Back to Index

Similar Entries