# Keyboard input causes mouse to lag

**URL:** <https://forum.kirupa.com/t/keyboard-input-causes-mouse-to-lag/268435>\
**Category:** flash\
**Created:** [August 13, 2008, 8:28pm UTC](https://forum.kirupa.com/t/keyboard-input-causes-mouse-to-lag/268435 "2008-08-13T20:28:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kajenx](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@Kajenx](https://forum.kirupa.com/u/Kajenx)\
**Post date:** [August 13, 2008, 8:28pm UTC](https://forum.kirupa.com/t/keyboard-input-causes-mouse-to-lag/268435/1 "2008-08-13T20:28:52Z")

</div>

Hey guys, I love this forum, it always seems to have an answer for me, but I can’t figure this one out so I thought I’d finally post something.

So I’ve been working on a space shooter type game in AS3, and I have it so the user holds down the arrow keys or the WASD keys to move, and uses the mouse to shoot (left button). I keep running into this strange lag where the mouse just jumps around the screen like it’s lagging really badly, but the graphics still run fine at a smooth FPS.

I’ve narrowed down the problem. It only happens when you hold a key down and move the mouse. This can be any key, though, not just the moving keys, so at first I thought it was the listener. I tried deleting all the listeners for the keyboard, though, and the mouse would still lag if I held a key down.

Does anyone have an idea why this would happen? I can’t seem to isolate the problem. The game is almost complete, though, so there’s a lot of code there that could cause problems. :crying:
