4

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.

Is there a way to make Emacs do the same? (Running version 26.0 in X under Linux, if that makes any difference.)

1
  • Oh, just realised, it does hide the mouse pointer, but only when inserting characters, not when merely moving the cursor or doing anything else with the keyboard. I’ll make this a wiki answer. Commented Jul 19, 2017 at 19:26

3 Answers 3

3

You can use the mouse-avoidance-mode, see here for documentation.

To test it simply enter M-x mouse-avoidance-mode and then select an option (see documentation link above)

To have it permanently use M-x customize-group RET avoid RET. Then set it up and save it.

1

As pointed out in the Emacs manual, by default “Emacs hides the mouse pointer each time you type a self-inserting character” (emphasis mine).

If hiding only on self-inserting characters is not enough, customize mouse-avoidance-mode and set it to banish, which will force the mouse pointer to a corner of the frame on any keystroke.

1

You can use

(setq make-pointer-invisible t) 
1
  • This is already the default, and will only hide the pointer when typing a “self-inserting character”. Commented Jul 23, 2017 at 9:24

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.