In case anyone else is wondering, I figured out how to do this.

Register for sysNotifyVirtualCharHandlingEvent and then handle these events by checking for the hsChrSide character.

When you get the hsChrSide character, call SysUIAppSwitch to launch the application

Here's the notification code:

if(np->notifyType == sysNotifyVirtualCharHandlingEvent)
{
    SysNotifyVirtualCharHandlingTag* tag = (SysNotifyVirtualCharHandlingTag*)np->notifyDetailsP;
    WChar chr = tag-> keyDown.chr;
    if(chr == hsChrSide)
    {
        // launch our app...
        UInt16 cardNo;
        LocalID dbID;
        UInt32 result;
        DmSearchStateType searchState;
        Err err = DmGetNextDatabaseByTypeCreator (true, &searchState, sysFileTApplication,
            appFileCreator, true, &cardNo, &dbID);
        err = SysUIAppSwitch (cardNo, dbID, sysAppLaunchCmdNormalLaunch, NULL);
        np->handled = true;
    }
}

I would still like to know how I can use keyBitExt2Side, since it seems like it might be better than calling HsKeysPressed, which causes the emulator to pause to tell me it's deprecated, and is what I have been using.

-Ben Bloomfield

On 11/30/05, Benjamin Bloomfield < [EMAIL PROTECTED]> wrote:
Thanks, but how do I use these constants?

That header file mentions KeyCurrentStateEx, but I can find nothing of this function.

Anyway, what I'd really like to use the side button for is launching my app, but I'd prefer to not have to have to hold it down for a second or so.  Is there any way to do this?

-Ben Bloomfield

On 11/23/05, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
Ben,

If you don't have the Palm_SDK_Headers.zip package from Palm's Plugged  In download site you should get it.  These headers have what you need.

The file HsKeyTypes.h contains the define you need.
#define keyBitExt2VolumeUp              0x00000100      // Volume Up
#define keyBitNumExt2VolumeUp                    8
#define keyBitExt2VolumeDown    0x00000200      // Volume Down
#define keyBitNumExt2VolumeDown                  9
#define keyBitExt2Side                  0x00000400      // Side button
#define keyBitNumExt2Side                               10

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

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

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

Reply via email to