comparison man/lispref/commands.texi @ 207:e45d5e7c476e r20-4b2

Import from CVS: tag r20-4b2
author cvs
date Mon, 13 Aug 2007 10:03:52 +0200
parents 169c0442b401
children 78f53ef88e17
comparison
equal deleted inserted replaced
206:d3e9274cbc4e 207:e45d5e7c476e
820 @itemx button-release event 820 @itemx button-release event
821 A button was pressed or released. Along with the button that was pressed 821 A button was pressed or released. Along with the button that was pressed
822 or released, button events specify the modifier keys that were held down 822 or released, button events specify the modifier keys that were held down
823 at the time and the position of the pointer at the time. 823 at the time and the position of the pointer at the time.
824 824
825 @item dnd-drop event
826 Some dragged data was released. The event provides the button that was used
827 to drag the data, the modifier keys that were hold down, the position where
828 the drop took place, and a lisp object containing the type and the data
829 dropped (Note: until now only the OffiX protocol supports dnd-drop).
830
825 @item motion event 831 @item motion event
826 The pointer was moved. Along with the position of the pointer, these events 832 The pointer was moved. Along with the position of the pointer, these events
827 also specify the modifier keys that were held down at the time. 833 also specify the modifier keys that were held down at the time.
828 834
829 @item misc-user event 835 @item misc-user event
895 @item x 901 @item x
896 @itemx y 902 @itemx y
897 The position of the pointer (in pixels) at the time of the event. 903 The position of the pointer (in pixels) at the time of the event.
898 @end table 904 @end table
899 905
906 @item dnd-drop event
907 @table @asis
908 @item channel
909 @item timestamp
910 @item button
911 What button was used to drag. Buttons are numbered starting at 1.
912 @item modifiers
913 Which modifier keys were pressed to do the drag.
914 @item x
915 @itemx y
916 The position of the pointer (in pixels) at the time of the event.
917 @item data
918 A lisp object containing the dropped type and data.
919 @end table
920
900 @item pointer-motion event 921 @item pointer-motion event
901 @table @asis 922 @table @asis
902 @item channel 923 @item channel
903 @item timestamp 924 @item timestamp
904 @item x 925 @item x
966 A key was pressed. 987 A key was pressed.
967 @item button-press 988 @item button-press
968 A mouse button was pressed. 989 A mouse button was pressed.
969 @item button-release 990 @item button-release
970 A mouse button was released. 991 A mouse button was released.
992 @item dnd-drop
993 A drop occured.
971 @item motion 994 @item motion
972 The mouse moved. 995 The mouse moved.
973 @item misc-user 996 @item misc-user
974 Some other user action happened; typically, this is 997 Some other user action happened; typically, this is
975 a menu selection or scrollbar action. 998 a menu selection or scrollbar action.
1005 1028
1006 @defun button-release-event-p object 1029 @defun button-release-event-p object
1007 This is true if @var{object} is a mouse button-release event. 1030 This is true if @var{object} is a mouse button-release event.
1008 @end defun 1031 @end defun
1009 1032
1033 @defun dnd-drop-event-p object
1034 This is true if @var{object} is a mouse dnd-drop event.
1035 @end defun
1036
1010 @defun motion-event-p object 1037 @defun motion-event-p object
1011 This is true if @var{object} is a mouse motion event. 1038 This is true if @var{object} is a mouse motion event.
1012 @end defun 1039 @end defun
1013 1040
1014 @defun mouse-event-p object 1041 @defun mouse-event-p object
1037 @end defun 1064 @end defun
1038 1065
1039 @node Accessing Mouse Event Positions 1066 @node Accessing Mouse Event Positions
1040 @subsection Accessing the Position of a Mouse Event 1067 @subsection Accessing the Position of a Mouse Event
1041 1068
1042 Unlike other events, mouse events (i.e. motion, button-press, and 1069 Unlike other events, mouse events (i.e. motion, button-press,
1043 button-release events) occur in a particular location on the screen. 1070 button-release, and dnd-drop events) occur in a particular location
1044 Many primitives are provided for determining exactly where the event 1071 on the screen. Many primitives are provided for determining exactly
1045 occurred and what is under that location. 1072 where the event occurred and what is under that location.
1046 1073
1047 @menu 1074 @menu
1048 * Frame-Level Event Position Info:: 1075 * Frame-Level Event Position Info::
1049 * Window-Level Event Position Info:: 1076 * Window-Level Event Position Info::
1050 * Event Text Position Info:: 1077 * Event Text Position Info::
1059 The following functions return frame-level information about where 1086 The following functions return frame-level information about where
1060 a mouse event occurred. 1087 a mouse event occurred.
1061 1088
1062 @defun event-frame event 1089 @defun event-frame event
1063 This function returns the ``channel'' or frame that the given mouse 1090 This function returns the ``channel'' or frame that the given mouse
1064 motion, button press, or button release event occurred in. This will be 1091 motion, button press, button release, or dnd drop event occurred in.
1065 @code{nil} for non-mouse events. 1092 This will be @code{nil} for non-mouse events.
1066 @end defun 1093 @end defun
1067 1094
1068 @defun event-x-pixel event 1095 @defun event-x-pixel event
1069 This function returns the X position in pixels of the given mouse event. 1096 This function returns the X position in pixels of the given mouse event.
1070 The value returned is relative to the frame the event occurred in. 1097 The value returned is relative to the frame the event occurred in.
1082 1109
1083 The following functions return window-level information about where 1110 The following functions return window-level information about where
1084 a mouse event occurred. 1111 a mouse event occurred.
1085 1112
1086 @defun event-window event 1113 @defun event-window event
1087 Given a mouse motion, button press, or button release event, compute and 1114 Given a mouse motion, button press, button release, or dnd drop event, compute and
1088 return the window on which that event occurred. This may be @code{nil} 1115 return the window on which that event occurred. This may be @code{nil}
1089 if the event occurred in the border or over a toolbar. The modeline is 1116 if the event occurred in the border or over a toolbar. The modeline is
1090 considered to be within the window it describes. 1117 considered to be within the window it describes.
1091 @end defun 1118 @end defun
1092 1119
1093 @defun event-buffer event 1120 @defun event-buffer event
1094 Given a mouse motion, button press, or button release event, compute and 1121 Given a mouse motion, button press, button release, or dnd drop event, compute and
1095 return the buffer of the window on which that event occurred. This may 1122 return the buffer of the window on which that event occurred. This may
1096 be @code{nil} if the event occurred in the border or over a toolbar. 1123 be @code{nil} if the event occurred in the border or over a toolbar.
1097 The modeline is considered to be within the window it describes. This is 1124 The modeline is considered to be within the window it describes. This is
1098 equivalent to calling @code{event-window} and then calling 1125 equivalent to calling @code{event-window} and then calling
1099 @code{window-buffer} on the result if it is a window. 1126 @code{window-buffer} on the result if it is a window.
1101 1128
1102 @defun event-window-x-pixel event 1129 @defun event-window-x-pixel event
1103 This function returns the X position in pixels of the given mouse event. 1130 This function returns the X position in pixels of the given mouse event.
1104 The value returned is relative to the window the event occurred in. 1131 The value returned is relative to the window the event occurred in.
1105 This will signal an error if the event is not a mouse-motion, button-press, 1132 This will signal an error if the event is not a mouse-motion, button-press,
1106 or button-release event. 1133 button-release, or dnd-drop event.
1107 @end defun 1134 @end defun
1108 1135
1109 @defun event-window-y-pixel event 1136 @defun event-window-y-pixel event
1110 This function returns the Y position in pixels of the given mouse event. 1137 This function returns the Y position in pixels of the given mouse event.
1111 The value returned is relative to the window the event occurred in. 1138 The value returned is relative to the window the event occurred in.
1118 1145
1119 The following functions return information about the text (including the 1146 The following functions return information about the text (including the
1120 modeline) that a mouse event occurred over or near. 1147 modeline) that a mouse event occurred over or near.
1121 1148
1122 @defun event-over-text-area-p event 1149 @defun event-over-text-area-p event
1123 Given a mouse-motion, button-press, or button-release event, this 1150 Given a mouse-motion, button-press, button-release, or dnd-drop event, this
1124 function returns @code{t} if the event is over the text area of a 1151 function returns @code{t} if the event is over the text area of a
1125 window. Otherwise, @code{nil} is returned. The modeline is not 1152 window. Otherwise, @code{nil} is returned. The modeline is not
1126 considered to be part of the text area. 1153 considered to be part of the text area.
1127 @end defun 1154 @end defun
1128 1155
1129 @defun event-over-modeline-p event 1156 @defun event-over-modeline-p event
1130 Given a mouse-motion, button-press, or button-release event, this 1157 Given a mouse-motion, button-press, button-release, or dnd-drop event, this
1131 function returns @code{t} if the event is over the modeline of a window. 1158 function returns @code{t} if the event is over the modeline of a window.
1132 Otherwise, @code{nil} is returned. 1159 Otherwise, @code{nil} is returned.
1133 @end defun 1160 @end defun
1134 1161
1135 @defun event-x event 1162 @defun event-x event
1136 This function returns the X position of the given mouse-motion, 1163 This function returns the X position of the given mouse-motion,
1137 button-press, or button-release event in characters. This is relative 1164 button-press, button-release, or dnd-drop event in characters. This is relative
1138 to the window the event occurred over. 1165 to the window the event occurred over.
1139 @end defun 1166 @end defun
1140 1167
1141 @defun event-y event 1168 @defun event-y event
1142 This function returns the Y position of the given mouse-motion, 1169 This function returns the Y position of the given mouse-motion,
1143 button-press, or button-release event in characters. This is relative 1170 button-press, button-release, or dnd-drop event in characters. This is relative
1144 to the window the event occurred over. 1171 to the window the event occurred over.
1145 @end defun 1172 @end defun
1146 1173
1147 @defun event-point event 1174 @defun event-point event
1148 This function returns the character position of the given mouse-motion, 1175 This function returns the character position of the given mouse-motion,
1149 button-press, or button-release event. If the event did not occur over 1176 button-press, button-release, or dnd-drop event. If the event did not occur over
1150 a window, or did not occur over text, then this returns @code{nil}. 1177 a window, or did not occur over text, then this returns @code{nil}.
1151 Otherwise, it returns an index into the buffer visible in the event's 1178 Otherwise, it returns an index into the buffer visible in the event's
1152 window. 1179 window.
1153 @end defun 1180 @end defun
1154 1181
1155 @defun event-closest-point event 1182 @defun event-closest-point event
1156 This function returns the character position of the given mouse-motion, 1183 This function returns the character position of the given mouse-motion,
1157 button-press, or button-release event. If the event did not occur over 1184 button-press, button-release, or dnd-drop event. If the event did not occur over
1158 a window or over text, it returns the closest point to the location of 1185 a window or over text, it returns the closest point to the location of
1159 the event. If the Y pixel position overlaps a window and the X pixel 1186 the event. If the Y pixel position overlaps a window and the X pixel
1160 position is to the left of that window, the closest point is the 1187 position is to the left of that window, the closest point is the
1161 beginning of the line containing the Y position. If the Y pixel 1188 beginning of the line containing the Y position. If the Y pixel
1162 position overlaps a window and the X pixel position is to the right of 1189 position overlaps a window and the X pixel position is to the right of
1170 1197
1171 The following functions return information about the glyph (if any) that 1198 The following functions return information about the glyph (if any) that
1172 a mouse event occurred over. 1199 a mouse event occurred over.
1173 1200
1174 @defun event-over-glyph-p event 1201 @defun event-over-glyph-p event
1175 Given a mouse-motion, button-press, or button-release event, this 1202 Given a mouse-motion, button-press, button-release, or dnd-drop event, this
1176 function returns @code{t} if the event is over a glyph. Otherwise, 1203 function returns @code{t} if the event is over a glyph. Otherwise,
1177 @code{nil} is returned. 1204 @code{nil} is returned.
1178 @end defun 1205 @end defun
1179 1206
1180 @defun event-glyph-extent event 1207 @defun event-glyph-extent event
1181 If the given mouse-motion, button-press, or button-release event happened 1208 If the given mouse-motion, button-press, button-release, or dnd-drop event happened
1182 on top of a glyph, this returns its extent; else @code{nil} is returned. 1209 on top of a glyph, this returns its extent; else @code{nil} is returned.
1183 @end defun 1210 @end defun
1184 1211
1185 @defun event-glyph-x-pixel event 1212 @defun event-glyph-x-pixel event
1186 Given a mouse-motion, button-press, or button-release event over a 1213 Given a mouse-motion, button-press, button-release, or dnd-drop event over a
1187 glyph, this function returns the X position of the pointer relative to 1214 glyph, this function returns the X position of the pointer relative to
1188 the upper left of the glyph. If the event is not over a glyph, it returns 1215 the upper left of the glyph. If the event is not over a glyph, it returns
1189 @code{nil}. 1216 @code{nil}.
1190 @end defun 1217 @end defun
1191 1218
1192 @defun event-glyph-y-pixel event 1219 @defun event-glyph-y-pixel event
1193 Given a mouse-motion, button-press, or button-release event over a 1220 Given a mouse-motion, button-press, button-release, or dnd-drop event over a
1194 glyph, this function returns the Y position of the pointer relative to 1221 glyph, this function returns the Y position of the pointer relative to
1195 the upper left of the glyph. If the event is not over a glyph, it returns 1222 the upper left of the glyph. If the event is not over a glyph, it returns
1196 @code{nil}. 1223 @code{nil}.
1197 @end defun 1224 @end defun
1198 1225
1199 @node Event Toolbar Position Info 1226 @node Event Toolbar Position Info
1200 @subsubsection Event Toolbar Position Info 1227 @subsubsection Event Toolbar Position Info
1201 1228
1202 @defun event-over-toolbar-p event 1229 @defun event-over-toolbar-p event
1203 Given a mouse-motion, button-press, or button-release event, this 1230 Given a mouse-motion, button-press, button-release, or dnd-drop event, this
1204 function returns @code{t} if the event is over a toolbar. Otherwise, 1231 function returns @code{t} if the event is over a toolbar. Otherwise,
1205 @code{nil} is returned. 1232 @code{nil} is returned.
1206 @end defun 1233 @end defun
1207 1234
1208 @defun event-toolbar-button event 1235 @defun event-toolbar-button event
1209 If the given mouse-motion, button-press, or button-release event 1236 If the given mouse-motion, button-press, button-release, or dnd-drop event
1210 happened on top of a toolbar button, this function returns the button. 1237 happened on top of a toolbar button, this function returns the button.
1211 Otherwise, @code{nil} is returned. 1238 Otherwise, @code{nil} is returned.
1212 @end defun 1239 @end defun
1213 1240
1214 @node Other Event Position Info 1241 @node Other Event Position Info
1215 @subsubsection Other Event Position Info 1242 @subsubsection Other Event Position Info
1216 1243
1217 @defun event-over-border-p event 1244 @defun event-over-border-p event
1218 Given a mouse-motion, button-press, or button-release event, this 1245 Given a mouse-motion, button-press, button-release, or dnd-drop event, this
1219 function returns @code{t} if the event is over an internal toolbar. 1246 function returns @code{t} if the event is over an internal toolbar.
1220 Otherwise, @code{nil} is returned. 1247 Otherwise, @code{nil} is returned.
1221 @end defun 1248 @end defun
1222 1249
1223 @node Accessing Other Event Info 1250 @node Accessing Other Event Info
1264 misc-user, or eval event. 1291 misc-user, or eval event.
1265 @end defun 1292 @end defun
1266 1293
1267 @defun event-process event 1294 @defun event-process event
1268 This function returns the process of the given process event. 1295 This function returns the process of the given process event.
1296 @end defun
1297
1298 @defun event-drag-and-drop-data event
1299 This function returns a list containing the type of the drop as first element
1300 and the data of the drop as second element.
1269 @end defun 1301 @end defun
1270 1302
1271 @node Working With Events 1303 @node Working With Events
1272 @subsection Working With Events 1304 @subsection Working With Events
1273 1305