Why? Cursor::invalid currently has a specific meaning that the previous cursor is not known. Reusing it for some other meaning is just massively confusing.
Last edit: Neil Hodgson 2025-05-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried noCursurTyping feature of Win32 to be moved into Editor for supporting all platforms.
macOS gives no blank cursor.
This diff uses setHiddenUntilMouseMoves instead of custom blank cursor for macOS style
But I saw custom blank cursor with transparent image works perfect either.
This doesn't unhide the cursor in as many circumstances as before since it requires that the mouse position really moved and Windows sends extra WM_MOUSEMOVE messages in some situations. For example, use Ctrl+Tab to switch between documents and SciTE would previously reshow the cursor. With the patch, it doesn't.
There's not much reason to protect the reset of cursorIsHidden with if (typingWithoutCursor) and it more likely to leave the cursor hidden when its not required.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For example, use Ctrl+Tab to switch between documents and SciTE would previously reshow the cursor. With the patch, it doesn't.
It still doesn't. In case I wasn't clear: the cursor should show when the document is switched. Hide-pointer-while-typing is a light, temporary convenience mode that should be abandoned whenever the use stops typing by performing a larger scope command.
hideCursor0601.diff made the opposite to the wanted change. For Win32, it needs to set cursorIsVisible = true on every WM_MOUSEMOVE, even for the extra messages that did not really move the mouse since they indicate a major change to the window.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Semantics changed: cursorIsHidden -> cursorIsVisible -> cursorIsIn
Win32 behaves as your instruction for ctrl+tab, ctrl+N and so forth.
Gtk does keep its cursor state as is.
I am not sure Qt and macOS since I have no tab-featured test application.
But I guess they also behaves as Gtk.
Win32 behaves as your instruction for ctrl+tab, ctrl+N and so forth.
It doesn't work for me in SciTE:
action
cursor
start
visible
type 'a'
invisible
Ctrl+Tab
invisible
typingWithoutCursor remains false forever except on Win32. Therefore it has no effect and is useless on other platforms. There has to be enabling code that can set it to true.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I realize hidden cursor does not depend on visibility.
It depends on character added and whether in or out of edit pane.
(it triggers when character added and only if within edit pane.)
My plan is moving win32 code to Editor, so that make it work for all platforms.
I'd like to expose typingWithoutCursor to user option.
but I did not work on this yet.
Respond spurious event of mouse moving on win32
Ctrl+N, Ctrl+Tab etc revives cursor to be normal. https://youtu.be/4itLcZUkN9o
Hide cursor while typing for scintilla on macOS
implemented with 16x16 transeparent PNG https://youtu.be/dlh7dGbdfRo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Avoding spurious mouse move event on win32, I bind "cursorIsVisible" with keyboard modifiers. To my surprise, GTK can show cursor between tabs.
but I gave up mouse leave event, which is too elusive to catch.
That is flipping cursorIsVisible on and off with WM_KEYDOWN then WM_CHAR for typing. Just holding down Shift prior to typing a capital letter sets cursorIsVisible. This is more difficult to understand than a mode that lasts from the user starting typing until moving the mouse or performing a command. It could result in spurious showing of the cursor in unexpected situations since cursorIsVisible may be true when WM_SETCURSOR is received.
It might be better to set cursorIsVisible in Editor::SetDocPointer as that occurs for some of the most important commands. There may be other circumstances that need setting cursorIsVisible.
This feature still needs to define an API or access to system settings on non-Win32 platforms before there is a benefit to adding it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With this change, typingWithoutCursor will revert to the system setting every time WM_SETTINGCHANGE is processed which may be for a wide range of conditions that occur during a run. This makes SCI_SETTYPINGWITHOUTCURSOR unreliable on Windows.
There needs to be a clear plan on how to decide which source is authoritative: SCI_SETTYPINGWITHOUTCURSOR or WM_SETTINGCHANGE.SPI_GETMOUSEVANISH.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Current behaviour should be preserved with cursor visible when typing as the default.
Even when I go to the Windows settings and turn off "Hide pointer while typing", it still disappears. There will be upset users if this implementation is committed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why?
Cursor::invalidcurrently has a specific meaning that the previous cursor is not known. Reusing it for some other meaning is just massively confusing.Last edit: Neil Hodgson 2025-05-25
I'd like to implement noCursorTyping for Win, Gtk and Qt.
I find it is simple to implement the feature in Editor.cxx.
There's quite a bit more code required to implement cursor hiding, including setting discovery as well as the additions inside
Editor.I have tried noCursurTyping feature of Win32 to be moved into Editor for supporting all platforms.
macOS gives no blank cursor.
This diff uses setHiddenUntilMouseMoves instead of custom blank cursor for macOS style
But I saw custom blank cursor with transparent image works perfect either.
This doesn't unhide the cursor in as many circumstances as before since it requires that the mouse position really moved and Windows sends extra WM_MOUSEMOVE messages in some situations. For example, use
Ctrl+Tabto switch between documents and SciTE would previously reshow the cursor. With the patch, it doesn't.https://devblogs.microsoft.com/oldnewthing/20031001-00/?p=42343
There's not much reason to protect the reset of
cursorIsHiddenwithif (typingWithoutCursor)and it more likely to leave the cursor hidden when its not required.it works well on all platforms.
naming refined.
It still doesn't. In case I wasn't clear: the cursor should show when the document is switched. Hide-pointer-while-typing is a light, temporary convenience mode that should be abandoned whenever the use stops typing by performing a larger scope command.
hideCursor0601.diffmade the opposite to the wanted change. For Win32, it needs to setcursorIsVisible = trueon everyWM_MOUSEMOVE, even for the extra messages that did not really move the mouse since they indicate a major change to the window.Semantics changed: cursorIsHidden -> cursorIsVisible -> cursorIsIn
Win32 behaves as your instruction for ctrl+tab, ctrl+N and so forth.
Gtk does keep its cursor state as is.
I am not sure Qt and macOS since I have no tab-featured test application.
But I guess they also behaves as Gtk.
This change doesn't make sense to me: in what?
It doesn't work for me in SciTE:
typingWithoutCursorremains false forever except on Win32. Therefore it has no effect and is useless on other platforms. There has to be enabling code that can set it to true.I realize hidden cursor does not depend on visibility.
It depends on character added and whether in or out of edit pane.
(it triggers when character added and only if within edit pane.)
My plan is moving win32 code to Editor, so that make it work for all platforms.
I'd like to expose typingWithoutCursor to user option.
but I did not work on this yet.
Respond spurious event of mouse moving on win32
Ctrl+N, Ctrl+Tab etc revives cursor to be normal.
https://youtu.be/4itLcZUkN9o
Hide cursor while typing for scintilla on macOS
implemented with 16x16 transeparent PNG
https://youtu.be/dlh7dGbdfRo
Sometimes it works but not other times.
https://www.youtube.com/watch?v=DnWpkmVeRpk
Avoding spurious mouse move event on win32, I bind "cursorIsVisible" with keyboard modifiers. To my surprise, GTK can show cursor between tabs.
but I gave up mouse leave event, which is too elusive to catch.
Hide cursor while typing for scintilla on GTK
https://youtu.be/yQl-mf3XC9w
That is flipping
cursorIsVisibleon and off withWM_KEYDOWNthenWM_CHARfor typing. Just holding downShiftprior to typing a capital letter setscursorIsVisible. This is more difficult to understand than a mode that lasts from the user starting typing until moving the mouse or performing a command. It could result in spurious showing of the cursor in unexpected situations sincecursorIsVisiblemay be true whenWM_SETCURSORis received.It might be better to set
cursorIsVisibleinEditor::SetDocPointeras that occurs for some of the most important commands. There may be other circumstances that need settingcursorIsVisible.This feature still needs to define an API or access to system settings on non-Win32 platforms before there is a benefit to adding it.
I managed to build scite working.
also needed!
With this change,
typingWithoutCursorwill revert to the system setting every timeWM_SETTINGCHANGEis processed which may be for a wide range of conditions that occur during a run. This makesSCI_SETTYPINGWITHOUTCURSORunreliable on Windows.There needs to be a clear plan on how to decide which source is authoritative:
SCI_SETTYPINGWITHOUTCURSORorWM_SETTINGCHANGE.SPI_GETMOUSEVANISH.I prefer SCI_SETTYPINGWITHOUTCURSOR.
That is removing functionality that is wanted by other users.
SPI_GETMOUSEVANISH reflected!
for scintilla
Current behaviour should be preserved with cursor visible when typing as the default.
Even when I go to the Windows settings and turn off "Hide pointer while typing", it still disappears. There will be upset users if this implementation is committed.
it defaults false
for scite
To avoid changing behaviour unexpectedly, SciTE should also default to no hiding or to hiding only on Win32.
for scite