Commit a9772fb4 authored by Francesco Potortì's avatar Francesco Potortì
Browse files

(xterm-mouse-event-read): New function.

(xterm-mouse-event): Use it to get xterm sequences above #x7f.
Suggested by Aman Bhargava <>.
parent 99a4c53c
......@@ -112,11 +112,18 @@
(setcdr pos (cons xterm-mouse-x xterm-mouse-y))
;; read xterm sequences above ascii 127 (#x7f)
(defun xterm-mouse-event-read ()
(let ((c (read-char)))
(if (< c 0)
(+ c #x8000000 128)
(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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment