2 @c This is part of the SXEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
4 @c Copyright (C) 2005 Sebastian Freundt <hroptatyr@sxemacs.org>
5 @c See the file lispref.texi for copying conditions.
6 @setfilename ../../info/mouse.info
12 * Mouse Position:: Asking where the mouse is, or moving it.
14 @ignore @c Not in SXEmacs.
16 @section Mouse Tracking
17 @cindex mouse tracking
18 @cindex tracking the mouse
24 @c These are not implemented yet.
26 These functions change the screen appearance instantaneously. The
27 effect is transient, only until the next ordinary SXEmacs redisplay. That
28 is ok for mouse tracking, since it doesn't make sense for mouse tracking
29 to change the text, and the body of @code{track-mouse} normally reads
30 the events itself and does not do redisplay.
32 @defun x-contour-region window start end
33 This function draws lines to make a box around the text from @var{start}
34 to @var{end}, in window @var{window}.
37 @defun x-uncontour-region window start end
38 This function erases the lines that would make a box around the text
39 from @var{start} to @var{end}, in window @var{window}. Use it to remove
40 a contour that you previously made by calling @code{x-contour-region}.
43 @defun x-draw-rectangle frame left top right bottom
44 This function draws a hollow rectangle on frame @var{frame} with the
45 specified edge coordinates, all measured in pixels from the inside top
46 left corner. It uses the cursor color, the one used for indicating the
50 @defun x-erase-rectangle frame left top right bottom
51 This function erases a hollow rectangle on frame @var{frame} with the
52 specified edge coordinates, all measured in pixels from the inside top
53 left corner. Erasure means redrawing the text and background that
54 normally belong in the specified rectangle.
60 @section Mouse Position
61 @cindex mouse position
62 @cindex position of mouse
64 The functions @code{mouse-position}, @code{mouse-pixel-position},
65 @code{set-mouse-position} and @code{set-mouse-pixel-position} give
66 access to the current position of the mouse.
68 @defun mouse-position &optional device
69 This function returns a list (@var{window} @var{x} . @var{y}) giving the
70 current mouse window and position. The position is given in character
71 cells, where @samp{(0, 0)} is the upper-left corner.
73 @var{device} specifies the device on which to read the mouse position,
74 and defaults to the selected device. If the device is a mouseless
75 terminal or SXEmacs hasn't been programmed to read its mouse position, it
76 returns the device's selected window for @var{window} and @code{nil} for
80 @defun mouse-pixel-position &optional device
81 This function returns a list (@var{window} @var{x} . @var{y}) giving the
82 current mouse window and position. The position is given in pixel
83 units, where @samp{(0, 0)} is the upper-left corner.
85 @var{device} specifies the device on which to read the mouse position,
86 and defaults to the selected device. If the device is a mouseless
87 terminal or SXEmacs hasn't been programmed to read its mouse position, it
88 returns the device's selected window for @var{window} and @code{nil} for
92 @defun set-mouse-position window x y
93 This function @dfn{warps the mouse} to the center of character position
94 @var{x}, @var{y} in frame @var{window}. The arguments @var{x} and
95 @var{y} are integers, giving the position in characters relative to
96 the top left corner of @var{window}.
98 @cindex warping the mouse
100 Warping the mouse means changing the screen position of the mouse as if
101 the user had moved the physical mouse---thus simulating the effect of
105 @defun set-mouse-pixel-position window x y
106 This function @dfn{warps the mouse} to pixel position @var{x}, @var{y}
107 in frame @var{window}. The arguments @var{x} and @var{y} are integers,
108 giving the position in pixels relative to the top left corner of