Jay Ts wrote:
[EMAIL PROTECTED] wrote:
but how can i send events with the software? I have only queried
can you send an example?

I just tried the suggestion with some of my existing code, and
this seems to work nicely for me:

void poweroff(void)     /* queue Power Off event */
{
        EventType newEvent;

        MemSet(&newEvent, sizeof(newEvent), 0);
        newEvent.eType = keyDownEvent;
        newEvent.data.keyDown.chr = vchrPowerOff;
/* or:  newEvent.data.keyDown.chr = vchrAutoOff; */
        newEvent.data.keyDown.modifiers = commandKeyMask;
        EvtAddEventToQueue(&newEvent);
        /* Won't get here ... but just in case: */
        FrmCustomAlert(ErrorAlert,"Power Off failed"," "," ");
}

(But beware, I only tested it on the Tungsten E Simulator thus far!)

You may want to comment out the last line; I don't know if it's
necessary(?).  ErrorAlert is just a simple alert form that I
created in the Resource Editor.

Jay Ts


I simply do:

EvtEnqueueKey( gROMVersion >= 0x32 ? vchrPowerOff : autoOffChr,
               evtNulKeycode, commandKeyMask );

using a different virtual character for OS 3.2+


--
Luc Le Blanc

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

Reply via email to