Results 1 to 6 of 6

Thread: Wierd problem

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2002
    Location
    I'll kick yo' @$$!!
    Posts
    44

    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

  2. #2

    Thread Starter
    Member
    Join Date
    Apr 2002
    Location
    I'll kick yo' @$$!!
    Posts
    44
    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

  3. #3
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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!

  4. #4

    Thread Starter
    Member
    Join Date
    Apr 2002
    Location
    I'll kick yo' @$$!!
    Posts
    44
    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

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2002
    Location
    I'll kick yo' @$$!!
    Posts
    44
    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

  6. #6
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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
  •  



Click Here to Expand Forum to Full Width