diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e4d0dae580..7c11770e24 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,13 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-10-20 22:50 UTC-0500 Paul Tucker + * source/rtl/inkey.c + ! reduce keyboard polling to <= once per tick. + ! Screen updating flies. + * source/rtl/philes.c + ! comparison to TRUE is not consistant with bool type in FREAD + 2002-10-20 16:18 UTC-0500 Paul Tucker * source/rdd/dbfntx/dbfntx1.c ! removed unused pLastPages diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 31d58d85a1..3a8bfd3659 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -74,6 +74,8 @@ #include "hbinkey.ch" #include "inkey.ch" +extern double hb_dateSeconds( void ); + #include #if defined( HB_OS_UNIX ) #include @@ -197,36 +199,43 @@ int hb_inkeyNext( HB_inkey_enum event_mask ) /* Return the next key without return hb_inkeyTranslate( key, event_mask ); } + void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour buffer */ { + static double dbLast; + HB_TRACE(HB_TR_DEBUG, ("hb_inkeyPoll()")); - if( hb_set.HB_SET_TYPEAHEAD || s_inkeyPoll ) + if( dbLast != hb_dateSeconds() ) { - int ch = hb_gtReadKey( s_eventmask ); - - switch( ch ) + if( hb_set.HB_SET_TYPEAHEAD || s_inkeyPoll ) { - case HB_BREAK_FLAG: /* Check for Ctrl+Break */ - if( !hb_set.HB_SET_CANCEL ) ch = 0; /* Ignore if cancel disabled */ - case HB_K_ALT_C: /* Check for extended Alt+C */ - case K_ALT_C: /* Check for normal Alt+C */ - if( hb_set.HB_SET_CANCEL ) - { - ch = 3; /* Pretend it's a Ctrl+C */ - hb_vmRequestCancel();/* Request cancellation */ - } - break; - case HB_K_ALT_D: /* Check for extended Alt+D */ - case K_ALT_D: /* Check for normal Alt+D */ - if( hb_set.HB_SET_DEBUG ) - { - ch = 0; /* Make the keystroke disappear */ - hb_vmRequestDebug(); /* Request the debugger */ - } - } + int ch = hb_gt_ReadKey( s_eventmask ); - hb_inkeyPut( ch ); + switch( ch ) + { + case HB_BREAK_FLAG: /* Check for Ctrl+Break */ + if( !hb_set.HB_SET_CANCEL ) ch = 0; /* Ignore if cancel disabled */ + case HB_K_ALT_C: /* Check for extended Alt+C */ + case K_ALT_C: /* Check for normal Alt+C */ + if( hb_set.HB_SET_CANCEL ) + { + ch = 3; /* Pretend it's a Ctrl+C */ + hb_vmRequestCancel();/* Request cancellation */ + } + break; + case HB_K_ALT_D: /* Check for extended Alt+D */ + case K_ALT_D: /* Check for normal Alt+D */ + if( hb_set.HB_SET_DEBUG ) + { + ch = 0; /* Make the keystroke disappear */ + hb_vmRequestDebug(); /* Request the debugger */ + } + } + + hb_inkeyPut( ch ); + } + dbLast = hb_dateSeconds(); } } diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index b822a1e2fc..496f7231ae 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -96,7 +96,7 @@ HB_FUNC( FREAD ) { PHB_ITEM pItem = hb_itemUnRef( hb_stackItemFromBase( 2 ) ); - if( pItem->item.asString.bStatic == TRUE || + if( pItem->item.asString.bStatic /* == TRUE */ || ( * pItem->item.asString.puiHolders ) > 1 ) hb_itemPutC( pItem, hb_parc( 2 ) );