|
-
Apr 27th, 2002, 09:44 AM
#1
Thread Starter
Member
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.
XX The Signature of the Gods XX
-
Apr 27th, 2002, 09:46 AM
#2
Thread Starter
Member
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)?
XX The Signature of the Gods XX
-
Apr 27th, 2002, 10:42 AM
#3
Frenzied Member
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).
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 28th, 2002, 03:59 PM
#4
Thread Starter
Member
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.
XX The Signature of the Gods XX
-
Apr 28th, 2002, 04:03 PM
#5
Thread Starter
Member
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!
XX The Signature of the Gods XX
-
Apr 29th, 2002, 06:50 AM
#6
Frenzied Member
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
Sanity is a full time job
Puh das war harter Stoff!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|