Skip to content

Commit

Permalink
Windows: send key release events when losing focus, or the client app…
Browse files Browse the repository at this point in the history
… may never see them
  • Loading branch information
samhocevar committed Aug 20, 2024
1 parent db32ba2 commit dcabfa3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Backends/System/Windows/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ LRESULT WINAPI KoreWindowsMessageProcedure(HWND hWnd, UINT msg, WPARAM wParam, L
else {
kinc_internal_mouse_window_deactivated(kinc_windows_window_index_from_hwnd(hWnd));
kinc_internal_background_callback();
// Release all keys because the client app will not see the actual key release events
for (int i = 0; i < MAX_KEYS; ++i) {
if (keyPressed[i]) {
onKeyUp(hWnd, i);
}
}
controlDown = false;
#ifdef HANDLE_ALT_ENTER
altDown = false;
#endif
Expand Down

0 comments on commit dcabfa3

Please sign in to comment.