diff options
| author | Francesco Potortì | 2003-04-07 14:04:51 +0000 |
|---|---|---|
| committer | Francesco Potortì | 2003-04-07 14:04:51 +0000 |
| commit | a9772fb4137e6ff65f6e0306074b1e9da93c08e4 (patch) | |
| tree | a6e4fad82b1c8f91b7b3ca75aeb2a3b9e5852b08 | |
| parent | 99a4c53c8dcd7f394c310bf29179f889d0b93a24 (diff) | |
| download | emacs-a9772fb4137e6ff65f6e0306074b1e9da93c08e4.tar.gz emacs-a9772fb4137e6ff65f6e0306074b1e9da93c08e4.zip | |
(xterm-mouse-event-read): New function.
(xterm-mouse-event): Use it to get xterm sequences above #x7f.
Suggested by Aman Bhargava <emacs-bug@amanb.net>.
| -rw-r--r-- | lisp/xt-mouse.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 08e1d39a430..9fad35fb850 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el | |||
| @@ -112,11 +112,18 @@ | |||
| 112 | (setcdr pos (cons xterm-mouse-x xterm-mouse-y)) | 112 | (setcdr pos (cons xterm-mouse-x xterm-mouse-y)) |
| 113 | pos) | 113 | pos) |
| 114 | 114 | ||
| 115 | ;; read xterm sequences above ascii 127 (#x7f) | ||
| 116 | (defun xterm-mouse-event-read () | ||
| 117 | (let ((c (read-char))) | ||
| 118 | (if (< c 0) | ||
| 119 | (+ c #x8000000 128) | ||
| 120 | c))) | ||
| 121 | |||
| 115 | (defun xterm-mouse-event () | 122 | (defun xterm-mouse-event () |
| 116 | "Convert XTerm mouse event to Emacs mouse event." | 123 | "Convert XTerm mouse event to Emacs mouse event." |
| 117 | (let* ((type (- (read-char) #o40)) | 124 | (let* ((type (- (xterm-mouse-event-read) #o40)) |
| 118 | (x (- (read-char) #o40 1)) | 125 | (x (- (xterm-mouse-event-read) #o40 1)) |
| 119 | (y (- (read-char) #o40 1)) | 126 | (y (- (xterm-mouse-event-read) #o40 1)) |
| 120 | (point (cons x y)) | 127 | (point (cons x y)) |
| 121 | (window (window-at x y)) | 128 | (window (window-at x y)) |
| 122 | (where (if window | 129 | (where (if window |