comparison man/lispref/commands.texi @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents 7df0dd720c89
children c9fe270a4101
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
827 @itemx button-release event 827 @itemx button-release event
828 A button was pressed or released. Along with the button that was pressed 828 A button was pressed or released. Along with the button that was pressed
829 or released, button events specify the modifier keys that were held down 829 or released, button events specify the modifier keys that were held down
830 at the time and the position of the pointer at the time. 830 at the time and the position of the pointer at the time.
831 831
832 @item dnd-drop event
833 Some dragged data was released. The event provides the button that was used
834 to drag the data, the modifier keys that were hold down, the position where
835 the drop took place, and a lisp object containing the type and the data
836 dropped (Note: until now only the OffiX protocol supports dnd-drop).
837
838 @item motion event 832 @item motion event
839 The pointer was moved. Along with the position of the pointer, these events 833 The pointer was moved. Along with the position of the pointer, these events
840 also specify the modifier keys that were held down at the time. 834 also specify the modifier keys that were held down at the time.
841 835
842 @item misc-user event 836 @item misc-user event
843 A menu item was selected, or the scrollbar was used. 837 A menu item was selected, the scrollbar was used, or a drag or a drop occured.
844 838
845 @item process event 839 @item process event
846 Input is available on a process. 840 Input is available on a process.
847 841
848 @item timeout event 842 @item timeout event
908 @item x 902 @item x
909 @itemx y 903 @itemx y
910 The position of the pointer (in pixels) at the time of the event. 904 The position of the pointer (in pixels) at the time of the event.
911 @end table 905 @end table
912 906
913 @item dnd-drop event
914 @table @asis
915 @item channel
916 @item timestamp
917 @item button
918 What button was used to drag. Buttons are numbered starting at 1.
919 @item modifiers
920 Which modifier keys were pressed to do the drag.
921 @item x
922 @itemx y
923 The position of the pointer (in pixels) at the time of the event.
924 @item data
925 A lisp object containing the dropped type and data.
926 @end table
927
928 @item pointer-motion event 907 @item pointer-motion event
929 @table @asis 908 @table @asis
930 @item channel 909 @item channel
931 @item timestamp 910 @item timestamp
932 @item x 911 @item x
944 The E-Lisp function to call for this event. This is normally either 923 The E-Lisp function to call for this event. This is normally either
945 @code{eval} or @code{call-interactively}. 924 @code{eval} or @code{call-interactively}.
946 @item object 925 @item object
947 The object to pass to the function. This is normally the callback that 926 The object to pass to the function. This is normally the callback that
948 was specified in the menu description. 927 was specified in the menu description.
928 @item button
929 What button went down or up. Buttons are numbered starting at 1.
930 @item modifiers
931 Which modifier keys were pressed. The special business mentioned above
932 for the shift key does @emph{not} apply to mouse events.
933 @item x
934 @itemx y
935 The position of the pointer (in pixels) at the time of the event.
949 @end table 936 @end table
950 937
951 @item process_event 938 @item process_event
952 @table @asis 939 @table @asis
953 @item timestamp 940 @item timestamp
994 A key was pressed. 981 A key was pressed.
995 @item button-press 982 @item button-press
996 A mouse button was pressed. 983 A mouse button was pressed.
997 @item button-release 984 @item button-release
998 A mouse button was released. 985 A mouse button was released.
999 @item dnd-drop
1000 A drop occured.
1001 @item motion 986 @item motion
1002 The mouse moved. 987 The mouse moved.
1003 @item misc-user 988 @item misc-user
1004 Some other user action happened; typically, this is 989 Some other user action happened; typically, this is
1005 a menu selection or scrollbar action. 990 a menu selection, scrollbar action, or drag and drop action.
1006 @item process 991 @item process
1007 Input is available from a subprocess. 992 Input is available from a subprocess.
1008 @item timeout 993 @item timeout
1009 A timeout has expired. 994 A timeout has expired.
1010 @item eval 995 @item eval
1035 1020
1036 @defun button-release-event-p object 1021 @defun button-release-event-p object
1037 This is true if @var{object} is a mouse button-release event. 1022 This is true if @var{object} is a mouse button-release event.
1038 @end defun 1023 @end defun
1039 1024
1040 @defun dnd-drop-event-p object
1041 This is true if @var{object} is a mouse dnd-drop event.
1042 @end defun
1043
1044 @defun motion-event-p object 1025 @defun motion-event-p object
1045 This is true if @var{object} is a mouse motion event. 1026 This is true if @var{object} is a mouse motion event.
1046 @end defun 1027 @end defun
1047 1028
1048 @defun mouse-event-p object 1029 @defun mouse-event-p object
1072 1053
1073 @node Accessing Mouse Event Positions 1054 @node Accessing Mouse Event Positions
1074 @subsection Accessing the Position of a Mouse Event 1055 @subsection Accessing the Position of a Mouse Event
1075 1056
1076 Unlike other events, mouse events (i.e. motion, button-press, 1057 Unlike other events, mouse events (i.e. motion, button-press,
1077 button-release, and dnd-drop events) occur in a particular location 1058 button-release, and drag or drop type misc-user events) occur in a
1078 on the screen. Many primitives are provided for determining exactly 1059 particular location on the screen. Many primitives are provided for
1079 where the event occurred and what is under that location. 1060 determining exactly where the event occurred and what is under that
1061 location.
1080 1062
1081 @menu 1063 @menu
1082 * Frame-Level Event Position Info:: 1064 * Frame-Level Event Position Info::
1083 * Window-Level Event Position Info:: 1065 * Window-Level Event Position Info::
1084 * Event Text Position Info:: 1066 * Event Text Position Info::
1093 The following functions return frame-level information about where 1075 The following functions return frame-level information about where
1094 a mouse event occurred. 1076 a mouse event occurred.
1095 1077
1096 @defun event-frame event 1078 @defun event-frame event
1097 This function returns the ``channel'' or frame that the given mouse 1079 This function returns the ``channel'' or frame that the given mouse
1098 motion, button press, button release, or dnd drop event occurred in. 1080 motion, button press, button release, or misc-user event occurred in.
1099 This will be @code{nil} for non-mouse events. 1081 This will be @code{nil} for non-mouse events.
1100 @end defun 1082 @end defun
1101 1083
1102 @defun event-x-pixel event 1084 @defun event-x-pixel event
1103 This function returns the X position in pixels of the given mouse event. 1085 This function returns the X position in pixels of the given mouse event.
1116 1098
1117 The following functions return window-level information about where 1099 The following functions return window-level information about where
1118 a mouse event occurred. 1100 a mouse event occurred.
1119 1101
1120 @defun event-window event 1102 @defun event-window event
1121 Given a mouse motion, button press, button release, or dnd drop event, compute and 1103 Given a mouse motion, button press, button release, or misc-user event, compute and
1122 return the window on which that event occurred. This may be @code{nil} 1104 return the window on which that event occurred. This may be @code{nil}
1123 if the event occurred in the border or over a toolbar. The modeline is 1105 if the event occurred in the border or over a toolbar. The modeline is
1124 considered to be within the window it describes. 1106 considered to be within the window it describes.
1125 @end defun 1107 @end defun
1126 1108
1127 @defun event-buffer event 1109 @defun event-buffer event
1128 Given a mouse motion, button press, button release, or dnd drop event, compute and 1110 Given a mouse motion, button press, button release, or misc-user event, compute and
1129 return the buffer of the window on which that event occurred. This may 1111 return the buffer of the window on which that event occurred. This may
1130 be @code{nil} if the event occurred in the border or over a toolbar. 1112 be @code{nil} if the event occurred in the border or over a toolbar.
1131 The modeline is considered to be within the window it describes. This is 1113 The modeline is considered to be within the window it describes. This is
1132 equivalent to calling @code{event-window} and then calling 1114 equivalent to calling @code{event-window} and then calling
1133 @code{window-buffer} on the result if it is a window. 1115 @code{window-buffer} on the result if it is a window.
1135 1117
1136 @defun event-window-x-pixel event 1118 @defun event-window-x-pixel event
1137 This function returns the X position in pixels of the given mouse event. 1119 This function returns the X position in pixels of the given mouse event.
1138 The value returned is relative to the window the event occurred in. 1120 The value returned is relative to the window the event occurred in.
1139 This will signal an error if the event is not a mouse-motion, button-press, 1121 This will signal an error if the event is not a mouse-motion, button-press,
1140 button-release, or dnd-drop event. 1122 button-release, or misc-user event.
1141 @end defun 1123 @end defun
1142 1124
1143 @defun event-window-y-pixel event 1125 @defun event-window-y-pixel event
1144 This function returns the Y position in pixels of the given mouse event. 1126 This function returns the Y position in pixels of the given mouse event.
1145 The value returned is relative to the window the event occurred in. 1127 The value returned is relative to the window the event occurred in.
1146 This will signal an error if the event is not a mouse-motion, button-press, 1128 This will signal an error if the event is not a mouse-motion, button-press,
1147 or button-release event. 1129 button-release, or misc-user event.
1148 @end defun 1130 @end defun
1149 1131
1150 @node Event Text Position Info 1132 @node Event Text Position Info
1151 @subsubsection Event Text Position Info 1133 @subsubsection Event Text Position Info
1152 1134
1153 The following functions return information about the text (including the 1135 The following functions return information about the text (including the
1154 modeline) that a mouse event occurred over or near. 1136 modeline) that a mouse event occurred over or near.
1155 1137
1156 @defun event-over-text-area-p event 1138 @defun event-over-text-area-p event
1157 Given a mouse-motion, button-press, button-release, or dnd-drop event, this 1139 Given a mouse-motion, button-press, button-release, or misc-user event, this
1158 function returns @code{t} if the event is over the text area of a 1140 function returns @code{t} if the event is over the text area of a
1159 window. Otherwise, @code{nil} is returned. The modeline is not 1141 window. Otherwise, @code{nil} is returned. The modeline is not
1160 considered to be part of the text area. 1142 considered to be part of the text area.
1161 @end defun 1143 @end defun
1162 1144
1163 @defun event-over-modeline-p event 1145 @defun event-over-modeline-p event
1164 Given a mouse-motion, button-press, button-release, or dnd-drop event, this 1146 Given a mouse-motion, button-press, button-release, or misc-user event, this
1165 function returns @code{t} if the event is over the modeline of a window. 1147 function returns @code{t} if the event is over the modeline of a window.
1166 Otherwise, @code{nil} is returned. 1148 Otherwise, @code{nil} is returned.
1167 @end defun 1149 @end defun
1168 1150
1169 @defun event-x event 1151 @defun event-x event
1170 This function returns the X position of the given mouse-motion, 1152 This function returns the X position of the given mouse-motion,
1171 button-press, button-release, or dnd-drop event in characters. This is relative 1153 button-press, button-release, or misc-user event in characters. This is relative
1172 to the window the event occurred over. 1154 to the window the event occurred over.
1173 @end defun 1155 @end defun
1174 1156
1175 @defun event-y event 1157 @defun event-y event
1176 This function returns the Y position of the given mouse-motion, 1158 This function returns the Y position of the given mouse-motion,
1177 button-press, button-release, or dnd-drop event in characters. This is relative 1159 button-press, button-release, or misc-user event in characters. This is relative
1178 to the window the event occurred over. 1160 to the window the event occurred over.
1179 @end defun 1161 @end defun
1180 1162
1181 @defun event-point event 1163 @defun event-point event
1182 This function returns the character position of the given mouse-motion, 1164 This function returns the character position of the given mouse-motion,
1183 button-press, button-release, or dnd-drop event. If the event did not occur over 1165 button-press, button-release, or misc-user event. If the event did not occur over
1184 a window, or did not occur over text, then this returns @code{nil}. 1166 a window, or did not occur over text, then this returns @code{nil}.
1185 Otherwise, it returns an index into the buffer visible in the event's 1167 Otherwise, it returns an index into the buffer visible in the event's
1186 window. 1168 window.
1187 @end defun 1169 @end defun
1188 1170
1189 @defun event-closest-point event 1171 @defun event-closest-point event
1190 This function returns the character position of the given mouse-motion, 1172 This function returns the character position of the given mouse-motion,
1191 button-press, button-release, or dnd-drop event. If the event did not occur over 1173 button-press, button-release, or misc-user event. If the event did not occur over
1192 a window or over text, it returns the closest point to the location of 1174 a window or over text, it returns the closest point to the location of
1193 the event. If the Y pixel position overlaps a window and the X pixel 1175 the event. If the Y pixel position overlaps a window and the X pixel
1194 position is to the left of that window, the closest point is the 1176 position is to the left of that window, the closest point is the
1195 beginning of the line containing the Y position. If the Y pixel 1177 beginning of the line containing the Y position. If the Y pixel
1196 position overlaps a window and the X pixel position is to the right of 1178 position overlaps a window and the X pixel position is to the right of
1204 1186
1205 The following functions return information about the glyph (if any) that 1187 The following functions return information about the glyph (if any) that
1206 a mouse event occurred over. 1188 a mouse event occurred over.
1207 1189
1208 @defun event-over-glyph-p event 1190 @defun event-over-glyph-p event
1209 Given a mouse-motion, button-press, button-release, or dnd-drop event, this 1191 Given a mouse-motion, button-press, button-release, or misc-user event, this
1210 function returns @code{t} if the event is over a glyph. Otherwise, 1192 function returns @code{t} if the event is over a glyph. Otherwise,
1211 @code{nil} is returned. 1193 @code{nil} is returned.
1212 @end defun 1194 @end defun
1213 1195
1214 @defun event-glyph-extent event 1196 @defun event-glyph-extent event
1215 If the given mouse-motion, button-press, button-release, or dnd-drop event happened 1197 If the given mouse-motion, button-press, button-release, or misc-user event happened
1216 on top of a glyph, this returns its extent; else @code{nil} is returned. 1198 on top of a glyph, this returns its extent; else @code{nil} is returned.
1217 @end defun 1199 @end defun
1218 1200
1219 @defun event-glyph-x-pixel event 1201 @defun event-glyph-x-pixel event
1220 Given a mouse-motion, button-press, button-release, or dnd-drop event over a 1202 Given a mouse-motion, button-press, button-release, or misc-user event over a
1221 glyph, this function returns the X position of the pointer relative to 1203 glyph, this function returns the X position of the pointer relative to
1222 the upper left of the glyph. If the event is not over a glyph, it returns 1204 the upper left of the glyph. If the event is not over a glyph, it returns
1223 @code{nil}. 1205 @code{nil}.
1224 @end defun 1206 @end defun
1225 1207
1226 @defun event-glyph-y-pixel event 1208 @defun event-glyph-y-pixel event
1227 Given a mouse-motion, button-press, button-release, or dnd-drop event over a 1209 Given a mouse-motion, button-press, button-release, or misc-user event over a
1228 glyph, this function returns the Y position of the pointer relative to 1210 glyph, this function returns the Y position of the pointer relative to
1229 the upper left of the glyph. If the event is not over a glyph, it returns 1211 the upper left of the glyph. If the event is not over a glyph, it returns
1230 @code{nil}. 1212 @code{nil}.
1231 @end defun 1213 @end defun
1232 1214
1233 @node Event Toolbar Position Info 1215 @node Event Toolbar Position Info
1234 @subsubsection Event Toolbar Position Info 1216 @subsubsection Event Toolbar Position Info
1235 1217
1236 @defun event-over-toolbar-p event 1218 @defun event-over-toolbar-p event
1237 Given a mouse-motion, button-press, button-release, or dnd-drop event, this 1219 Given a mouse-motion, button-press, button-release, or misc-user event, this
1238 function returns @code{t} if the event is over a toolbar. Otherwise, 1220 function returns @code{t} if the event is over a toolbar. Otherwise,
1239 @code{nil} is returned. 1221 @code{nil} is returned.
1240 @end defun 1222 @end defun
1241 1223
1242 @defun event-toolbar-button event 1224 @defun event-toolbar-button event
1243 If the given mouse-motion, button-press, button-release, or dnd-drop event 1225 If the given mouse-motion, button-press, button-release, or misc-user event
1244 happened on top of a toolbar button, this function returns the button. 1226 happened on top of a toolbar button, this function returns the button.
1245 Otherwise, @code{nil} is returned. 1227 Otherwise, @code{nil} is returned.
1246 @end defun 1228 @end defun
1247 1229
1248 @node Other Event Position Info 1230 @node Other Event Position Info
1249 @subsubsection Other Event Position Info 1231 @subsubsection Other Event Position Info
1250 1232
1251 @defun event-over-border-p event 1233 @defun event-over-border-p event
1252 Given a mouse-motion, button-press, button-release, or dnd-drop event, this 1234 Given a mouse-motion, button-press, button-release, or misc-user event, this
1253 function returns @code{t} if the event is over an internal toolbar. 1235 function returns @code{t} if the event is over an internal toolbar.
1254 Otherwise, @code{nil} is returned. 1236 Otherwise, @code{nil} is returned.
1255 @end defun 1237 @end defun
1256 1238
1257 @node Accessing Other Event Info 1239 @node Accessing Other Event Info
1298 misc-user, or eval event. 1280 misc-user, or eval event.
1299 @end defun 1281 @end defun
1300 1282
1301 @defun event-process event 1283 @defun event-process event
1302 This function returns the process of the given process event. 1284 This function returns the process of the given process event.
1303 @end defun
1304
1305 @defun event-drag-and-drop-data event
1306 This function returns a list containing the type of the drop as first element
1307 and the data of the drop as second element.
1308 @end defun 1285 @end defun
1309 1286
1310 @node Working With Events 1287 @node Working With Events
1311 @subsection Working With Events 1288 @subsection Working With Events
1312 1289