Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO][VB6] Key tap question… Please Help! :D


DopeyBiach
 Share

Recommended Posts

How would I go about making it so that when I hold down a specific key, it doesn't rapidly use it..

Example:
So that if you hold down CTRL you attack ONCE, rather than repeatedly

However I want it so it's not as irritating focusing on the chatbox using enter.

PLEASE HELP MEH D:
Link to comment
Share on other sites

@Scott:

> Location (frmMain):
> ```
> Private Sub Form_KeyUp
> ```
>
> This handles Hotbar keys:
> ```
>     ' hotbar
>     For i = 1 To MAX_HOTBAR
>         If KeyCode = 111 + i Then
>             SendHotbarUse i
>         End If
>     Next
>
> ```

To clarify, 111 is vbKeyF1 - 1, so to use numbers instead, you code do vbKey1 - 1\.
Link to comment
Share on other sites

You could set say, a flag for the button you want pressed, and set it to 1 when pressed.. e.g. the following pseudo code:
```
If ButtonDown = True and Flag = 0 then
      Flag = 1
      Do Stuff here
ElseIf ButtonDown = False Then
      Flag = 0
EndIf
```
Basically, what that does is limit the use to ONE time per press, as the value only resets once you would release the button in question.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...