From 915bdfc401c04cf19b8ca0d28c08ad8fa820bd56 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 21 Mar 2007 20:33:26 +0000 Subject: [PATCH] (xterm-mouse-event): Compute a timestamp using current-time. --- lisp/xt-mouse.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index de59563a6c4..39333f74868 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -124,6 +124,8 @@ (let* ((type (- (xterm-mouse-event-read) #o40)) (x (- (xterm-mouse-event-read) #o40 1)) (y (- (xterm-mouse-event-read) #o40 1)) + (time (current-time)) + (timestamp (+ ( * (nth 1 time) 1000 ) (/ (nth 2 time) 1000))) (mouse (intern ;; For buttons > 3, the release-event looks ;; differently (see xc/programs/xterm/button.c, @@ -145,10 +147,13 @@ xterm-mouse-y y) (setq last-input-event - (if w - (list mouse (posn-at-x-y (- x left) (- y top) w t)) - (list mouse - (append (list nil 'menu-bar) (nthcdr 2 (posn-at-x-y x y w t)))))))) + (list mouse + (let ((event (if w + (posn-at-x-y (- x left) (- y top) w t) + (append (list nil 'menu-bar) + (nthcdr 2 (posn-at-x-y x y w t)))))) + (setcar (nthcdr 3 event) timestamp) + event))))) ;;;###autoload (define-minor-mode xterm-mouse-mode