3 event, einit, estart, estartfn, etimer, eread, emouse, ekbd, ecanread, ecanmouse, ecankbd, ereadmouse, eatomouse, eresized, egetrect, edrawgetrect, emenuhit, eenter, 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(ulong key, int fd, int n,
49 int (*fn)(int, 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)
76 void esetcursor(Cursor *c)
79 int eenter(char *ask, char *buf, int len, Mouse *m)
94 These routines provide an interface to multiple sources of input for unthreaded
96 Threaded programs (see
98 should instead use the threaded mouse and keyboard interface described
105 must be called first.
113 the mouse and keyboard events will be enabled;
118 must have already been called.
119 The user must provide a function called
121 to be called whenever the window in which the process
122 is running has been resized; the argument
124 is a flag specifying whether the program must call
128 to re-establish a connection to its window.
129 After resizing (and perhaps calling
133 will be updated to point to the new window's
137 As characters are typed on the keyboard, they are read by the
138 event mechanism and put in a queue.
140 returns the next rune from the queue, blocking until the
142 The characters are read in raw mode
145 so they are available as soon as a complete rune is typed.
147 When the mouse moves or a mouse button is pressed or released,
148 a new mouse event is queued by the event mechanism.
150 returns the next mouse event from the queue, blocking until the
168 is set when the left mouse button is pressed,
170 when the middle button is pressed,
173 when the right button is pressed.
174 The current mouse position is always returned in
177 is a time stamp in units of milliseconds.
182 return non-zero when there are keyboard or mouse events available
186 reads the next mouse event from the file descriptor connected to the mouse,
187 converts the textual data into a
191 with the buffer and count from the read call,
192 and returns the number of bytes read, or \-1 for an error.
195 can be used to register additional file descriptors to scan for input.
196 It takes as arguments the file descriptor to register,
197 the maximum length of an event message on that descriptor,
198 and a key to be used in accessing the event.
199 The key must be a power of 2 and must not conflict with any previous keys.
200 If a zero key is given, a key will be allocated and returned.
204 but processes the data received by calling
206 before returning the event to the user.
211 of the event; it should return
213 if the event is to be passed to the user,
215 if it is to be ignored.
220 to attach an arbitrary data item to the returned
227 are the keyboard and mouse event keys.
230 starts a repeating timer with a period of
232 milliseconds; it returns the timer event key, or zero if it fails.
233 Only one timer can be started.
234 Extra timer events are not queued and the timer channel has no associated data.
237 waits for the next event specified by the mask
239 of event keys submitted to
241 It fills in the appropriate field of the argument
243 structure, which looks like:
257 is an array which is large enough to hold a 9P message.
259 returns the key for the event which was chosen.
260 For example, if a mouse event was read,
265 waits for the next event of any kind.
266 The return is the same as for
271 the graphics functions are buffered.
277 all cause a buffer flush unless there is an event of the
278 appropriate type already queued.
281 checks whether a call to
283 would block, returning 0 if it would, 1 if it would not.
286 prompts the user to sweep a rectangle.
287 It should be called with
289 holding the mouse event that triggered the
296 It changes to the sweep cursor,
297 waits for the buttons all to be released,
298 and then waits for button number
300 to be pressed, marking the initial corner.
301 If another button is pressed instead,
304 with zero for both corners, after
305 waiting for all the buttons to be released.
308 continually draws the swept rectangle
309 until the button is released again, and returns the swept rectangle.
310 The mouse structure pointed to by
312 will contain the final mouse event.
315 uses successive calls to
317 to maintain the red rectangle showing the sweep-in-progress.
318 The rectangle to be drawn is specified by
322 parameter says whether to draw (1) or erase (0) the rectangle.
325 displays a menu and returns a selected menu item number.
326 It should be called with
328 holding the mouse event that triggered the
348 is nonzero, it should be a null-terminated array of the character strings
349 to be displayed as menu items.
352 should be a function that, given an item number, returns the character
353 string for that item, or zero if the number is past the end of the list.
354 Items are numbered starting at zero.
358 is released, and then returns the number of the selection,
359 or \-1 for no selection.
362 argument is filled in with the final mouse event.
365 moves the mouse cursor to the position
370 changes the cursor image to that described by the
377 is nil, it restores the image to the default arrow.
380 provides a simple method of text input in graphical programs. It displays
381 a box at the current position of the mouse cursor (passed in the
383 argument) in which text can be
385 If the string argument
389 it is displayed as a static label before the input string.
392 parameter contains the null-terminated input string to be edited. The
394 argument specifies the length of
396 in bytes including the terminating null byte.
401 is zero, no text can be entered.
404 returns the number of bytes in the edited string