954,559 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Detect key input

Im trying to make a small game in visual basic 6. It requires the moving of a command button depending on the different key inputs. I have the code working when you push other command buttons that this one moves but I cant figure out how to detect when either the wasd keys are pushed or the arrow keys. If someone could give me a code snippet for detecting key input thatd be awesome.

nugget93
Newbie Poster
15 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

use the keydown,keypress, or keyup event of the command button and form (just in case the command button looses focus).

Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You