At 12:20 PM +0100 2003/02/11, Einar �rn wrote:
> > cycles just processing your queue.  I'd rethink the need to post so many
>> events.  I'm sure another method would work without all the over-head.
>
>ok, I have unlimited power from my portable nuclear reactor. And I'm very
>interested in how EvtSetPenQueuePtr works. Do I have to restore the key
>queue to it's original value. The function is not documented at all.
>
>anyone knows? you will be my hero of the day!

Any application which needs larger input queues should probably be redesigned to avoid 
burning so many CPU cycles via main event loop processing, since that's directly 
related to battery life and perceived responsiveness. That said, here's the answer to 
your question:

EvtSetPenQueuePtr sets the pen queue not the key queue. You probably want 
EvtSetKeyQueuePtr. Both APIs are functionally identical however and neither API is 
supported in Palm OS 5.0 or later. Both are intended to be used by licensees very 
early in the boot process, so we make no guarantees that either of these APIs will 
work properly when called from a 3rd party application or shared library.

To use the APIs, allocate a chunk of memory using MemPtrNew(). Set its owner to 0 via 
MemPtrSetOwner(). The size of the chunk should be 6 + (n << 1) where n is the number 
of queue elements you want. The additional 6 bytes hold the queue header which is 
sizeof(KeyQueueType) and each queue elements is 2 bytes. In the case of the pen queue, 
it's 30 + (n << 2) because sizeof(PenQueueType) is 30 bytes and each queue element is 
4 bytes. The old queue chunk will be disposed via MemPtrFree(). Interrupts are 
disabled during these operations to ensure they're atomic since both queues are 
normally accessed from within system interrupt handlers. Old queue entries are not 
copied into the new queue structure which may cause the loss of event data depending 
on when the API is called. If dry skin, rash, or an itching sensation accompany use of 
this API, contact your doctor immediately.

Best Regards,

Jim Schram
PalmSource Inc.
Product Engineering

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

Reply via email to