I am working on an app where I want to detect which key is pressed to launch the app 
(if any) so I can launch to a predefined view if that button was pressed.
This is what I currently have, and it SOMETIMES works and sometimes does not. very 
weird:

if (cmd == sysAppLaunchCmdNormalLaunch)
{               
        UInt32 _keyState = KeyCurrentState();
                
        if (EvtSysEventAvail(true))
        {
                EventType evt;
        
                EvtGetEvent (&evt, evtNoWait);
        
                if (evt.eType == keyDownEvent && 
TxtCharIsHardKey(evt.data.keyDown.modifiers, evt.data.keyDown.chr))
                {
                        switch (evt.data.keyDown.chr)
                        {
                                case vchrHard1:
                                        _keyState = 0x08;
                                        break;
                                case vchrHard2:
                                        _keyState = 0x10;
                                        break;
                                case vchrHard3:
                                        _keyState = 0x20;
                                        break;
                        }
                }
        }
.
.
.
later on I check the _keyState variable and handle it. the this is SOMETIMES there is 
a keyDown event when I press a hard key to launch, and sometimes there is not at this 
point.

Does anyone here know how to get this consistantly?

trv
-- 
Trevor Menagh, Software Engineer
iambic, Inc. (www.iambic.com)
[EMAIL PROTECTED]
http://www.trevreport.org/


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

Reply via email to