Skip to content

Commit

Permalink
WinGUI keyboard input could be unresponsive. Fix for issue #310.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Gray committed Nov 30, 2023
1 parent 4f6ff6c commit 087c20c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion curses.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Defined by this header:
#define PDC_VER_CHANGE 0
#define PDC_VER_YEAR 2023
#define PDC_VER_MONTH 11
#define PDC_VER_DAY 11
#define PDC_VER_DAY 30

#define PDC_STRINGIZE( x) #x
#define PDC_stringize( x) PDC_STRINGIZE( x)
Expand Down
13 changes: 6 additions & 7 deletions wingui/pdckbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ extern int PDC_key_queue[KEY_QUEUE_SIZE];

bool PDC_check_key(void)
{
static int count;
MSG msg;

if( PDC_key_queue_low != PDC_key_queue_high)
return TRUE;
if( count++ == 100)
while( PDC_key_queue_low == PDC_key_queue_high
&& PeekMessage( &msg, NULL, 0, 0, PM_REMOVE) )
{
count = 0;
PDC_napms( 1);
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return FALSE;
return( PDC_key_queue_low != PDC_key_queue_high);
}

int PDC_get_mouse_event_from_queue( void); /* pdcscrn.c */
Expand Down

0 comments on commit 087c20c

Please sign in to comment.