Results 1 to 3 of 3

Thread: How to set a multiple key press event?

  1. #1

    Thread Starter
    Lively Member Satangel's Avatar
    Join Date
    Aug 2000
    Location
    KL,Malaysia
    Posts
    85

    Talking set a mutiple key press event

    anybody know how to set a mutiple key press event like
    i wanna make the command button move right by pressing
    left arrow and right arrow key. When i press both the command button will move right little bit.

    [Edited by Satangel on 09-12-2000 at 09:04 PM]

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    What do you mean by 'go toward'?

    You would, I think, have to use public boolean variables to flag whether each key was up or down, setting them to true on the KeyDown event and false in the KeyUp event. Then when they press either key you can check to see if the other key is held down.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    New Member
    Join Date
    Sep 2000
    Location
    Russia
    Posts
    15
    Try to use GetAsyncKeyState(vbKeyCode) this function returns <>0 if key pressed and =0 if it don't pressed.
    You can use If GetAsyncKeyState(vbkeyA)<>0 and GetAsyncKeyState(vbkeyB)<> 0 and .... GetAsyncKeyState(vbkeyZ)<> 0 then.
    Vodka, womens, computer...

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