I do this when I map Application keys (You can put it in your
Event loop, but it's best if you work it into its own function)
hardKeyState = KeyCurrentState( ) & ( key1 | key2 | key3 );
switch( hardKeyState )
{
case key1:
{
// commands here
break;
}
case key2:
{
// commands here
break;
}
case key3:
{
// commands here
break;
}
default:
{
break;
}
And then to ignore the system commands, I inject this into the
Event loop, before you call SysHandleEvent:
if (event.eType == keyDownEvent &&
event.data.keyDown.chr == hard1Chr ||
event.data.keyDown.chr == hard2Chr ||
event.data.keyDown.chr == hard3Chr &&
!(event.data.keyDown.modifiers & poweredOnKeyMask))
{
continue;
}
If you're following that, then what you're doing should be correct.
If POSE continues to have problems, then you might need to get in
touch with Keith Rollin. I don't use POSE, as I develop Symbol
products (and their hardware cannot be emulated by POSE yet), so
there's no way I can tell if that works. But what I did above works
for me...but since no one else was answering, and I map the keys
quite often...
-Rus
>-----Original Message-----
>From: Daniel Seifert [mailto:[EMAIL PROTECTED]]
>Sent: Monday, July 17, 2000 2:48 PM
>To: Palm Developer Forum
>Subject: Start
>
>
>Hi,
>
>I�ve asked a couple of times already, but never got an answer. I
>can�t believe that no-one has any idea regarding my problem or that
>none does know about KeyCurrentState() etc. Please, please, please,
>I am getting really desperated over the weeks.
>
>I am writing an application (OS 3.5) that is started each time the
>Palm is turned on. I now want to know why the Palm woke up.
>(hardware button or because of the hotsync button or an alarm)
>Currently I am doing the following:
>
> keystat = KeyCurrentState();
>
> // if we were switched on due to an alarm or the hotsync-button
> // and if the corresponding options is set, don�t do anything
> if ( ((keystat == 0) || (keystat == keyBitCradle))
> && (prefs->hotsync) )
> {
> return;
> }
>
>The beta tester says that it is working correctly, but on the
>emulator (Linux version of Pose 3.06a) KeyCurrentState does
>sometimes not return that a button has been pressed although the
>Palm has been switched on by the power button (keyBitPower).
>Does anybody know for sure whether it�s a problem of Pose or
>whether the above attempt is completely wrong? I can�t find
>any documention on KeyCurrentState on this topic.
>In fact, the manual does just say: "[KeyCurrentState()] return bit
>field with bits set for each key that is currently depressed." How
>do I have to interprete "currently"? Does this (a) mean in this very
>moment or (b) while the corresponding event is in the queue?
>
>
>--
> Tschau, ICQ 28589118 PGP-Key available
> Daniel [EMAIL PROTECTED]
> http://www.dseifert.de/ Berlin, Germany
>
>--
>For information on using the Palm Developer Forums, or to
>unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/