Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable mouse clicks in Emacs

Tags:

emacs

Is there any way I can disable all mouse click events in Emacs? I tend to get focus issues when I accidentally hit my touch pad on my laptop and suddenly I'm in another Emacs window.

like image 404
Sarah Avatar asked Feb 05 '11 11:02

Sarah


2 Answers

Try this:

(dolist (k '([mouse-1] [down-mouse-1] [drag-mouse-1] [double-mouse-1] [triple-mouse-1]  
             [mouse-2] [down-mouse-2] [drag-mouse-2] [double-mouse-2] [triple-mouse-2]
             [mouse-3] [down-mouse-3] [drag-mouse-3] [double-mouse-3] [triple-mouse-3]
             [mouse-4] [down-mouse-4] [drag-mouse-4] [double-mouse-4] [triple-mouse-4]
             [mouse-5] [down-mouse-5] [drag-mouse-5] [double-mouse-5] [triple-mouse-5]))
  (global-unset-key k))
like image 146
Victor Deryagin Avatar answered Oct 07 '22 04:10

Victor Deryagin


I've created a package called disable-mouse, which provides local and global minor modes for disabling all mouse interaction in the current buffer or all buffers respectively.

like image 34
sanityinc Avatar answered Oct 07 '22 04:10

sanityinc