César,
Use the KEY_RELEASED_EVENT to control when a key has been released.
You'll need to store the key event in a variable (ex: key_5 = 1;) and set it
on the release event (ex: key_5 = 0). If you need to know how long the user
has pressed the key, store a timestamp in the variable and make the
difference on release.
Sorry for my bad english :)
Cheers,
Horaci Cuevas
----- Original Message -----
From: "César Fernández" <cfernandez@insidelabs.com>
To: <KEITAI-L@appelsiini.net>
Sent: Thursday, February 19, 2004 1:56 AM
Subject: (keitai-l) i-mode - DOJA - KEY_PRESSED_EVENT
> When using the processEvent() method for handling low level events such
> as a key press, I want to know how long a key is pressed. When a key is
> pressed one KEY_PRESSED_EVENT event is generated, and I think that no
> more events are generated while that key is pressed until the key is
> released. Suppose that I want, for example, print a '5' when the key #5
> is pressed, but if the key is still being pressed I want to keep on
> printing 5s while the key is pressed. Is there any way to get events
> generated while the key is pressed in order to do that?
Received on Thu Feb 19 08:10:40 2004