changeset 76657:ee5fbf83e732

(xterm-mouse-event): Compute a timestamp using current-time.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 21 Mar 2007 20:33:26 +0000
parents 638653a49975
children 384739d4e5e7
files lisp/xt-mouse.el
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/xt-mouse.el	Wed Mar 21 20:33:01 2007 +0000
+++ b/lisp/xt-mouse.el	Wed Mar 21 20:33:26 2007 +0000
@@ -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