Next: , Previous: , Up: Accessing Mouse Event Positions   [Contents][Index]


25.5.4.2 Window-Level Event Position Info

The following functions return window-level information about where a mouse event occurred.

Function: event-window event

Given a mouse motion, button press, button release, or misc-user event, compute and return the window on which that event occurred. This may be nil if the event occurred in the border or over a toolbar. The modeline is considered to be within the window it describes.

Function: event-buffer event

Given a mouse motion, button press, button release, or misc-user event, compute and return the buffer of the window on which that event occurred. This may be nil if the event occurred in the border or over a toolbar. The modeline is considered to be within the window it describes. This is equivalent to calling event-window and then calling window-buffer on the result if it is a window.

Function: event-window-x-pixel event

This function returns the X position in pixels of the given mouse event. The value returned is relative to the window the event occurred in. This will signal an error if the event is not a mouse-motion, button-press, button-release, or misc-user event.

Function: event-window-y-pixel event

This function returns the Y position in pixels of the given mouse event. The value returned is relative to the window the event occurred in. This will signal an error if the event is not a mouse-motion, button-press, button-release, or misc-user event.