Inputs

Started by
3 comments, last by kburkhart84 11 years, 2 months ago

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?

Advertisement
It's a bit hard to advise you with so little to go on. Try reducing the code you have to the smallest executable code that reproduces the problem. Then post that code so others can examine it.

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.

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.

My acer does that too...It sucks.



This topic is closed to new replies.

Advertisement