-
Wierd problem
I've been posting with questions like it's my job lately. Anyways, here's the new one:
I'm using the GetAsyncKeyState function to get keys down, in this game so far the only keys I'm using are the directionals and the spacebar. I have no code telling the game to do anything special when up and right are down, but it wont shoot when up and right are down! The reason I'm not showing any code here or going into much detai is because my question is simple; is there some kind of bugs when directionals are held down or something? Because I've seen this error in other places too, not just in VB.
-
Yeah, there must be a bug, I just replaced the directional keys with aswd, and it works fine. Anyone know what's wrong with the directionals? Is it because of Windows XP maybe (lol)?
-
hm that really is a wierd problem I used the GEtAsyncKeyState for a long time an never had problems... anyways why don't you just use the GetKeyState or DirectInput(It works even better).
-
I would love to! Knowing different functions can never be a bad thing, and GetAsyncKeyState is teh only one I know for getting keys down.
-
K, I lokoed in this API Guide thing I just downloaded yesterday.. What's the difference between GetAsyncKeyState and GetKeyState? Also, It doesn't say anything for DirectInput.. is it a DirectX function?
One more thing.. What are the constants for a key being down, toggled and not toggled? When I use GetAsyncKeyState, I just say if GetAsyncKeyState = 0 or if GetAsyncKeyState <> 0, I don't know the toggle const!
-
as far as I know GetKeyState wont give you the same states of the key like the Async but it just tells you if it is pressed or not. It works fine for games though!
No directX requires a little bit more code since you need to initalize a DX object than the Dinput object and a keybuffer (I think) and than it's pretty straight forward
I think you can find help on this (with code and explanations)
on www.DirectX4vb.com