(xterm-mouse-event-read): New function.
authorFrancesco Potortì <pot@gnu.org>
Mon, 7 Apr 2003 14:04:51 +0000 (14:04 +0000)
committerFrancesco Potortì <pot@gnu.org>
Mon, 7 Apr 2003 14:04:51 +0000 (14:04 +0000)
(xterm-mouse-event): Use it to get xterm sequences above #x7f.
Suggested by Aman Bhargava <emacs-bug@amanb.net>.

lisp/xt-mouse.el

index 08e1d39..9fad35f 100644 (file)
   (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