Function: event-start
event-start is a byte-compiled function defined in subr.el.gz.
Signature
(event-start EVENT)
Documentation
Return the starting position of EVENT.
EVENT should be a mouse click, drag, touch screen, or key press
event. If EVENT is nil, the value of posn-at-point is used
instead.
The following accessor functions are used to access the elements of the position:
posn-window: The window of the event end, or its frame if the
event end point belongs to no window.
posn-area: A symbol identifying the area the event occurred in,
or nil if the event occurred in the text area.
posn-point: The buffer position of the event.
posn-x-y: The pixel-based coordinates of the event.
posn-col-row: The estimated column and row corresponding to the
position of the event.
posn-actual-col-row: The actual column and row corresponding to the
position of the event.
posn-string: The string object of the event, which is either
nil or (STRING . POSITION)'.
posn-image: The image object of the event, if any.
posn-object: The image or string object of the event, if any.
posn-timestamp: The time the event occurred, in milliseconds.
For more information, see Info node (elisp)Click Events.
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun event-start (event)
"Return the starting position of EVENT.
EVENT should be a mouse click, drag, touch screen, or key press
event. If EVENT is nil, the value of `posn-at-point' is used
instead.
The following accessor functions are used to access the elements
of the position:
`posn-window': The window of the event end, or its frame if the
event end point belongs to no window.
`posn-area': A symbol identifying the area the event occurred in,
or nil if the event occurred in the text area.
`posn-point': The buffer position of the event.
`posn-x-y': The pixel-based coordinates of the event.
`posn-col-row': The estimated column and row corresponding to the
position of the event.
`posn-actual-col-row': The actual column and row corresponding to the
position of the event.
`posn-string': The string object of the event, which is either
nil or (STRING . POSITION)'.
`posn-image': The image object of the event, if any.
`posn-object': The image or string object of the event, if any.
`posn-timestamp': The time the event occurred, in milliseconds.
For more information, see Info node `(elisp)Click Events'."
(declare (side-effect-free t))
(if (and (consp event)
(or (eq (car event) 'touchscreen-begin)
(eq (car event) 'touchscreen-end)))
;; Touch screen begin and end events save their information in a
;; different format, where the mouse position list is the cdr of
;; (nth 1 event).
(cdadr event)
(or (and (consp event)
;; Ignore touchscreen update events. They store the posn
;; in a different format, and can have multiple posns.
(not (eq (car event) 'touchscreen-update))
(nth 1 event))
(event--posn-at-point))))