# A better wat of capturing keystrokes

**URL:** <https://forum.kirupa.com/t/a-better-wat-of-capturing-keystrokes/137995>\
**Category:** Uncategorized\
**Created:** [February 18, 2005, 10:15pm UTC](https://forum.kirupa.com/t/a-better-wat-of-capturing-keystrokes/137995 "2005-02-18T22:15:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nih](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@nih](https://forum.kirupa.com/u/nih)\
**Post date:** [February 18, 2005, 10:15pm UTC](https://forum.kirupa.com/t/a-better-wat-of-capturing-keystrokes/137995/1 "2005-02-18T22:15:11Z")

</div>

Hello!

I’m a bit of a flash noob, and I’m having a few issues with keypresses being over-captured. In this case if the movie runs slowly for any reason, keypresses are being queued up and then executed for quite some time after the key was released. This introduces a really nasty laggy feeling. You can try it here:

[http://darken.spark.lithotech.co.nz/pier\_island\_02.zip](http://darken.spark.lithotech.co.nz/pier_island_02.zip)

It’s a zipped projector file. You need to have an athlon 2600 or less, or just run another SWF in the background to see the effect.

This is how I currently capture keypresses:

```auto
if (Key.isDown(Key.RIGHT)) {
	if (_root.world_rotate_velocity > (_root.max_rotate_velocity * -1)) {
		_root.world_rotate_velocity -= _root.rotate_acceleration;
	}
}

```

Does anyone have a better technique for capturing keypresses?
