1

I'm using this in my .emacs file to make double-clicking the left mouse button run a command:

(global-set-key [(double-mouse-1)] 'some-command)

This only works in GUI mode; it doesn't work when running Emacs in the terminal. Is there some way for me to fix this? Or to detect double click events using some other mechanism? I have tried in a few different terminals without success. Tried Emacs 24.5.1 and 23.1.1.

Note that xterm-mouse-mode is enabled and other mouse functionality (like single-clicking or drag and drop to highlight text) works fine.

1

Check the documentation for xterm-mouse-mode (C-h f xterm-mouse-mode RET); you'll see that it doesn't support double clicks, or for that matter modifier keys.

On the other hand, I do see code in that same file that looks at consecutive mouse events and counts them to try to find double clicks, so I don't immediately see why they wouldn't be supported.

0

I reworked some of that xtrm-mouse-mode handling sometimes around May-June 2014. Not sure if it reached Emacs-24.5, but at least double clicks seem to work for me here in Emacs-25.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.