"Prof. O. E. Lanford" <lanford(a)math.ethz.ch> writes:
I'm seeing curious behavior when trying to rebind mouse keys.
Here's
an example: I execute:
(global-unset-key 'button3)
(global-set-key 'button3 'mouse-track-adjust)
Unfortunately the new mouse.el code still has a bit too much
hard-coded knowledge about mouse button numbers in it. The attached
patch makes sure button 3 is treated as button 1, which I think
is what most people want. [Unfortunately you still cannot bind
mouse-track-adjust to say '(shift button2)].
Jan Vroonhof
Index: mouse.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mouse.el,v
retrieving revision 1.22.2.2
diff -u -u -r1.22.2.2 mouse.el
--- mouse.el 2001/10/23 08:35:22 1.22.2.2
+++ mouse.el 2001/12/16 14:57:56
@@ -1182,7 +1182,9 @@
(event-modifiers event)))))
(defun default-mouse-track-down-hook (event click-count)
- (cond ((default-mouse-track-event-is-with-button event 1)
+ (cond ((or
+ (default-mouse-track-event-is-with-button event 1)
+ (default-mouse-track-event-is-with-button event 3))
(if (and (memq 'button1-down mouse-track-activate-strokes)
(mouse-track-do-activate event))
t
@@ -1232,7 +1234,9 @@
(setq default-mouse-track-extent nil)))))
(defun default-mouse-track-drag-hook (event click-count was-timeout)
- (cond ((default-mouse-track-event-is-with-button event 1)
+ (cond ((or
+ (default-mouse-track-event-is-with-button event 1)
+ (default-mouse-track-event-is-with-button event 3))
(default-mouse-track-deal-with-down-event click-count)
(default-mouse-track-set-point event default-mouse-track-window)
(default-mouse-track-cleanup-extent)
@@ -1292,7 +1296,8 @@
result))
(defun default-mouse-track-drag-up-hook (event click-count)
- (when (default-mouse-track-event-is-with-button event 1)
+ (when (or (default-mouse-track-event-is-with-button event 1)
+ (default-mouse-track-event-is-with-button event 3))
(let ((result (default-mouse-track-return-dragged-selection event)))
(if result
(default-mouse-track-maybe-own-selection result 'PRIMARY)))
@@ -1309,6 +1314,22 @@
mouse-track-activate-strokes))
(and (= click-count 3)
(memq 'button1-triple-click
+ mouse-track-activate-strokes)))
+ (mouse-track-do-activate event))
+ t
+ (default-mouse-track-drag-hook event click-count nil)
+ (default-mouse-track-drag-up-hook event click-count)
+ t))
+ ((default-mouse-track-event-is-with-button event 3)
+ (if (and
+ (or (and (= click-count 1)
+ (memq 'button3-click
+ mouse-track-activate-strokes))
+ (and (= click-count 2)
+ (memq 'button3-double-click
+ mouse-track-activate-strokes))
+ (and (= click-count 3)
+ (memq 'button3-triple-click
mouse-track-activate-strokes)))
(mouse-track-do-activate event))
t