Results 1 to 3 of 3

Thread: Key State

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2010
    Posts
    31

    Key State

    Hello i need help with understanding the out put of the "GetAsyncKeyState" API function.

    Please help me with this:

    KeyIsDown(Holding): i think this is -32767
    Key Was Pressed once
    Key is released.

    Thanks

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: Key State

    Code:
    If GetAsyncKeyState(Keys.Space) = True Then
                    MsgBox("Spacebar was pressed")
                End If
    At the time this expression is evaluated, if the spacebar is being pressed, you will get the message box. What are you trying to do exactly?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Key State

    Maybe you should provide a full and clear description of what you're actually trying to achieve so we can advise the best way to achieve it.

    GetAsyncKeyState is intended to tell you the state of a keyboard key at the time you call it. It is often used inappropriately when what the user actually wants is to be notified when a key is depressed or released.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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