I defined this keymap:
(defvar my-custom-keymap
(let ((map (make-sparse-keymap)))
(define-key map [mouse-1] #'my-function1)
(define-key map [mouse-3] #'my-function2)
map)
"Custom Keymap")
Then I use:
(overlay-put this-overlay 'keymap my-custom-keymap)
to set the key-binding on some overlays.
Both my-function1
and my-function2
works on overlays using the (thing-at-point)
function, but only the first one works like I aspected because mouse-1
event runs (mouse-set-point)
and than my-function1
.
mouse-3
event doesn't move the "point" so it doesn't see the "thing-at-point" where the mouse has been clicked.
Can I make mouse-3
event behave like mouse-1
event only for overlays?