# KeyObject vs keyboard listener

**URL:** <https://forum.kirupa.com/t/keyobject-vs-keyboard-listener/328835>\
**Category:** flash\
**Created:** [June 22, 2012, 2:20am UTC](https://forum.kirupa.com/t/keyobject-vs-keyboard-listener/328835 "2012-06-22T02:20:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![figs](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@figs](https://forum.kirupa.com/u/figs)\
**Post date:** [June 22, 2012, 2:20am UTC](https://forum.kirupa.com/t/keyobject-vs-keyboard-listener/328835/1 "2012-06-22T02:20:53Z")

</div>

I’m writing a small game that in each frame requires knowing the state of the jump key (pressed or not pressed). I can set jump key state by using keyboard listeners to set the state, or I can use something like [Senocular’s KeyObject](http://www.senocular.com/flash/actionscript/?file=ActionScript_3.0/com/senocular/utils/KeyObject.as) and poll the key each frame of the game to get the state.

Would one be much more efficient than the other?
