Mercurial > emacs
comparison lisp/xt-mouse.el @ 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 | e88404e8f2cf |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
50477:bfaa5e73184f | 50478:4c84e707a287 |
---|---|
110 (defun xterm-mouse-position-function (pos) | 110 (defun xterm-mouse-position-function (pos) |
111 "Bound to `mouse-position-function' in XTerm mouse mode." | 111 "Bound to `mouse-position-function' in XTerm mouse mode." |
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 |
123 (coordinates-in-window-p point window) | 130 (coordinates-in-window-p point window) |
124 'menu-bar)) | 131 'menu-bar)) |