diff options
| author | Richard M. Stallman | 1993-03-07 20:57:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-03-07 20:57:30 +0000 |
| commit | 5f1d59f437a54ee6d8ad28f92b0dd4ea7ba8281d (patch) | |
| tree | 4cce064e205eaeb52fba11718431dae915e6d7d2 | |
| parent | d3cc13faacbb55441b992ab0e0b14641b64182af (diff) | |
| download | emacs-5f1d59f437a54ee6d8ad28f92b0dd4ea7ba8281d.tar.gz emacs-5f1d59f437a54ee6d8ad28f92b0dd4ea7ba8281d.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/emacs-lisp/levents.el | 63 |
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 | |||
| 100 | except via garbage collection and `cons'." | 109 | except 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. |
| 116 | It will be the next event read after all pending events." | 114 | It 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. |
| 266 | press, or mouse release event available from the user. If there are | 264 | This is similar to the function `next-command-event' of Lucid Emacs, |
| 267 | non-command events available (mouse motion, sub-process output, etc) then | 265 | but different in that it returns the event rather than filling in |
| 268 | these will be executed (with dispatch-event) and discarded." | 266 | an 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))) |
| 279 | from 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)) | |
| 282 | See also the function `next-command-event'. | ||
| 283 | |||
| 284 | If the second optional argument is non-nil, then this will never return | ||
| 285 | key-press and mouse-click events, but will delay them until later. You | ||
| 286 | should probably never need to use this option; it is used for implementing | ||
| 287 | the `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. |