Results 1 to 3 of 3

Thread: Need to get a key in VB

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Posts
    149

    Need to get a key in VB

    Okay I searched the forum and I couldnt find a way to get a keypress. What would the code be to get say the right arrow key? Im not sure what event or how to trigger such an event. I have a form in VB.NET and the game runs on the form.

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I am not sure how you do it in VB.NET but at least in regular VB, you can choose diffrent events for a form, and one of them are key_up. That one or Key_down or key_press can be used to get a hold of a keypress...

  3. #3
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    Also in regular vb there are built in constants for each key.
    For the right key it's vbKeyRight and for enter/return vbKeyReturn etc...
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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