>Date: 9 Jun 1999 13:58:04 -0700
>From: Aaron Ardiri <[EMAIL PROTECTED]>
>Subject: Re: How to detect, which button has launched my app?
>
> yes.. it is possible..
>
> you need to check the "status" of the keys using a nilEvent
> (just like writing an animation engine).
>
> set your timeout to 0, and then check the key status with
>the method
>
> KeyCurrentState()
Well, I want to detect, which key has launched my app. The buttons are
mapped to my app. When the buttons are pressed, the OS launches my app. If I
want to detect which button is pressed, I have to detect it before I enter
the event loop. Currently the first statement in the PilotMain is
KeyCurrentState. It stores the key state, for future reference. This works,
but not always. If the button is pressed just long enough, KeyCurrentState
returns the correct key state. If the button is pressed momentarily, the OS
launches the app, but eats up the key down event in the process. I guess,
the only way out is to write a hack.
>read the docs on the way this method returns values.. but
>remember, pressing a hardkey does not trigger a catchable
>event (like an event handling event).. i wanted this, then
> i had to catch it myself - with nilEvents.
>
>hope this helps.
>az.
>- --
>Aaron Ardiri
>Lecturer http://www.hig.se/~ardiri/
>University-College i Gavle mailto:[EMAIL PROTECTED]
>SE 801 76 Gavle SWEDEN
>Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
>Mob: +46 70 352 8192 A/H: +46 26 10 16 11
The hardkey does trigger a catchable event. The catch is, the OS uses
the event to launch the app mapped to the button. So, you don't get it.
However, if your app is mapped to the button, and it is running then the app
does get the event. I use this event to switch forms. A keyDown handler in
the AppHandleEvent does the trick. As, no other event handlers are handling
the event, it filters down to AppHandleEvent, irrespective of the form
displayed.
I don't have to poll the keys in nilEvent. It works like a charm. Now,
if only I could get it when the app is launched !!!
Thanks for your input.
-Sugho-
P.S.: What does :P mean? Are you having a big smile?
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com