Questions tagged [mouse]

for Emacs support of mouse. Emacs mouse interface supports click events, drag events, button-down events, and motion events. Whereas the current buffer handles keystrokes, mouse events in a clicked buffer are independent of the current buffer.

Filter by
Sorted by
Tagged with
23
votes
3answers
1k views

Smooth (mouse) scroll for inline images?

I display images in-line with begin_src & result blocks. However, for large-images, when I scroll past the bottom of the image, I get a 'jerk' and the whole image is scrolled away. Similarly if I ...
11
votes
3answers
440 views

What is the select word/symbol function bound to <double-mouse-1>

I love the ability to select word/symbol at point which I currently do with double mouse click. I would like to be able to do it from the keyboard, and so I'd like to bind it to a keystroke (or maybe ...
8
votes
1answer
713 views

Simulating mouse operations with keyboard

Is there a way, via some command that can be invoked by the keyboard, of making Emacs think that I clicked at a particular point (so that it does whatever it would have done if I clicked there, e.g. ...
7
votes
5answers
2k views

Generate mouse-2 event from MacBook trackpad

I have Emacs.app version 24.5 (9.0) on a MacBook with Mac OS X 10.11.3 (15D21). How can I generate mouse-2 from my MacBook's trackpad? I've googled and found references to mac-emulate-three-button-...
7
votes
2answers
2k views

How to change the mouse pointer colour?

I am using the ample theme and I quite like it, but I can't see the mouser pointer when moving over emacs and emacs is activated; as the emacs background and the mouse pointer are black, I would like ...
7
votes
2answers
530 views

Clear secondary selection without using mouse

Occasionally, without meaning to I somehow mash keys or mouse so that I get a secondary selection. I never use the secondary selection so I would always like to get rid of it. How can I clear the ...
6
votes
1answer
1k views

Enable Emacs column selection using mouse

How to use mouse to select column in Emacs? How to enable it? The emacs wiki RectangleMark says, there is mouse support for rectangle highlighting by dragging the mouse while holding down the ...
6
votes
4answers
1k views

How to disable mouse in Spacemacs

I'd like to completely disable my mouse in Spacemacs. Following the advice in this answer, I set up the following in my .spacemacs file as (defun dotspacemacs/user-config () "Configuration function ...
6
votes
4answers
188 views

Is there a way to determine the face at frame x / y (mouse position)?

When trying to theme certain modes, it's not possible to place the point on the themed item (e.g. to do C-u C-x =) and identify the face used. My thought is to use the mouse to identify the face used,...
6
votes
2answers
810 views

Preventing mouse clicks in inactive windows from repositioning the cursor

When I have Emacs (24.4, Mac OS, NS build) in the foreground, I often have many windows open in one frame. I sometimes want to switch windows by clicking in an inactive window. By default, this calls ...
5
votes
3answers
255 views

Turn off mouse highlighting in org-agenda

When I am viewing my org-agenda, whatever line I have the mouse point on is highlighted. Since I never act on these lines with the mouse, and since the line where point is is also highlighted, the ...
5
votes
1answer
215 views

Inadvertent paste when correcting spelling mistakes using flyspell

When I click with the middle mouse button that usually inserts the primary selection at the point where I clicked. However, the same button opens flyspell's context menu when I click on a misspelled ...
5
votes
3answers
1k views

Is it possible to disable the support for the mouse in GUI?

I can't believe there is no way in Emacs to easily and reliably ignore the mouse but my google fu seems not good enough to find how to do it. By easily and reliably I mean to disable the device, not ...
5
votes
2answers
100 views

local keymap in mode-line doesn't work in terminal

I'm having trouble with getting local keymap:s to work in the mode-line, but only in terminals (with xterm-mouse-mode enabled). This applies to both the standard mode-line entries (like mode-line-...
5
votes
1answer
128 views

`mouse-1` (button 1) follows links, like `mouse-2` does - how to modify the behavior?

I'm a beginner in Emacs. In dired+, if I query the mouse click on a directory item with C-h k, I get the following: ----------------- up-event (short click) ---------------- <mouse-2> at ...
5
votes
1answer
867 views

can scrolling be smoother than single line in emacs/org-mode?

Using the trackpad, the scrolling in emacs/spacemacs is notably less smooth than in modern browsers and other editors. I have to confess that this jerkiness irks me more than I would prefer but I have ...
5
votes
3answers
446 views

Mouse wheel not working with new mouse

I'm running Emacs 25.1.1 on Debian. No particularly elaborate setup. I recently bought a new mouse, a Logitech MX Anywhere 2S, though I am not using any of the "programmable" features. I simply use ...
4
votes
1answer
839 views

Drag selected text with the mouse

In many editors it is standard to move selected text by dragging and dropping it with the mouse. In emacs dragging selection with the mouse starts a new selection by default. This is extremely ...
4
votes
2answers
463 views

How to make mode-line text look like a link/button on hover

What face/text/other property should I use to have mode-line text look like a button/link/stuff to click on while I am hovering over it with the cursor? Some examples: different background, 3D-like ...
4
votes
1answer
1k views

Emacs in PuTTY with xterm-mouse-mode: how to paste?

I'm running Emacs under PuTTY and this works better then I expected. But since I sometimes use the mouse to focus the PuTTY window, I turned xterm-mouse-mode on. This way the focus in the text changes ...
4
votes
2answers
180 views

Detect if mouse button is held down?

I have some code that runs in a hook that I want to change to only execute only if the left mouse button is not currently held down. I don't see any obvious functions or variables that let me directly ...
4
votes
1answer
46 views

Obtain points at beginning/ending of visual line without using vertical-motion

Q:  How to obtain the points at the beginning and ending of each visual line of the current window -- without using vertical-motion -- when word-wrap is t (aka visual-line-mode). For this experiment, ...
4
votes
2answers
995 views

Terminal Emacs not receiving <wheel-up> or <wheel-down>?

From what I understand, I should be able to get mouse scrolling to work in emacs nox mode with the following: (require 'mouse) (xterm-mouse-mode t) (mouse-wheel-mode t) (global-set-key (kbd "<...
3
votes
2answers
140 views

How to disable query to turn on disabled command?

I have this in my .emacs file to disable mouse right clicks: (put 'mouse-save-then-kill 'disabled "mouse-save-then-kill disabled\n") How can I now disable the query generated by emacs to turn this ...
3
votes
2answers
1k views

Mouse pointer between characters and the text cursor misplacement

Mouse cursor position interpretation in emacs drives me nuts. Why draw the mouse cursor in emacs window with vertical thin bar if you cannot effectively position it between characters? Selecting ...
3
votes
1answer
224 views

how to reveal function names that are bound to mouse buttons (eg <down-mouse-1>)?

Emacs buttonizes specific expression in the buffers. For example, email ids, urls attachments in gnus buffer, and [back], [forward] in help buffers and so on. When we click on those with mouse, they ...
3
votes
1answer
411 views

Keyboard equivalent of left mouse click in org mode

Is there a keyboard equivalent of left mouse click in emacs? Use case here is an .org file I have which contains a no. of URLs I can left click on those URLs to have them open in a browser I was ...
3
votes
1answer
53 views

What does this 'shift' do here?

I'm trying to understand this value assignment: (setq mouse-wheel-scroll-amount '(2 ((shift) . 1))) I know that shift is a bitwise shift. But I don't understand what is the result of this operation ...
3
votes
2answers
898 views

How to disable copy on selection with evil-mode (Mac/24.4)?

This only occurs when I turn evil-mode on! Whenever I make a selection, either through evil or the mouse, the selection gets automatically copied into the clipboard. I have set (setq select-active-...
3
votes
2answers
321 views

How can I move point to where the mouse is pointing now

I want to move point to where the mouse is pointing. This is easy to do interactively: just click and point will move to where the mouse is pointing. However, I need to do this inside elisp code. I ...
3
votes
2answers
283 views

Dired reuse buffer on mouse click

I am currently using the diredp-toggle-find-file-reuse-dir feature of Dired+ so that selecting a directory in a dired buffer opens the directory in the current buffer as described here. However, it ...
3
votes
1answer
261 views

How to make mouse-1 behave the same as RET in dired?

When I click with mouse-1 in dired it will open a new frame with the selected file. When I press return on the same file it will open the file in the same frame. How can I synchronize this behavior? I....
3
votes
1answer
164 views

Right-click to select one character under the mouse pointer?

I'm using GUI emacs 24.4.9.0, so I can click to move the cursor, and double-click to select a word under the mouse pointer as a region. How can I configure emacs so that right-click selects a ...
3
votes
1answer
78 views

A dual-purpose function for keyboard shortcut and mouse

Is it possible to combine the following two functions so that the combined function will work with the keyboard keys (e.g., [return]) and also work with the mouse buttons? If so, how please? ...
3
votes
2answers
86 views

xpm: Change displayed image on mouse-over in `header-line-format`

Q: How do I programmatically instruct Emacs to change a displayed image (XPM) on mouse-over in the header-line-format? For example, the following image has a black circle with a white letter X. On ...
3
votes
2answers
253 views

Mouse problem in org-mode export window

When in org-mode, running the export command will open a windows with all the export options. However, my mouse scroll behaves erratically and I am not able to scroll down or move at all, not even by ...
2
votes
3answers
585 views

Hide mouse pointer while typing

Some programs, like many terminal emulators and gVim, hide the mouse pointer as soon as the keyboard is in use. Obviously, this is helpful when the mouse pointer happens to obscure some text behind it....
2
votes
1answer
121 views

How to get xemacs-like Buffers menu entry in emacs?

xemacs has a nicely organized Buffers entry in its built-in menu. As you can see from the snapshot, it's sorted alphabetically and grouped by modes: I can't find how to make emacs do the same. menu-...
2
votes
1answer
127 views

Use mouse buttons as modifiers

I want to make use of a Thinkpad trackpoint's thumb buttons which I almost never use in Emacs anyway. I'd like to use them as additional Controls in Emacs, and in Emacs only. I've found this answer, ...
2
votes
3answers
752 views

xterm-mouse-mode use mouse on clickable texts

I am using emacs with PuTTY. I have xterm-mouse-mode turned on, and it works nicely, except that nothing happens when I click on "clickable texts" for example on the start page, or in neotree. Is ...
2
votes
1answer
105 views

How to find the window under the mouse pointer

Is there a function that finds which Emacs window within a frame the mouse pointer is over without clicking or moving the mouse? I know that (mouse-position) includes the frame the mouse is over, but ...
2
votes
1answer
145 views

Expand/shrink region after double-clicking mouse-1

How can I change the default double-mouse-1 word selection behavior so that I can move the point around right afterwards to extend/shrink the region? By default, if I forward/backward-char after ...
2
votes
1answer
114 views

Debugging / understanding placement of keymap with text-properties

Q:  Why does there appear to be a keymap on the hyphen of hello-world in the following example? GOAL:  Place text properties before the hyphen and after the hyphen -- without any keymap being placed ...
2
votes
2answers
194 views

Any way to select a region using `S-down-mouse-1` without saving the region as a kill?

Using emacsw32. The usual suggested way to make a selection using S-down-mouse-1 is to bind that to mouse-save-then-kill. Is there a similar command which selects a region, but does not save the ...
2
votes
0answers
26 views

How to detect the modifier key state with track-mouse?

When using track-mouse pressing modifier keys doesn't generate events. Is there a way to detect if any modifier keys are held while tracking the mouse?
2
votes
0answers
21 views

How to reliably redefine scroll wheel in isearch? [I'm using Mitsuharu Yamamoto's Mac port]

I decided to define <wheel-up> and <wheel-down> to isearch-repeat-forward and isearch-repeat-backward in the isearch-mode-map. This works, but if you scroll quickly, it reverts to ...
2
votes
0answers
84 views

Horizontal Scroll Wheel on Mouseover Buffer

My mouse has a horizontal scroll function, where I can tap the scroll wheel left and right to scroll horizontally. By default, it seems Emacs does nothing with that. The scroll wheel produces <...
2
votes
0answers
75 views

Is it possible to use the mouse wheel for company mode?

I'm using the Cocoa version of Emacs. When company mode presents a list of completions you can use the mouse to select one. It would seem natural to be able to use the mouse wheel to scroll through ...
2
votes
0answers
37 views

Control or set the emacs mouse button event polling rate?

I have been using artist-mode and noticed that even at moderate mouse movement speeds the mouse event polling rate (here for down-mouse-1) does not seem to keep up (so lines end up with scattered ...
1
vote
1answer
92 views

How to access mouse event coordinates? (conveniently)

When getting events from (read-event) it's possible to access only mouse events using (mouse-movement-p event). Inspecting the events I've found I can get the Y pixel location using (cdr (nth 2 (nth ...