Here's a thought (depending on what kind of accuracy you need): Have a handler that is either triggered on idle, or every so many milliseconds. In it push either LzKeys.downKeysHash or LzKeys.downKeysArray onto an array, along with the current time. Then analyze the array of keydowns to figure out what you need. Maybe that's no better than what you're doing, and you still won't be able to tell a press and hold from a rapid series of press and releases, but it's the best I can think of. From what I can gather this is a limitation of the Flash Player, not OpenLaszlo per se.

"The |onKeyDown| listenerEvent responds continuously while a key is pressed."

-Jason

Robin Sheat wrote:
In the demo for the LzKeys class in the reference manual, if you hold down a key you get a series of key events, e.g: key 75 down key 75 up key 75 down key 75 up key 75 down key 75 up key 75 down key 75 up ... this becomes a real problem when you simply want to know when a key is pressed, and then released later on. Is there a good way to work out if this is a key-repeat event, or a real key being pressed? In my case, I'm wanting to mark the time a key is pressed, and the time it's let go, and do something based on those two values. These fake events make that harder.

Cheers,
Robin.

--
Jason Stafford
Principal Developer
Inspiration Software, Inc.
The leader in visual thinking & learning

InspireData(tm), the newest innovative thinking and learning tool from
Inspiration Software(r), extends the proven power of visual learning to
data analysis. Learn more at www.inspiration.com.
503-297-3004 Extension 119
503-297-4676 (Fax)
9400 SW Beaverton-Hillsdale Highway
Suite 300
Beaverton, OR 97005-3300

Reply via email to