# Help with LAG on.KeyisDown

**URL:** <https://forum.kirupa.com/t/help-with-lag-on-keyisdown/151650>\
**Category:** flash\
**Created:** [June 17, 2005, 1:38am UTC](https://forum.kirupa.com/t/help-with-lag-on-keyisdown/151650 "2005-06-17T01:38:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaToMaStEr](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MaToMaStEr](https://forum.kirupa.com/u/MaToMaStEr)\
**Post date:** [June 17, 2005, 1:38am UTC](https://forum.kirupa.com/t/help-with-lag-on-keyisdown/151650/1 "2005-06-17T01:38:21Z")

</div>

I have this problem. Let’s say i want to move a character when I pussh Key.RIGHT, the problem is, from the first time i push it, till the movement it’s done, there’s a little lag. It’s the same as if you push BACKSPACE… it doesn’t erase everything instantly, if you have this key pressed for a while, it start erasing. I have this problem with the movement, ir doesnt move instantly.

How can I fix this ?? I hope you understood…

this is the code i have…on the first frame of the main timeline:

```auto
man.onKeyDown = function(){
	if(Key.isDown(Key.RIGHT)){
		man._x += vel;
	}
}

```
