Sublime Forum

Hide mouse pointer when typing

#1

Is there any way to hide the mouse cursor when typing? Unfortunately the Windows mouse option to “hide pointer while typing” is basically useless except in specific text boxes.

There are two basic ways I can think of that would make this happen:

  1. When a keypress (or possibly several keypresses) is/are detected, move the mouse cursor to some out-of-the-way area of the screen.

  2. When a keypress is detected, simply turn off the mouse pointer (there are Windows API calls which may achieve this). When the mouse pointer is again moved, turn it back on.

I think #1 above would be easier. Is there any way to move the mouse cursor programmatically in Sublime macros?

Thanks for any hints!

0 Likes

#2

IIRC there’s normally an OS setting for 2 (and it might also unhide the pointer after a lack of keypress activity)
plus the advantage being it might only hide the pointer while it is over the text area you are typing in

0 Likes

#3

@kingkeith the Windows option to hide the mouse pointer while typing simply does not work for most text boxes. It works in the “notepad” app, but most apps don’t use the standard textbox control which supports cursor hiding.

Thanks!

Do you know of any way to move the mouse cursor via a Sublime macro? Can you run an external program in a macro?

0 Likes

#4

ah I see. No, not in a macro, but its simple enough to create a Python plugin to run external programs

0 Likes

#5

If you want the hacky solution, there is a way to override (edit) the color scheme to change the color of caret.

0 Likes

#6

@ihodev I’m not sure I understand. I’m referring to the mouse pointer, not the caret. I want the caret to be visible when typing. Just not the mouse pointer.

0 Likes

#7

Quick solution: I already use AutoHotkey for other stuff, so I created a very simple one liner which moves the mouse pointer to the top left corner of the active window anytime the Spacebar is pressed. This effectively moves the mouse pointer only when a lot of typing is happening, and not when a single key or three are pressed. Here’s the line:

~Space::MouseMove,0,0

Easy, eh? This will save me many headaches in the future, maybe will help you too.

0 Likes

#8

Ah, sorry :neutral_face: I don’t even know how I’ve read your post :smile: In this case, AutoHotkey is the best solution on Windows.

0 Likes

#9

I use it to disable single alt key :wink:

#IfWinActive, ahk_exe sublime_text.exe
~LAlt Up::Return
#IfWinActive
0 Likes