X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d7a89815b6d69c3b1793d34bcad8bf0aa21d48c8..5deebc3c914c86e84d11661a7877c00b2d7fddd1:/lisp/xt-mouse.el diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index b87c1a2893..a2b64019f9 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -1,6 +1,6 @@ ;;; xt-mouse.el --- support the mouse when emacs run in an xterm -;; Copyright (C) 1994, 2000-2015 Free Software Foundation, Inc. +;; Copyright (C) 1994, 2000-2016 Free Software Foundation, Inc. ;; Author: Per Abrahamsen ;; Keywords: mouse, terminals @@ -60,6 +60,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (ev-data (nth 1 event)) (ev-where (nth 1 ev-data)) (vec (vector event)) + (is-move (eq 'mouse-movement ev-command)) (is-down (string-match "down-" (symbol-name ev-command)))) ;; Mouse events symbols must have an 'event-kind property with @@ -71,6 +72,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (is-down (setf (terminal-parameter nil 'xterm-mouse-last-down) event) vec) + (is-move vec) (t (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) (down-data (nth 1 down)) @@ -132,65 +134,98 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (fdiff (- f (* 1.0 maxwrap dbig)))) (+ (truncate fdiff) (* maxwrap dbig)))))) -;; Normal terminal mouse click reporting: expect three bytes, of the -;; form . Return a list (EVENT-TYPE X Y). -(defun xterm-mouse--read-event-sequence-1000 () - (let* ((code (- (read-event) 32)) - (type - ;; For buttons > 3, the release-event looks differently - ;; (see xc/programs/xterm/button.c, function EditorButton), - ;; and come in a release-event only, no down-event. - (cond ((>= code 64) - (format "mouse-%d" (- code 60))) - ((memq code '(8 9 10)) - (format "M-down-mouse-%d" (- code 7))) - ((memq code '(3 11)) - (let ((down (car (terminal-parameter - nil 'xterm-mouse-last-down)))) - (when (and down (string-match "[0-9]" (symbol-name down))) - (format (if (eq code 3) "mouse-%s" "M-mouse-%s") - (match-string 0 (symbol-name down)))))) - ((memq code '(0 1 2)) - (format "down-mouse-%d" (+ 1 code))))) - (x (- (read-event) 33)) - (y (- (read-event) 33))) - (and type (wholenump x) (wholenump y) - (list (intern type) x y)))) - -;; XTerm's 1006-mode terminal mouse click reporting has the form -;;