FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Para Antonio Linares
Posts: 8
Joined: Tue Oct 24, 2006 11:32 AM
Para Antonio Linares
Posted: Fri Mar 23, 2007 12:53 PM

Estimado Antonio:

para limpiar el buffer del teclado tenemos en FWH algo parecido a "Clear Typeahead" de Clipper??
estuve buscando en \Samples\ pero no vi nada al respecto y en el foro nadie responde.

Mil gracias, maestro.
LORENZO

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Para Antonio Linares
Posted: Sat Mar 24, 2007 12:13 AM

Lorenzo,

Actualmente no proporcionamos dicha función, pero es fácil de construir, ya que su funcionamiento sería parecido a SysRefresh() pero para eliminar los mensajes de teclado pendientes

Vamos a construir un prototipo y lo publicaremos cuanto antes

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 115
Joined: Fri Oct 14, 2005 07:10 PM
Re: Para Antonio Linares
Posted: Tue Aug 31, 2010 01:13 PM

Hay alguna novedad respecto del mandato CLEAR TYPEAHEAD.
Necesito vaciar la memoria intermedia del teclado y no sé como hacerlo.

Saludos,

Gonzalo

Puerto Montt - CHILE

FWH 22.12 - Harbour 3.2.0dev (r2008190002) - Borland/Embarcadero C++ 7.0(32-bit)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Para Antonio Linares
Posted: Tue Aug 31, 2010 01:37 PM
gdeteran wrote:Hay alguna novedad respecto del mandato CLEAR TYPEAHEAD.
Necesito vaciar la memoria intermedia del teclado y no sé como hacerlo.


intenta usar hb_keyclear() de harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Para Antonio Linares
Posted: Tue Aug 31, 2010 02:00 PM
La función sería algo asi:
Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

BOOL IsModelessDialog( MSG * pMsg );
BOOL bWRunning( void );
HWND GetWndApp( void );
LPACCEL _SetAcceleratorTable( LPACCEL hNewAccelTable );

BOOL ClearKeyboard( void )
{
   LPACCEL hAccel = _SetAcceleratorTable( NULL );
   MSG msg;

   msg.message = 1;

   while( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) && msg.message != WM_QUIT )
   {
      if( ! IsModelessDialog( &msg ) &&
          !( hAccel && GetWndApp() &&
             TranslateAccelerator( ( HWND ) GetWndApp(), ( HACCEL ) hAccel, ( LPMSG ) &msg ) ) )
      {
         if( msg.message != WM_CHAR )
         {
            TranslateMessage( &msg );
            DispatchMessage( &msg );
         }
      }
   }

   if( bWRunning() && ( msg.message == WM_QUIT ) )
      PostQuitMessage( 0 );

   _SetAcceleratorTable( hAccel );

   return ( msg.message != WM_QUIT );

HB_FUNC( CLEARKEYBOARD )
{
   hb_retl( ClearKeyboard() );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 115
Joined: Fri Oct 14, 2005 07:10 PM
Re: Para Antonio Linares
Posted: Wed Sep 01, 2010 12:37 PM

Gracias Antonio y Daniel, probaré....

Saludos,

Gonzalo

Puerto Montt - CHILE

FWH 22.12 - Harbour 3.2.0dev (r2008190002) - Borland/Embarcadero C++ 7.0(32-bit)
Posts: 845
Joined: Sun Oct 09, 2005 05:36 PM
Re: Para Antonio Linares
Posted: Mon Feb 27, 2012 10:09 PM

que tal Antonio,

Tengo la necesidad de esta funcion..
la agregue a mi .prg al final y la mando llamar ClearKeyboard(),, pero me envia estos errores al compilar...

Declaration not allowed here in function ClearKeyboard
Declaration syntax error in function ClearKeyboard
Declaration missing in function ClearKeyboard
Compound statement missing } in function ClearKeyboard

uso xmate y xharbour
gracias
paco

____________________

Paco
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Para Antonio Linares
Posted: Mon Feb 27, 2012 10:26 PM

Paco,

Por favor copia aqui el reporte de error completo del compilador de C, gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 845
Joined: Sun Oct 09, 2005 05:36 PM
Re: Para Antonio Linares
Posted: Mon Feb 27, 2012 10:45 PM
Antonio,

pase los include, hasta el principio de mi .prg
#include <hbapi.h>
#include <windows.h>
y ahora envia estos errores...
Code (fw): Select all Collapse
[1]:Harbour.Exe Source\TAuditoria.prg  /m /n0 /gc0 /es2 /ip:\32bits\xHarbour_TEST\INCLUDE;P:\32BITS\FWH_TEST\INCLUDE;INCLUDE;P:\32bits\Borland\bcc582\Include /ip:\32bits\XHABFE~1\Include /dHB_API_MACROS /dHB_FM_STATISTICS_OFF /dHB_STACK_MACROS /ip:\32bits\XHABFE~1\Contrib\What32\Include /oObj\TAuditoria.c
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6717)
Copyright 1999-2010, http://www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Compiling 'Source\TAuditoria.prg'...
_stddef.h(38) Error E0030  Syntax error: "syntax error at 'INT'"
_stddef.h(56) Error E0025  Error in #if expression
_stddef.h(63) Error E0030  Syntax error: "syntax error at 'UNSIGNED'"
_stddef.h(82) Error E0030  Syntax error: "syntax error at 'INT'"
_stddef.h(91) Error E0030  Syntax error: "syntax error at 'UNSIGNED'"
_stddef.h(101) Error E0030  Syntax error: "syntax error at 'WCHAR_T'"
_stddef.h(110) Error E0030  Syntax error: "syntax error at 'WCHAR_T'"
_stddef.h(117) Error E0030  Syntax error: "syntax error at 'LONG'"
hbapi.h(570) Error E0025  Error in #if expression
9 errors

No code generated

gracias
paco
____________________

Paco
Posts: 505
Joined: Sat Apr 22, 2006 09:09 AM
Re: Para Antonio Linares
Posted: Sat May 31, 2014 09:54 AM

Hola paco:

Me gustaría saber si pudiste solucionar los errores y si limpiaba el buffer de teclado. Y si es así como.

Un saludo

Carlos

Colt Hop ED, S.L.
Carlos Blas Fernández Domínguez
Tlfo: 645847093
E-Mail: carlos@colthop.es

Nunca se termina de aprender, por eso necesito siempre ayuda.

Continue the discussion