Sign in to follow this  
mypel16000

Inputs

Recommended Posts

Hi there, I have been developing a game for a while and I've realized that it has a problem. I can't aim with the mouse while the player is moving and I can't move when the player is shooting. In simple words, my code can't handle two inputs at a time. However, I sent it to a couple of friends and it works fine for them, so I think it might be a problem with my computer.

 

The code must be fine as it works on other people's computers, but if it doesn't in mine, it might not work on someone else's. I've tried to versions without luck:

 

while (App.getEvent(Event))

{

    If this is pressed exit

    ....

}

 

I also tried an if version and a switch version, but they don't work. Any ideas?

Share this post


Link to post
Share on other sites

The usual input processing is buffered and asynchronous, where you get a collection of all input events that happened since your last reading, and the process them doing appropriate actions. Maybe if your loop is reading only one at a time, and reacting to it, it works synchronously, and until it gets turned off, it wont switch to another one ?

make sure that any input reading is asynchronous, and independent of drawing.

Share this post


Link to post
Share on other sites

Sorry for the late response. i am glad to say that this wasn't a problem with my code, it was a problem with my computer.

In case anyone has this problem, it is an issue with HP laptops as the synaptics trackpad has a setting which is palm scrolling cancelling, which is there to basically stop you from moving the mouse while typing. This means that you can't move the mouse while typing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this