viewtopic.php?f=3&t=33093&p=194872&hilit=keyboard+clear#p194872
to break a combination of < DO WHILE > and < FOR NEXT > with < RETURN > I'm using
IF LASTKEY() = 13
IF MsgYesNo("Exit from topic collect ?", "EXIT" )
nPage := nPages + 10 // < do while > break
lBreak := .T. // < for next > break
ENDIF
ENDIF
at the end I call -> CLEARKEYBOARD()
the break only works once because the keybord-buffer still shows 13
At the end of the function I test with
MsgAlert( LASTKEY(), "Lastkey" ) still shows 13
any idea
- Code: Select all Expand view
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC( CLEARKEYBOARD )
{
MSG stMsg = { 0 };
HWND hWnd = ( HWND ) hb_parnl( 1 );
while( PeekMessage( &stMsg, hWnd, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) );
hb_ret();
}
#pragma ENDDUMP
regards
Uwe