12
votes
Drag selected text with the mouse
tldr;
Add (setq mouse-drag-and-drop-region t) in you init file.
Restart or C-c d R to reload if you're using Doom-Emacs.
I just find out (SURPRISINGLY) that Emacs as text drag and drop. And this ...
10
votes
Smooth (mouse) scroll for inline images?
Since Emacs 26.1, the buffer can be scrolled by individual pixels instead of just lines which can be used to smoothly scroll over images using the mouse wheel. To achieve this I have used the ...
9
votes
Accepted
What is the select word/symbol function bound to <double-mouse-1>
It's actually a bit complicated. When you double-click mouse-1 there are multiple actions. <down-mouse-1> occurs first, when you press the button. Then mouse-1 occurs, when you release the ...
9
votes
Accepted
Keyboard equivalent of left mouse click in org mode
Function org-open-at-point (bound to C-c C-o) does precisely that I think. Its docstring (obtained through M-x describe-function) includes:
(org-open-at-point &optional ARG REFERENCE-BUFFER)
...
7
votes
Accepted
Emacs in PuTTY with xterm-mouse-mode: how to paste?
If mouse reporting is on, then Shift+click is still interpreted by the terminal and not passed to the application. Thus, if a right-click pastes outside Emacs, and a straight right-click is passed ...
7
votes
Generate mouse-2 event from MacBook trackpad
After some more googling and reading of the manual, I have found a solution that works for me, by adding to the file ~/.emacs.d/init.el the following line:
(define-key key-translation-map (kbd "<s-...
7
votes
What is the select word/symbol function bound to <double-mouse-1>
@Drew has explained some of the complexity associated with events bound to mouse actions. As for your ultimate goal of marking the word at point using the keyboard, you might be interested in expand-...
7
votes
Accepted
Difference between [mouse-1] and [down-mouse-1]
down-mouse-1 is a "button-down" event which is generated immediately when you press the mouse button.
mouse-1 is a "click" event, which is generated if you release the button at ...
6
votes
Generate mouse-2 event from MacBook trackpad
You could also tell flyspell to use mouse-3 which seems more appropriate for a context menu:
(eval-after-load "flyspell"
'(progn
(define-key flyspell-mouse-map [down-mouse-3] #'flyspell-...
6
votes
Accepted
Turn off mouse highlighting in org-agenda
I removed the mouse face as a whole in the agenda:
(add-hook 'org-agenda-finalize-hook
(lambda () (remove-text-properties
(point-min) (point-max) '(mouse-face t))))
6
votes
Accepted
What does this 'shift' do here?
shift in this case is a symbol, not a function. Note that the variable is given a quoted list, so nothing inside is evaluated.
From the documentation of this variable (which you can access via ...
5
votes
Mouse pointer between characters and the text cursor misplacement
First, you are apparently confusing the mouse pointer with the text cursor (aka cursor). It seems that you mostly talking about the latter, but referring to it as the "cursor".
Second, insertion of a ...
5
votes
Accepted
How to disable query to turn on disabled command?
Put this in your init file:
(setq disabled-command-function 'ignore)
By default, disabling a command means that you get that prompt when you try to use it.
But you can override this design by ...
5
votes
Accepted
binding M-[ causes mouse focus to insert characters
This is a normal deficiency of most terminals. Terminal send escape sequences to represent input events that don't have a corresponding character, such as function keys, “exotic” modifier combinations ...
5
votes
Accepted
How to disable changing the current buffer by clicking buffer name in mode line?
Try using:
(define-key mode-line-buffer-identification-keymap [mode-line mouse-1] nil)
(define-key mode-line-buffer-identification-keymap [mode-line mouse-3] nil)
The variable mode-line-buffer-...
4
votes
`mouse-1` (button 1) follows links, like `mouse-2` does - how to modify the behavior?
You want to look at C-h v mouse-1-click-follows-link RET, I think.
4
votes
Accepted
Is there a way to determine the face at frame x / y (mouse position)?
Here's one way. You need to bind the command to a mouse event. But if you use a mouse-button click then you will likely need to bind the event for the other part of the click (e.g. down) to ignore. ...
4
votes
Emacs on Android - org-mode - error - `(wrong-type-argument stringp (require . t-mouse))`
For the record: I have dug up the root cause for this one. It is not for ZShaolin build, but rather, for Termux build of Emacs, but the source of the broken load-history entry is the same, it's an ...
4
votes
Accepted
Right-click to select one character under the mouse pointer?
You can do it:
(defun select-char-at-click (event)
"Select char at EVENT position.
EVENT should be a mouse-click event."
(interactive "e")
(run-hooks 'mouse-leave-buffer-hook) ; Give Isearch ...
4
votes
Turn off mouse highlighting in org-agenda
I realize you asked specifically about org-mode,
but this might be of interest to others reading this.
A general variable exists: mouse-highlight.
Setting it to nil disables highlighting of ...
4
votes
How to disable mouse in Spacemacs
According to your example you don't need the function with-eval-after-load.
In Spacemacs it works simple like that:
(defun dotspacemacs/user-config ()
"…"
;; …
;; dummy silence definition
(...
4
votes
How to disable query to turn on disabled command?
Drew's answer solves your stated question so I would suggest accepting that; but my best guess is that something like this is what you're actually after:
(global-set-key [remap mouse-save-then-kill] '...
3
votes
Accepted
How to make mouse-1 behave the same as RET in dired?
Bind mouse-1 to the command you want:
(define-key dired-mode-map [mouse-1] 'dired-find-file)
Or bind it to a command that is like dired-mouse-find-file-other-window but uses the same window.
(defun ...
3
votes
Mouse pointer between characters and the text cursor misplacement
I suggest you file this as a bug or a feature request with M-x report-emacs-bug.
It can probably be fixed to some extent in Elisp by tweaking mouse-set-point as Vladimir suggested: this function ...
3
votes
Accepted
Yank from mouse in helm modes
After poking around the helm source code a bit, it looks like helm tries to temporarily override all the mouse commands using the minor mode helm--remap-mouse-mode, and this is most likely the source ...
3
votes
Smooth (mouse) scroll for inline images?
The problem as I understand it is that the image is a single line. Changing how scrolling behaves won't solve the problem.
The only solution I am aware of is to slice the image up so that there are ...
3
votes
Smooth (mouse) scroll for inline images?
How about this:
;; scroll one line at a time (less "jumpy" than defaults)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
(setq mouse-wheel-progressive-speed nil) ;; don't ...
3
votes
Accepted
A dual-purpose function for keyboard shortcut and mouse
Yes.
(defun dired-follow-link-with-mouse (event)
"Follow the link in the dired directory heading, causing a new
dired buffer to be opened."
(interactive (list last-nonmenu-event))
(run-hooks '...
3
votes
Is it possible to disable the support for the mouse in GUI?
Two-and-a-half answers:
Artur Malabarba's init.el code. The blog post has useful comments.
Victor Deryagin's init.el code from which Malabarba derived his.
My third "answer" probably only applies to ...
3
votes
Accepted
How to find the window under the mouse pointer
This should do it:
(window-at (cadr (mouse-position))
(cddr (mouse-position))
(car (mouse-position)))
See the Elisp manual section (elisp) Coordinates and Windows for more ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mouse × 115key-bindings × 25
scrolling × 10
events × 8
org-mode × 7
terminal-emacs × 7
osx × 6
copy-paste × 6
spacemacs × 5
mode-line × 5
cursor × 5
dired × 4
keymap × 4
region × 4
point × 4
evil × 3
hooks × 3
hyperlinks × 3
buffers × 2
helm × 2
debugging × 2
window × 2
frames × 2
faces × 2
fonts × 2