All of SXEmacs' http URLs are now https. WooHoo!
[sxemacs] / info / lispref / mouse.texi
1 @c -*-texinfo-*-
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
7
8 @node Mouse
9 @chapter The Mouse
10 @cindex mouse
11
12 * Mouse Position::              Asking where the mouse is, or moving it.
13
14 @ignore  @c Not in SXEmacs.
15 @node Mouse Tracking
16 @section Mouse Tracking
17 @cindex mouse tracking
18 @cindex tracking the mouse
19
20 (deleted)
21 @end ignore
22
23 @ignore
24 @c These are not implemented yet.
25
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.
31
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}.
35 @end defun
36
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}.
41 @end defun
42
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
47 location of point.
48 @end defun
49
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.
55 @end defun
56 @end ignore
57
58
59 @node Mouse Position
60 @section Mouse Position
61 @cindex mouse position
62 @cindex position of mouse
63
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.
67
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.
72
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
77 @var{x} and @var{y}.
78 @end defun
79
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.
84
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
89 @var{x} and @var{y}.
90 @end defun
91
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}.
97
98 @cindex warping the mouse
99 @cindex mouse warping
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
102 actual mouse motion.
103 @end defun
104
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
109 @var{window}.
110 @end defun