Frank,

>     Hello all.  In pose, my application usually chugs along happily
>until, eventually, a form with a text field that I handle comes along
>and a nasty gremlin gives it a special character (downArrowChr,
>upArrowChr, etc.).  At that point, I am told that I have read from
>low memory and that I'm a paperclip head.  Why does this happen?  The
>extent of my key handling is listing below:
>
>        case keyDownEvent:
>                switch(e->data.keyDown.chr) {
>                case nextFieldChr:
>                        next_field(kDown);
>                        handled = true;
>                        break;
>                case prevFieldChr:
>                        next_field(kUp);
>                        handled = true;
>                        break;
>                }
>                break;
>
>     Should I handle the case of those special chars and just throw
>them away?  Or is there an elegant way to handle this?  Thanks.

This isn't a solution to your problem, but a side note. Before checking for
"virtual" characters (such as nextFieldChr & prevFieldChr), you should
first make sure that the command bit is set in the keydown event record's
modifier field.

Currently none of the defined virtual character codes overlap with "real"
characters, but in the future that could very well change (e.g. with
Unicode). For example, the virtual character prevFieldChr (0x010C) has the
same character code as that popular Unicode character LATIN CAPITAL LETTER
C WITH CARON.

Unfortunately, there's a bug in the Graffiti dictionary where the command
bit isn't getting set for some of the virtual characters, including
prevFieldChr.

The final 3.1 headers will include a TxtCharIsVirtual macro, but for now
the workaround is to treat a character as virtual if either (a) the command
bit is set in the keydown event modifier field, or (b) the rom version is <
3.2 AND the character code is >= 0x0100 AND <= 0x02FF.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 650-947-9222 (direct) +1 408-261-7550 (main)


Reply via email to