> On debug ROMs, if you pass virtual characters to TxtCharAttr, you'll
> get a non-fatal alert. On release ROMs, it will blindly use the
> character code value as an index into an array of attributes. Since
> this array only contains 256 elements, a virtual character winds up
> returning random data. That's why it just happened to work with
> vchrClock & vchrPopupBrightness, but not vchrNavChange.

Ahhh.  Thanks for the elucidation Ken.

> >if ( ( pEvent->eType == keyDownEvent ) &&
> >      ( !TxtGlueCharIsVirtual( pEvent->data.keyDown.modifiers,
> >pEvent->data.keyDown.chr ) )
> >{
> >     if ( TxtGlueCharIsPrint( pEvent->data.keyDown.chr ) )
> >     {
> >         do my thing
> >     }
> >     // else let system have it
> >}

I did end up implementing the solution this way, which seems like the right
way to go then, for all of the reasons you and Ben mentioned.

Actually I did this:

if ( pEvent->eType == keyDownEvent )
{
  if ( !TxtGlueCharIsVirtual( pEvent->data.keyDown.modifiers,
pEvent->data.keyDown.chr ) )
  {
    if ( TxtGlueCharIsPrint( pEvent->data.keyDown.chr ) )
    {
      do my thing
    }   // else let system have it
  }
}


Thank you Ken and Ben,

David Thacker


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to