Results 1 to 4 of 4

Thread: Using GetAsyncKeyState() ...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Israel
    Posts
    636

    Arrow Using GetAsyncKeyState() ...

    Hi,

    I have a question,

    How can I use the GetAsyncKeyState() function to do a one pressing key like i'll press space and it will work just once but i'm still holding the space bar. it will do it again when i'll release the space bar and then press it again. How can I do it? Any code?

    Thank you,
    Arie.

    now.at/daymgr

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Israel
    Posts
    636
    No one knows?
    Try again, Please help me,
    Arie.

    now.at/daymgr

  3. #3
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    It's really easy

    Here's some pseudo-code:

    VB Code:
    1. Static PressingKeyLastTime as Boolean
    2. If Not PressingKeyLastTime Then
    3.     If GetAsyncKeyState(KEY) Then
    4.         PressingKeyLastTime = True
    5.         'Do Something :)
    6.     End If
    7. Else
    8.     If Not GetAsyncKeyState(KEY) Then
    9.         PressingKeyLastTime = False
    10.     End If
    11. End If

    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  4. #4
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    You're welcome
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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