Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by hallsofvallhalla

I am having issues with getting Impact to recognize new key hits when one key is already held. For instance

	if( ig.input.state('left') ) 
{
//move player left
}

	if( ig.input.state('up') ) 
{
//move player up
}


	if( ig.input.pressed('up') ) 
{
alert("you pressed up");
}
	if( ig.input.pressed('left') ) 
{
alert("you pressed left");
}

if I press and hold up to make player move up then while holding up press left the key.pressed still fires the up key. It thinks I am pressing the first button to get pressed instead of registering that I am pressing left while holding up.

Anyone else notice this issue?

1 decade ago by dominic

That definitely shouldn&039;t happen. How do you bind your keys? Maybe the #alert() boxes get in the way? Try console.log() instead.

1 decade ago by Ant101

I am having the same issue (seems to affect input.state only, not input.pressed). To reproduce:

- Press and hold a key
- Press and hold a second key
- Release the first key (keeping the second held)
- ig.input.state will show the first key as still down.

1 decade ago by Ant101

Hmm, probably my fault - please ignore for now.
Page 1 of 1
« first « previous next › last »