Hi,
I am wanting to trap the Sony Jog Dial push (for a
hack). I have something sort of working by trapping
sysTrapEvtDequeueKeyEvent. However, I have to call
the trap before my work is done so that the eventP is
filled. This is bad because the Sony stuff gets done.
Is there a way for me to get eventP->data.keyDown.chr
and eventP->data.keyDown.modifiers without having to
call EvtDequeueKeyEvent? If there is, how can I then
pop off that key without having the Sony unit act upon
it?
I've included some source code to show you what I am
currently doing.
Err MyEvtDequeueKeyEvent(EventPtr eventP, UInt16 peek)
{
UInt32 temp;
Err (*oldTrap)(EventPtr, UInt16);
Err err;
McActivation mpActivation;
// get the address of the old EvtDequeueKeyEvent()
FtrGet(APP_ID, 0x3e9, &temp);
// set the function pointer to the old trap
oldTrap = (Err (*)(EventPtr, UInt16))temp;
// !!!! have to get eventP here :( !!!!
err = oldTrap(eventP, peek);
// do Sony Jog Dial work
if(err == 0)
HandleSonyJogDial(eventP);
return err;
}
static void HandleSonyJogDial(EventPtr eventP)
{
WChar chr;
// If all is good and it's a JogDial event
if(eventP->eType == keyDownEvent) {
chr = eventP->data.keyDown.chr;
if(eventP->data.keyDown.modifiers &
commandKeyMask) {
switch(chr) {
// details not necessary here
}
}
}
}
Thanks for your help.
Mike McCollister
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/