Function: mouse-absolute-pixel-position

mouse-absolute-pixel-position is a byte-compiled function defined in frame.el.gz.

Signature

(mouse-absolute-pixel-position)

Documentation

Return absolute position of mouse cursor in pixels.

The position is returned as a cons cell (X . Y) of the coordinates of the mouse cursor position in pixels relative to a position (0, 0) of the selected frame's terminal.

Probably introduced at or before Emacs version 25.1.

Source Code

;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun mouse-absolute-pixel-position ()
  "Return absolute position of mouse cursor in pixels.
The position is returned as a cons cell (X . Y) of the
coordinates of the mouse cursor position in pixels relative to a
position (0, 0) of the selected frame's terminal."
  (let ((frame-type (framep-on-display)))
    (cond
     ((eq frame-type 'x)
      (x-mouse-absolute-pixel-position))
     ((eq frame-type 'w32)
      (w32-mouse-absolute-pixel-position))
     ((eq frame-type 'ns)
      (ns-mouse-absolute-pixel-position))
     (t
      (cons 0 0)))))