Estoy tratando de "leer" lo que hay en el teclado (o mensajes WM_ "esperantes"). Estoy usando la funcion peekmessage() y no hay forma de que funcione.
A ver si algún alma caritativa tuviera a bien echarle un vistazo al codigo y así además de arreglarlo consigo no volverme loco
- Code: Select all Expand view
- //---------------------------------------------------------------------------//
METHOD KeyChar( nKey, nFlags ) CLASS TGet
local nHi, nLo
local lAccept
local bKeyAction:= SetKey( nKey )
local nDefButton
Local cMsg
/*
if ::bKeyChar != nil
if Eval( ::bKeyChar, nKey, nFlags, Self ) == 0
return 0
endif
endif
*/
*
*
#define PM_NOREMOVE 0x0000
#define PM_REMOVE 0x0001
#Define WM_KEYFIRST 0x0100
#Define WM_KEYLAST 0x0109
/*
* PeekMessage() Options
*/
#define PM_NOREMOVE 0x0000
#define PM_REMOVE 0x0001
#define PM_NOYIELD 0x0002
// #if (WINVER >= 0x0500)
#define PM_QS_INPUT (QS_INPUT << 16)
#define PM_QS_POSTMESSAGE ((QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16)
#define PM_QS_PAINT (QS_PAINT << 16)
#define PM_QS_SENDMESSAGE (QS_SENDMESSAGE << 16)
// #endif /* WINVER >= 0x0500 */
// #endif /* !NOMSG */
/*
* Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects()
*/
#define QS_KEY 0x0001
#define QS_MOUSEMOVE 0x0002
#define QS_MOUSEBUTTON 0x0004
#define QS_POSTMESSAGE 0x0008
#define QS_TIMER 0x0010
#define QS_PAINT 0x0020
#define QS_SENDMESSAGE 0x0040
#define QS_HOTKEY 0x0080
#define QS_ALLPOSTMESSAGE 0x0100
// #if(_WIN32_WINNT >= 0x0501)
#define QS_RAWINPUT 0x0400
// #endif /* _WIN32_WINNT >= 0x0501 */
#define QS_MOUSE NOR(QS_MOUSEMOVE,; // \
QS_MOUSEBUTTON)
// #if (_WIN32_WINNT >= 0x0501)
#define QS_INPUT NOR(QS_MOUSE ,; //\
QS_KEY ,; // \
QS_RAWINPUT)
// #else
// #define QS_INPUT (QS_MOUSE | \
// QS_KEY)
// #endif // (_WIN32_WINNT >= 0x0501)
#Define lTECLAS_PENDIENTES ;
; // PeekMessage( @cMsg, ::hWnd, WM_KEYDOWN, WM_KEYDOWN, PM_NOREMOVE )
; // PeekMessage( @cMsg, ::hWnd, 256, 258, PM_NOREMOVE )
; // PeekMessage( @cMsg, ::hWnd, WM_KEYFIRST, WM_KEYLAST, NOR(PM_NOREMOVE, QS_INPUT))
PeekMessage( @cMsg, ::hWnd, , , NOR(PM_NOREMOVE, QS_INPUT))
*
IF ::bKeyChar != nil
IF !lTECLAS_PENDIENTES
if Eval( ::bKeyChar, nKey, nFlags, Self ) == 0
return 0
endif
ELSE
msginfo("AHORRANDO teclas", cMsg)
RETURN 0
ENDIF
endif
....................................
Saludos