Skip to main content
GameDev.net gamedev.net
🔒 Locked

Inputs

Started by mypel16000 Jan 20, 2013 at 11:26 AM 3 replies 1.5k views
Original Post
mypel16000
mypel16000

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?

LennyLen
LennyLen
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.
Mercile55
Mercile55

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.

mypel16000
mypel16000

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.

kburkhart84
kburkhart84

My acer does that too...It sucks.



Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.