From 28dc5c7d38cc030485ad21547168d2b1f1848f58 Mon Sep 17 00:00:00 2001 From: ehouse Date: Wed, 22 Aug 2007 02:36:13 +0000 Subject: [PATCH] If we get keyUp event, override earlier determination that this device doesn't get them. This works around Tungsten double-key bug. Better fix will be to use the right FtrGet constants to set generatesKeyUp. --- palm/palmmain.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/palm/palmmain.c b/palm/palmmain.c index b268e62ec..51f26ffff 100644 --- a/palm/palmmain.c +++ b/palm/palmmain.c @@ -972,6 +972,7 @@ initHighResGlobals( PalmAppGlobals* globals ) # define hsFtrIDNavigationSupported 14 # endif err = FtrGet( sysFtrCreator, sysFtrNumUIHardwareFlags, &vers ); + XP_ASSERT( errNone == err ); globals->generatesKeyUp = ( (err == errNone) && ((vers & sysFtrNumUIHardwareHasKbd) != 0) ) || globals->isZodiac; @@ -2890,7 +2891,12 @@ mainViewHandleEvent( EventPtr event ) case keyUpEvent: XP_ASSERT( globals->generatesKeyUp ); - if ( globals->keyDownReceived ) { + /* work around not yet being able to set generatesKeyUp accurately + using FtrGet */ + if ( !globals->generatesKeyUp ) { + globals->generatesKeyUp = XP_TRUE; + globals->keyDownReceived = XP_FALSE; /* drop the event this once */ + } else if ( globals->keyDownReceived ) { globals->keyDownReceived = XP_FALSE; draw = handleKeyEvent( globals, event, &handled ); }