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.

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

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.