Skip to content

Commit

Permalink
[FIX]: key modifiers were cleared without a key event.
Browse files Browse the repository at this point in the history
Key modifiers were incorrectly cleared when checking for an event. Now they are updated only after a key event.

Before this commit, for instance, the num lock status, along with the rest of the modifiers, was cleared when polling for a new key event. After this commit, the modifiers are not cleared without a correct update of the status, only when a new key is pressed. This aligns with the key behavior in other flavors such as wingui.
  • Loading branch information
okibcn authored and Bill-Gray committed May 9, 2023
1 parent c744e3e commit 9229f08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions wincon/pdckbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,6 @@ static int _process_mouse_event(void)

int PDC_get_key(void)
{
SP->key_modifiers = 0L;

if (!key_count)
{
DWORD count;
Expand All @@ -752,6 +750,7 @@ int PDC_get_key(void)
switch (save_ip.EventType)
{
case KEY_EVENT:
SP->key_modifiers = 0L;
return _process_key_event();

case MOUSE_EVENT:
Expand Down

0 comments on commit 9229f08

Please sign in to comment.