Skip to content

Commit

Permalink
Use WM_CHAR to hide the mouse cursor, instead of WM_KEYDOWN.
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma-axis committed Mar 4, 2024
1 parent 60a45e4 commit bba6bac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions reactive_dlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,13 +936,6 @@ LRESULT CALLBACK text_box_hook(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
switch (message) {
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
if (settings.textTweaks.hide_cursor) {
// hide the cursor on keyboard inputs.
POINT pt;
::GetCursorPos(&pt);
::ScreenToClient(hwnd, &pt);
TextBox::hide_cursor.on_edit(pt);
}
if (settings.textFocus.is_enabled() &&
focus_from_textbox(static_cast<byte>(wparam), hwnd)) {
// prevent the character that is pressed now to be written to the edit box,
Expand All @@ -956,6 +949,13 @@ LRESULT CALLBACK text_box_hook(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
}
break;
case WM_CHAR:
if (settings.textTweaks.hide_cursor) {
// hide the cursor on keyboard inputs.
POINT pt;
::GetCursorPos(&pt);
::ScreenToClient(hwnd, &pt);
TextBox::hide_cursor.on_edit(pt);
}
if (auto cnt = replace_tab_with_spaces(static_cast<wchar_t>(wparam), hwnd); cnt >= 0) {
// replace the message with the specified number of white space inputs.
if (cnt > 0)
Expand Down

0 comments on commit bba6bac

Please sign in to comment.