Paul,

>Well, I've still not located a OS 3.3 ROM image...  but that hasn't stopped
>me from testing a little more...  I made one change and sent the resulting
>file back to the tester I have with OS 3.3.  This is the code I've removed:
>
>The below code is used to insert a single character into the queue, as if
>the user had used Graffiti to enter it.
>
>event.eType = keyDownEvent;
>event.data.keyDown.chr = 65;  // The letter "A"
>EvtAddEventToQueue (&event);
>
>Oddly enough, the tester reports that the program *DOESN'T* crash when he is
>using MiddleCapsHack... it only crashes when he is *NOT* using it..
>
>This worked fine in previous releases, but gives a fatal error on OS 3.3..
>Anyone see any problems with it?

1. You _definitely_ want to clear out the event record before setting up
specific fields. Especially since newer versions of the OS might depend on
(currently) unused bits being set to zero. If you have access to the OS
source, you'll see that the typical sequence for event posting is:

        MemSet(&event, sizeof(EventType), 0);
        <fill in specific fields>
        EvtAddEventToQueue(&event);

2. And more specifically, the keyCode and modifiers fields for the keydown
event you're trying to post should both be zero.

-- Ken

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


Reply via email to