aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-07 20:57:30 +0000
committerRichard M. Stallman1993-03-07 20:57:30 +0000
commit5f1d59f437a54ee6d8ad28f92b0dd4ea7ba8281d (patch)
tree4cce064e205eaeb52fba11718431dae915e6d7d2
parentd3cc13faacbb55441b992ab0e0b14641b64182af (diff)
downloademacs-5f1d59f437a54ee6d8ad28f92b0dd4ea7ba8281d.tar.gz
emacs-5f1d59f437a54ee6d8ad28f92b0dd4ea7ba8281d.zip
*** empty log message ***
-rw-r--r--lisp/emacs-lisp/levents.el63
1 files changed, 27 insertions, 36 deletions
diff --git a/lisp/emacs-lisp/levents.el b/lisp/emacs-lisp/levents.el
index b2a91f8dc1e..f38a25c2fbf 100644
--- a/lisp/emacs-lisp/levents.el
+++ b/lisp/emacs-lisp/levents.el
@@ -31,6 +31,15 @@
31 31
32;;; Code: 32;;; Code:
33 33
34(defun next-command-event (event)
35 (error "You must rewrite to use `read-command-event' instead of `next-command-event'"))
36
37(defun next-event (event)
38 (error "You must rewrite to use `read-event' instead of `next-event'"))
39
40(defun dispatch-event (event)
41 (error "`dispatch-event' not supported"))
42
34;; Make events of type eval, menu and timeout 43;; Make events of type eval, menu and timeout
35;; execute properly. 44;; execute properly.
36 45
@@ -100,17 +109,6 @@ This emulation does not actually deallocate or reuse events
100except via garbage collection and `cons'." 109except via garbage collection and `cons'."
101 nil) 110 nil)
102 111
103(defun dispatch-event (event)
104 "Given an event object returned by next-event, execute it."
105 (let ((type (car-safe event)))
106 (cond ((eq type 'eval)
107 (funcall (nth 1 event) (nth 2 event)))
108 ((eq type 'menu)
109 (funcall (nth 1 event) (nth 2 event)))
110 ((eq type 'switch-frame)
111 (internal-select-frame (nth 1 event)))
112 (t (error "keyboard and mouse events not allowed in `dispatch-event'")))))
113
114(defun enqueue-eval-event: (function object) 112(defun enqueue-eval-event: (function object)
115 "Add an eval event to the back of the queue. 113 "Add an eval event to the back of the queue.
116It will be the next event read after all pending events." 114It will be the next event read after all pending events."
@@ -261,31 +259,24 @@ will be returned for events which have no direct ASCII equivalent."
261 "True if the argument is a mouse-motion event object." 259 "True if the argument is a mouse-motion event object."
262 (eq (car-safe obj) 'mouse-movement)) 260 (eq (car-safe obj) 'mouse-movement))
263 261
264(defun next-command-event (event) 262(defun read-command-event ()
265 "Given an event structure, fills it in with the next keyboard, mouse 263 "Return the next keyboard or mouse event; execute other events.
266press, or mouse release event available from the user. If there are 264This is similar to the function `next-command-event' of Lucid Emacs,
267non-command events available (mouse motion, sub-process output, etc) then 265but different in that it returns the event rather than filling in
268these will be executed (with dispatch-event) and discarded." 266an existing event object."
269 (while (progn 267 (let (event)
270 (next-event event) 268 (while (progn
271 (not (or (key-press-event-p event) 269 (setq event (read-event))
272 (button-press-event-p event) 270 (not (or (key-press-event-p event)
273 (button-release-event-p event) 271 (button-press-event-p event)
274 (menu-event-p event)))) 272 (button-release-event-p event)
275 (dispatch-event event))) 273 (menu-event-p event))))
276 274 (let ((type (car-safe event)))
277(defun next-event (event &optional ignore) 275 (cond ((eq type 'eval)
278 "Given an event structure, fills it in with the next event available 276 (funcall (nth 1 event) (nth 2 event)))
279from the window system or terminal driver. Pass this object to 277 ((eq type 'switch-frame)
280`dispatch-event' to handle it. 278 (internal-select-frame (nth 1 event))))))
281 279 event))
282See also the function `next-command-event'.
283
284If the second optional argument is non-nil, then this will never return
285key-press and mouse-click events, but will delay them until later. You
286should probably never need to use this option; it is used for implementing
287the `wait-reading-process-input' function."
288 (read-event))
289 280
290(defun process-event-p (obj) 281(defun process-event-p (obj)
291 "True if the argument is a process-output event object. 282 "True if the argument is a process-output event object.