3 event, einit, estart, estartfn, etimer, eread, emouse, ekbd, ecanread, ecanmouse, ecankbd, ereadmouse, eatomouse, eresized, egetrect, edrawgetrect, emenuhit, emoveto, esetcursor, Event, Mouse, Menu \- graphics events
17 .ta \w'\fLRectangle 'u
20 void einit(ulong keys)
38 int ereadmouse(Mouse *m)
41 int eatomouse(Mouse *m, char *buf, int n)
44 ulong estart(ulong key, int fd, int n)
47 ulong estartfn(int id, ulong key, int fd, int n,
49 int (*fn)(Event*, uchar*, int))
52 ulong etimer(ulong key, int n)
55 ulong eread(ulong keys, Event *e)
58 int ecanread(ulong keys)
61 void eresized(int new)
64 Rectangle egetrect(int but, Mouse *m)
67 void edrawgetrect(Rectangle r, int up)
70 int emenuhit(int but, Mouse *m, Menu *menu)
78 int esetcursor(Cursor *c)
93 These routines provide an interface to multiple sources of input for unthreaded
95 Threaded programs (see
97 should instead use the threaded mouse and keyboard interface described
104 must be called first.
112 the mouse and keyboard events will be enabled;
117 must have already been called.
118 The user must provide a function called
120 to be called whenever the window in which the process
121 is running has been resized; the argument
123 is a flag specifying whether the program must call
127 to re-establish a connection to its window.
128 After resizing (and perhaps calling
132 will be updated to point to the new window's
136 As characters are typed on the keyboard, they are read by the
137 event mechanism and put in a queue.
139 returns the next rune from the queue, blocking until the
141 The characters are read in raw mode,
144 so they are available as soon as a complete rune is typed.
146 When the mouse moves or a mouse button is pressed or released,
147 a new mouse event is queued by the event mechanism.
149 returns the next mouse event from the queue, blocking until the
167 is set when the left mouse button is pressed,
169 when the middle button is pressed,
172 when the right button is pressed.
173 The current mouse position is always returned in
176 is a time stamp in units of milliseconds.
181 return non-zero when there are keyboard or mouse events available
185 reads the next mouse event from the file descriptor connected to the mouse,
186 converts the textual data into a
190 with the buffer and count from the read call,
191 and returns the number of bytes read, or \-1 for an error.
194 can be used to register additional file descriptors to scan for input.
195 It takes as arguments the file descriptor to register,
196 the maximum length of an event message on that descriptor,
197 and a key to be used in accessing the event.
198 The key must be a power of 2 and must not conflict with any previous keys.
199 If a zero key is given, a key will be allocated and returned.
203 but processes the data received by calling
205 before returning the event to the user.
210 of the event; it should return
212 if the event is to be passed to the user,
214 if it is to be ignored.
219 to attach an arbitrary data item to the returned
226 are the keyboard and mouse event keys.
229 starts a repeating timer with a period of
231 milliseconds; it returns the timer event key, or zero if it fails.
232 Only one timer can be started.
233 Extra timer events are not queued and the timer channel has no associated data.
236 waits for the next event specified by the mask
238 of event keys submitted to
240 It fills in the appropriate field of the argument
242 structure, which looks like:
256 is an array which is large enough to hold a 9P message.
258 returns the key for the event which was chosen.
259 For example, if a mouse event was read,
264 waits for the next event of any kind.
265 The return is the same as for
270 the graphics functions are buffered.
276 all cause a buffer flush unless there is an event of the
277 appropriate type already queued.
280 checks whether a call to
282 would block, returning 0 if it would, 1 if it would not.
285 prompts the user to sweep a rectangle.
286 It should be called with
288 holding the mouse event that triggered the
295 It changes to the sweep cursor,
296 waits for the buttons all to be released,
297 and then waits for button number
299 to be pressed, marking the initial corner.
300 If another button is pressed instead,
303 with zero for both corners, after
304 waiting for all the buttons to be released.
307 continually draws the swept rectangle
308 until the button is released again, and returns the swept rectangle.
309 The mouse structure pointed to by
311 will contain the final mouse event.
314 uses successive calls to
316 to maintain the red rectangle showing the sweep-in-progress.
317 The rectangle to be drawn is specified by
321 parameter says whether to draw (1) or erase (0) the rectangle.
324 displays a menu and returns a selected menu item number.
325 It should be called with
327 holding the mouse event that triggered the
347 is nonzero, it should be a null-terminated array of the character strings
348 to be displayed as menu items.
351 should be a function that, given an item number, returns the character
352 string for that item, or zero if the number is past the end of the list.
353 Items are numbered starting at zero.
357 is released, and then returns the number of the selection,
358 or \-1 for no selection.
361 argument is filled in with the final mouse event.
364 moves the mouse cursor to the position
369 changes the cursor image to that described by the
376 is nil, it restores the image to the default arrow.