[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to move the mouse cursor position

In article <UiFvl9m00iV503SqsO@andrew.cmu.edu> Michael Matessa <mm4b+@andrew.cmu.edu> writes:
   Does anyone know how to change the mouse cursor position using MCL?

Yup. Don't tell the interface police. warp-mouse takes a delta - how
far to move the mouse from where it its, rather than an absolute

(defparameter *mouse-global* (%int-to-ptr ccl::$mouse))
(defparameter *mouse-temp* (%int-to-ptr #x828))
(defparameter *mouse-raw* (%int-to-ptr ccl::$rawmouse))

(defun warp-mouse (delta)
  (%put-long *mouse-global* (add-points (%get-long *mouse-global*) delta))
  (%put-long *mouse-temp*  (%get-long *mouse-global*) )
  (%put-long *mouse-raw*  (%get-long *mouse-global*)))