Key pressing for a newbie
Hello, I'm working on a game and I realized that the KeyPress event of the PictureBox (I feel as KeyPress is a not-so-good-choice-to-use-keys) is slow and not good for what I'm doing.
What is the best choice to have detection of keys pressed quickly and continuatively without big gaps when changing key?
Example: imagine I must make a square moving in a picturebox. In my newbie way I would set the 8 movements to my favourite keys, and ok. The problem is that this way is slow and when I move it down, keeping the key pressed and then I press right releasing down, it takes much. I'd love to make it to change "instantly" direction.
Another thing:
what is - if it is related - the DirectInput?
Thanks a lot!
Re: Key pressing for a newbie
DirectInput is one good way, that I use, but the proper VB method to allow yourself to have more control without relying on DirectX would be this
http://www.vbforums.com/attachment.p...chmentid=36571
And there's also the GetAsyncKeyState API
http://www.mentalis.org/apilist/GetAsyncKeyState.shtml
Learn how these work, before jumping into DirectInput. ;)