# Key\_Down and all that nonsense!

**URL:** <https://forum.kirupa.com/t/key-down-and-all-that-nonsense/298130>\
**Category:** flash\
**Created:** [October 14, 2009, 1:49am UTC](https://forum.kirupa.com/t/key-down-and-all-that-nonsense/298130 "2009-10-14T01:49:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmacholl](https://avatars.discourse-cdn.com/v4/letter/n/65b543/32.png) [@nmacholl](https://forum.kirupa.com/u/nmacholl)\
**Post date:** [October 14, 2009, 1:49am UTC](https://forum.kirupa.com/t/key-down-and-all-that-nonsense/298130/1 "2009-10-14T01:49:31Z")

</div>

To the point:  
I have a event listener that manages all my key down events. Suppose I have two keys listened for. When Key A is down a variable is incremented. If key B is held down that variable is set to 0. In my case if someone holds down Key A - the variable increments over and over and over again to infinity. Using key\_down events, pressing Key B while holding down Key A sets the variable to 0 and that’s the end of that. I want to preserve Key A being held down so that after pressing Key B while holding down Key A the variable increments without pressing Key A again.

I hope that is clear.  
Thanks!
