changeset 50478:4c84e707a287

(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>.
author Francesco Potortì <pot@gnu.org>
date Mon, 07 Apr 2003 14:04:51 +0000
parents bfaa5e73184f
children 4e1d24f23f2f
files lisp/xt-mouse.el
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/xt-mouse.el	Mon Apr 07 14:03:51 2003 +0000
+++ b/lisp/xt-mouse.el	Mon Apr 07 14:04:51 2003 +0000
@@ -112,11 +112,18 @@
   (setcdr pos (cons xterm-mouse-x xterm-mouse-y))
   pos)
 
+;; read xterm sequences above ascii 127 (#x7f)
+(defun xterm-mouse-event-read ()
+  (let ((c (read-char)))
+    (if (< c 0)
+        (+ c #x8000000 128)
+      c)))
+
 (defun xterm-mouse-event ()
   "Convert XTerm mouse event to Emacs mouse event."
-  (let* ((type (- (read-char) #o40))
-	 (x (- (read-char) #o40 1))
-	 (y (- (read-char) #o40 1))
+  (let* ((type (- (xterm-mouse-event-read) #o40))
+	 (x (- (xterm-mouse-event-read) #o40 1))
+	 (y (- (xterm-mouse-event-read) #o40 1))
 	 (point (cons x y))
 	 (window (window-at x y))
 	 (where (if window