(This should not surprise anyone, because input events are handled in
C, not in Lisp, and so disabling this in Lisp is expected to be
impossible.)
Well, everyone I talked to was sure it must be possible in
Lisp, so I figured somebody would ask eventually.
My first intuition would be to do something like:
(define-key input-decode-map [wheel-down] (lambda (_prompt) []))
(define-key input-decode-map [wheel-up] (lambda (_prompt) []))
(define-key input-decode-map [mouse-1] (lambda (_prompt) []))
(define-key input-decode-map [mouse-2] (lambda (_prompt) []))
(define-key input-decode-map [mouse-3] (lambda (_prompt) []))
If that works, then you'll probably want to add more bindings for those
cases where you hit the "mouse" while holding a modifier, i.e. something like:
(dolist (modifier '(control meta nil))
(dolist (base '(wheel-down wheel-up mouse-1 mouse-2 mouse-3))
(define-key input-decode-map
(vector (event-convert-list (list modifier base)))
(lambda (_prompt) []))))
- Stefan