Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Grabbing input from two keys at once.

Author
Message
Robs
16
Years of Service
User Offline
Joined: 6th Jan 2008
Location: plano tx
Posted: 7th Jan 2008 06:13
I have input working for the up arrow, down arrow, left arrow, and right arrow. I also have rotations and movement for each key press.

What I'd like to do is be able to press right (rotate) and up (accelerate) at the same time.

How is this possible?
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 8th Jan 2008 05:28
It is definitely possible. You just need to make sure that you are not giving opposing commands when you make multiple input tests; that the tests are not mutually exclusive by your logic.

One way I counter that is by modifying a variable based on what is being pressed, and then use that variable to calculate the desired action. For instance:

Login to post a reply

Server time is: 2024-11-25 10:33:13
Your offset time is: 2024-11-25 10:33:13