Skip to main content
gamedev.net
🔒 Locked

[C#] problem with input

Started by deathtrap Oct 24, 2005 at 5:36 PM 1 replies 300+ views
Original Post
deathtrap
deathtrap
Hi, I'm having some undesired effects with my method of input. i'm using the Form.OnKeyDown event, however this doesnt work so well for holding down a key , since it continually fires this event every frame, thus resulting in a stop and go motion rather than smooth motion. Anyone know a way of getting around this? its really troublesome. Would DirectInput solve this?
BradSnobar
BradSnobar
I tried the event thing to solve this and some other input problems too. I ran into the same issue.

I used directinput to solve this. Basically, I just set a flag to true or false based on the current state.

Then I handle the state however, and whenever I like, probably during a pre-render phase.
Washu
Washu
That or pinvoke GetAsyncKeyState.
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Topic Locked

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

Sign in to reply to this topic.