From a9772fb4137e6ff65f6e0306074b1e9da93c08e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Francesco=20Potort=C3=AC?= Date: Mon, 7 Apr 2003 14:04:51 +0000 Subject: [PATCH] (xterm-mouse-event-read): New function. (xterm-mouse-event): Use it to get xterm sequences above #x7f. Suggested by Aman Bhargava . --- lisp/xt-mouse.el | 13 ++++++++++--- 1 file 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 @@ (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 -- 2.39.2