That's because your keyDownEvent goes first trough the EventLoop, and
SysHandleEvent converts a hardKey pressing into an appStopEvent followed by
an app switch, so your event handler never gets a chance to handle that
event.
If you want to intercept those keys, you have several approaches:
a) You use a function that process the event as soon
as you do EvtGetEvent, and that dispatches new events
that won't get caught by SysHandleEvent. Complex,
modifies the event loop, but it is your form handler
that responds to events.
b) Very similar to a), but your function dispatches the
event with its own code, with different behaviours
for different forms. Simpler, modifies the event
loop, but you have some behaviours for your form
written in other place.
c) You mask the hardware keys with KeySetMask, so that
they won't generate keyDownEvents, and you use
nilEvents to poll for key state. This approach is
complex, but doesn't modify the event loop, so that
all the code for managing the key presses belongs
to your form.
----- Original Message -----
From: "Petra Bergler" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, September 12, 2001 1:41 PM
Subject: keyDownEvent
> Hi,
>
> I want to catch the hardware button events and read that I just have to
look
> for the keyDownEvent. There I have to look for the event.data.keyDown.chr
> value and look for hard1Chr ... hard4Chr.
>
> I tried to get the scroll buttons with pageUpChr and pageDownChr which
works
> fine ... but I don't receive a keyDownEvent at all when I click on memo
pad
> or the others ... so I can't say whether there is a "hard1Chr" or not ...
>
> Can anybody help me please ?
>
> Thanks a lot
> _____
> PE|RA
>
>
>
> --
> 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/