Skip to content

Commit bba6bac

Browse files
committed
Use WM_CHAR to hide the mouse cursor, instead of WM_KEYDOWN.
1 parent 60a45e4 commit bba6bac

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

reactive_dlg.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -936,13 +936,6 @@ LRESULT CALLBACK text_box_hook(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
936936
switch (message) {
937937
case WM_KEYDOWN:
938938
case WM_SYSKEYDOWN:
939-
if (settings.textTweaks.hide_cursor) {
940-
// hide the cursor on keyboard inputs.
941-
POINT pt;
942-
::GetCursorPos(&pt);
943-
::ScreenToClient(hwnd, &pt);
944-
TextBox::hide_cursor.on_edit(pt);
945-
}
946939
if (settings.textFocus.is_enabled() &&
947940
focus_from_textbox(static_cast<byte>(wparam), hwnd)) {
948941
// prevent the character that is pressed now to be written to the edit box,
@@ -956,6 +949,13 @@ LRESULT CALLBACK text_box_hook(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
956949
}
957950
break;
958951
case WM_CHAR:
952+
if (settings.textTweaks.hide_cursor) {
953+
// hide the cursor on keyboard inputs.
954+
POINT pt;
955+
::GetCursorPos(&pt);
956+
::ScreenToClient(hwnd, &pt);
957+
TextBox::hide_cursor.on_edit(pt);
958+
}
959959
if (auto cnt = replace_tab_with_spaces(static_cast<wchar_t>(wparam), hwnd); cnt >= 0) {
960960
// replace the message with the specified number of white space inputs.
961961
if (cnt > 0)

0 commit comments

Comments
 (0)