VB Code Help

06/24/2014 22:37 harman101#1
Hey, Im just trying to make a simple ammo changer for practice, since its been some time since I last coded. However, I run the program, and it doesn't work.

So far, ive only programmed the x-4 key


[Only registered and activated users can see links. Click Here To Register...]

What am I doing wrong? I press CTRL and nothing happens...
06/24/2014 22:48 jmpl3#2
Use the function GetAsyncKeystate ... :)
06/24/2014 22:49 Requi#3
Because it only checks for it, if the Form is active.

This should help you:
[Only registered and activated users can see links. Click Here To Register...]
06/24/2014 22:54 harman101#4
Quote:
Originally Posted by Requi View Post
Because it only checks for it, if the Form is active.

This should help you:
[Only registered and activated users can see links. Click Here To Register...]
What do you mean, it only 'checks for it', I thought if the user has pressed ctrl, then it sends key?
06/24/2014 23:10 mustangv7#5
Quote:
Originally Posted by harman101 View Post
What do you mean, it only 'checks for it', I thought if the user has pressed ctrl, then it sends key?
The way you code it needs to have the form on focus. Instead of writing the ammo changer code into Form1_KeyDown, put it into a timer with interval 100ms for example.
06/25/2014 13:19 Arby#6
#moved
06/25/2014 18:16 'Heaven.#7
[Only registered and activated users can see links. Click Here To Register...]

Better use this low level keyboard hook