I'm trying to bind S-mouse-1
which doesn't seem to be as easy as I thought. So far I'm using:
(define-derived-mode foobar-mode nil "foobar")
(define-key foobar-mode-map [S-down-mouse-1]
(lambda () (interactive)))
(define-key foobar-mode-map [S-mouse-1]
(lambda () (interactive) (message "S-mouse-1")))
This seems to work but looks really clumsy. Is there a better way to do this? Without this clumsy binding of S-down-mouse-1
I do not get rid of its original binding to 'mouse-appearance-menu
.
Note: Eventually I want to put this keymap into a text-property. This is why I want to override this key-binding and not remove it globally.
make-text-button
ormake-button