Skip to content

Commit

Permalink
Fix missed char when win32_get_ichar forces a fake key down event
Browse files Browse the repository at this point in the history
due to a key up without a previous key down.
  • Loading branch information
gwsw committed Oct 5, 2023
1 parent 09c1064 commit 6274eeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2988,7 +2988,6 @@ static int win32_key_event(XINPUT_RECORD *xip)
int repeat;

if (xip->ir.EventType != KEY_EVENT ||
!xip->ir.Event.KeyEvent.bKeyDown ||
((xip->ir.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED|LEFT_CTRL_PRESSED)) == (RIGHT_ALT_PRESSED|LEFT_CTRL_PRESSED) && xip->ir.Event.KeyEvent.uChar.UnicodeChar == 0) ||
(xip->ir.Event.KeyEvent.wVirtualScanCode == 0 && xip->ir.Event.KeyEvent.uChar.UnicodeChar == 0) ||
xip->ir.Event.KeyEvent.wVirtualScanCode == PCK_CAPS_LOCK ||
Expand All @@ -3001,6 +3000,8 @@ static int win32_key_event(XINPUT_RECORD *xip)

if (!win32_get_ichar(xip))
return (FALSE);
if (!xip->ir.Event.KeyEvent.bKeyDown)
return (FALSE);

if (win32_scan_code(xip))
return (TRUE);
Expand Down

0 comments on commit 6274eeb

Please sign in to comment.